Getting Started
Core Concepts
Resources
Introduction
The Intelliprint API is organized around REST. Every resource has a predictable URL. Every endpoint accepts request bodies encoded as JSON, or with form encoding. Responses are JSON-encoded, with standard HTTP status codes. For information about ourAPI pricing plansand volume discounts, visit our pricing page.
All cost amounts must be converted to GBP by taking the amount and dividing it by 100000000 (10**8). We use integers while accounting for 8 decimal places to avoid floating point errors and still being able to provide accurate bulk usage discounts. As a UK-based service, we integrate directly withRoyal Mail delivery servicesfor optimal reliability.
Base URL
https://api.rnbdata.uk/v1
SDKs
Authentication
For authentication, we use API keys provided in the Authorization header using HTTP Bearer authentication. Learn more about ourenterprise-grade security practicesfor keeping your API communications secure.
You can generate an API key on our platform. Intelliprint API uses account-level API keys to authenticate you to your account. There are no separate API keys for test mode. Instead, when you want to create a test Print Job, just set the testmode parameter to true.
API Key Authentication
Authorization: Bearer YOUR_API_KEY
Security Notice
Keep your API keys secure and never expose them in client-side code. If you believe your API key has been compromised, you can generate a new one from your dashboard.
Testing
To test a Print Job, set testmode
to true
while uploading it.
You do not pay for test Print Jobs, even if you confirm them. They are never sent out.
Test Print Jobs don't show up in the regular list of Print Jobs, you have to set the testmode parameter to true when retrieving the list of Print Jobs to get back testmode Print Jobs.
Print Job objects have a testmode boolean attribute which you can use to check if a particular Print Job is in testmode.
Testmode Print Jobs are deleted from the system a week after they're confirmed.
Demo Files
Here are some demo files you can use for creating a Print Job:
Multiple Letters
Use split_by_content and set the splitting word to "Dear". This file with these splitting options should result in 100 separate letters.
Download Multiple LettersRate Limits
The Intelliprint API has a rate limit of 100 requests per 1 minute.
If you surpass this limit, the API will reply with the rate_limited
error (HTTP status code 429).
If you plan on making more frequent requests than that, you should implement methods that automatically retry a request that fails with the rate_limited
error code after waiting for some time.
Example Response
{
"error": {
"message": "You're making too many requests, please wait a few seconds then try again",
"type": "rate_limited",
"code": "rate_limited"
}
}
Errors
On top of detailed JSON-encoded error messages, Intelliprint also gives back conventional HTTP status codes you can use to determine the result.
2.x.x status codes mean the request succeeded. 4.x.x status codes mean an error on your end (You can refer to the error.message to learn more). 5.x.x status codes mean an error on Intelliprint's end.
Error Object Breakdown
Field | Description |
---|---|
message | This is a human readable message describing the error. |
type | The type of error. One of invalid_request_error , authentication_error , rate_limited or internal_error . |
code | The error code. One of body_too_large , body_incorrect_format , parameter_invalid , parameter_missing , parameter_unknown , no_api_key , invalid_api_key , forbidden , payment_error , not_found , rate_limited or internal_error . |
param | Not always present. The parameter that caused the error. |
Example Error Response
{
"error": {
"message": "Missing required param: file",
"type": "invalid_request_error",
"code": "parameter_missing",
"param": "file"
}
}
Print Jobs
Print Jobs are what you will be interacting with the most. They are the heart of Intelliprint.
You can implement Print Jobs however you want. If your use case is entirely programmatic, you can send thousands of letters addressed to thousands of people with just one API call.
Or if your use case is based around humans, you can make multiple calls, starting with a draft, previewing it, editing it, and then finally confirming it.
Create a Print Job
Create a new Print Job. Set confirmed
to true
once you're sure about the Print Job. You can do this when creating the Print Job itself, or by updating it. A confirmed Print Job cannot be updated anymore and will be sent for printing.
Request Body Parameters
Parameter | Description |
---|---|
file REQUIRED | The multipart/form-data encoded file for this Print Job. |
reference | An optional user-provided reference for this Print Job. |
confirmed | Whether to confirm this Print Job immediately, or to leave it as a draft. |
testmode | Whether to mark this Print Job as a test. |
splitting | method - The splitting method to use for this file. One of phrase - The word or phrase to split letters using. Only used when splitting.method is set to pages - The number of pages each letter should be. Only used when splitting.method is set to |
printing | double_sided - Whether to print these letters double sided. One of double_sided_specific_pages - The array of pages to print double sided. Only used when printing.double_sided is set to premium_quality - Whether to print these letters in premium quality. |
postage | service - The service to send this letter with. One of ideal_envelope - The ideal envelope size for these letters. One of mail_date - The unix timestamp (Adjusted to day) to send this letter out on. Note: All UK postal services comply with Royal Mail delivery standards. For UK addresses, we automatically validate postcodes against the Royal Mail Postcode Address File for optimal delivery rates.Learn more about our Hybrid Mail service |
background | first_page - The ID of the Background to apply to the first page of these letters. other_pages - The ID of the Background to apply to all other pages of these letters. |
confidential | Whether to mark letters of this Print Job as confidential. |
extra_documents | An array containing extra documents to be added to letters. The Extra Document Object: id - The ID of an existing extra_document of this Print Job. documentREQUIRED IF ID IS NOT PROVIDED The multipart/form-data encoded file for this extra_document. order - The order of this extra_document. One of ordering_number - Only applicable for custom ordering. Where in the letter to place this extra_document. apply_background - Whether to apply the background to this extra_document as well. |
remove_letters | with_phrase - Remove letter objects that have this phrase in their content. |
nudge | x - What amount in mm to move the first page of each letter horizontally. A positive number moves the page right, a negative number moves the page left. y - What amount in mm to move the first page of each letter vertically. A positive number moves the page down, a negative number moves the page up. |
confirmation_email | Whether a confirmation email should be sent to the user or account's email address when this letter is confirmed. |
metadata | A key-value object for storing any information you want to along with this Print Job. |
Example Request
curl https://api.rnbdata.uk/v1/prints \
-u key_EXAMPLE: \
-F testmode=true \
-F file=@single_letter.pdf
Example Response
{
"id": "print_ID",
"object": "print",
"account": "acc_ID",
"user": null,
"team": null,
"reference": "single_letter.pdf",
"confirmed": false,
"pages": 1,
"sheets": 1,
"file": {
"name": "single_letter.pdf",
"pages": 1
},
"splitting": {
"method": "none",
"phrase": null,
"pages": null
},
"printing": {
"double_sided": "no",
"double_sided_specific_pages": null,
"premium_quality": false
},
"postage": {
"service": "uk_second_class",
"ideal_envelope": "c5",
"mail_date": null
},
"background": {
"first_page": null,
"other_pages": null
},
"confidential": false,
"extra_documents": [],
"remove_letters": {
"with_phrase": null,
"series": []
},
"nudge": {
"x": null,
"y": null
},
"letters": [
{
"id": "ltr_ID",
"object": "letter",
"status": "draft",
"pages": 1,
"sheets": 1,
"postage_service": "uk_second_class",
"envelope": "c5",
"address": {
"name": "Mr A B Sample",
"line": "Sample Address 1\nSample Address 2\nSAMPLE TOWN\nSample County\n",
"postcode": "AB1 2CD",
"country": "GB"
},
"tracking_number": null,
"print_stream": "uk_second_class_c5",
"cost": {
"amount": 49,
"after_tax": 59,
"currency": "GBP"
},
"shipped_date": null,
"pdf_status": "built",
"pdf": "https://files.rnbdata.uk/example"
}
],
"cost": {
"amount": 40,
"after_tax": 59,
"currency": "GBP"
},
"confirmation_email": true,
"testmode": true,
"created": 1629361000,
"confirmed": false,
"confirmed_at": null,
"metadata": {}
}
Retrieve a Print Job
Retrieve an existing Print Job.
Example Request
curl https://api.rnbdata.uk/v1/prints/print_ID \
-u key_EXAMPLE:
Example Response
{
"id": "print_ID",
"object": "print",
"account": "acc_ID",
"user": null,
"team": null,
"reference": "single_letter.pdf",
"confirmed": false,
"pages": 1,
"sheets": 1,
"file": {
"name": "single_letter.pdf",
"pages": 1
},
"splitting": {
"method": "none",
"phrase": null,
"pages": null
},
"printing": {
"double_sided": "no",
"double_sided_specific_pages": null,
"premium_quality": false
},
"postage": {
"service": "uk_second_class",
"ideal_envelope": "c5",
"mail_date": null
},
"background": {
"first_page": null,
"other_pages": null
},
"confidential": false,
"extra_documents": [],
"remove_letters": {
"with_phrase": null,
"series": []
},
"nudge": {
"x": null,
"y": null
},
"letters": [
{
"id": "ltr_ID",
"object": "letter",
"status": "draft",
"pages": 1,
"sheets": 1,
"postage_service": "uk_second_class",
"envelope": "c5",
"address": {
"name": "Mr A B Sample",
"line": "Sample Address 1\nSample Address 2\nSAMPLE TOWN\nSample County\n",
"postcode": "AB1 2CD",
"country": "GB"
},
"tracking_number": null,
"print_stream": "uk_second_class_c5",
"cost": {
"amount": 49,
"after_tax": 59,
"currency": "GBP"
},
"shipped_date": null,
"pdf_status": "built",
"pdf": "https://files.rnbdata.uk/example"
}
],
"cost": {
"amount": 40,
"after_tax": 59,
"currency": "GBP"
},
"confirmation_email": true,
"testmode": true,
"created": 1629361000,
"confirmed": false,
"confirmed_at": null,
"metadata": {}
}
Update a Print Job
Update an existing Print Job. Set confirmed
to true
once you're sure about the Print Job. A confirmed Print Job cannot be updated anymore and will be sent for printing.
Request Body Parameters
Parameter | Description |
---|---|
reference | An optional user-provided reference for this Print Job. |
confirmed | Whether to confirm this Print Job, or to leave it as a draft. |
splitting | method - The splitting method to use for this file. One of phrase - The word or phrase to split letters using. Only used when splitting.method is set to pages - The number of pages each letter should be. Only used when splitting.method is set to |
printing | double_sided - Whether to print these letters double sided. One of double_sided_specific_pages - The array of pages to print double sided. Only used when printing.double_sided is set to premium_quality - Whether to print these letters in premium quality. |
postage | service - The service to send this letter with. One of ideal_envelope - The ideal envelope size for these letters. One of mail_date - The unix timestamp (Adjusted to day) to send this letter out on. |
background | first_page - The ID of the Background to apply to the first page of these letters. other_pages - The ID of the Background to apply to all other pages of these letters. |
confidential | Whether to mark letters of this Print Job as confidential. |
extra_documents | An array containing extra documents to be added to letters. The Extra Document Object: id - The ID of an existing extra_document of this Print Job. documentREQUIRED IF ID IS NOT PROVIDED The multipart/form-data encoded file for this extra_document. order - The order of this extra_document. One of ordering_number - Only applicable for custom ordering. Where in the letter to place this extra_document. apply_background - Whether to apply the background to this extra_document as well. |
remove_letters | with_phrase - Remove letter objects that have this phrase in their content. |
nudge | x - What amount in mm to move the first page of each letter horizontally. A positive number moves the page right, a negative number moves the page left. y - What amount in mm to move the first page of each letter vertically. A positive number moves the page down, a negative number moves the page up. |
confirmation_email | Whether a confirmation email should be sent to the user or account's email address when this letter is confirmed. |
metadata | A key-value object for storing any information you want to along with this Print Job. |
Example Request
curl https://api.rnbdata.uk/v1/prints/print_ID \
-u key_EXAMPLE: \
-F confirmed=true
Example Response
{
"id": "print_ID",
"object": "print",
"account": "acc_ID",
"user": null,
"team": null,
"reference": "single_letter.pdf",
"confirmed": false,
"pages": 1,
"sheets": 1,
"file": {
"name": "single_letter.pdf",
"pages": 1
},
"splitting": {
"method": "none",
"phrase": null,
"pages": null
},
"printing": {
"double_sided": "no",
"double_sided_specific_pages": null,
"premium_quality": false
},
"postage": {
"service": "uk_second_class",
"ideal_envelope": "c5",
"mail_date": null
},
"background": {
"first_page": null,
"other_pages": null
},
"confidential": false,
"extra_documents": [],
"remove_letters": {
"with_phrase": null,
"series": []
},
"nudge": {
"x": null,
"y": null
},
"letters": [
{
"id": "ltr_ID",
"object": "letter",
"status": "draft",
"pages": 1,
"sheets": 1,
"postage_service": "uk_second_class",
"envelope": "c5",
"address": {
"name": "Mr A B Sample",
"line": "Sample Address 1\nSample Address 2\nSAMPLE TOWN\nSample County\n",
"postcode": "AB1 2CD",
"country": "GB"
},
"tracking_number": null,
"print_stream": "uk_second_class_c5",
"cost": {
"amount": 49,
"after_tax": 59,
"currency": "GBP"
},
"shipped_date": null,
"pdf_status": "built",
"pdf": "https://files.rnbdata.uk/example"
}
],
"cost": {
"amount": 40,
"after_tax": 59,
"currency": "GBP"
},
"confirmation_email": true,
"testmode": true,
"created": 1629361000,
"confirmed": false,
"confirmed_at": null,
"metadata": {}
}
Cancel or Delete a Print Job
Deletes an unconfirmed Print Job.
If a Print Job is confirmed, all letters in the Print Job with the status waiting_to_print
will be cancelled instead and the amount charged will be refunded. The Print Job will not be deleted.
Example Request
curl https://api.rnbdata.uk/v1/prints/print_ID \
-u key_EXAMPLE: \
-X DELETE
Example Response
{
"id": "print_ID",
"object": "print",
"deleted": true
}
List Print Jobs
By default, only live Print Jobs are returned.
Set the testmode
parameter to true
and the API will return only testmode Print Jobs.
Request Query Parameters
Parameter | Description |
---|---|
testmode | Whether to return live or only test mode Print Jobs. By default, only live Print Jobs are returned. |
confirmed | If set to false , only unconfirmed Print Jobs are returned. If set to true , only confirmed Print Jobs are returned. |
letters.status | The comma separated statuses to filter. Any Print Job that has any letter within it with a matching status is returned. |
limit | The number of Print Jobs to return. Must be between 1 and 1,000. By default, 10 Print Jobs are returned. |
skip | The number of results to skip over before returning. Useful for pagination. |
Example Request
curl https://api.rnbdata.uk/v1/prints \
-u key_EXAMPLE: \
-d limit=1 \
-d letters.status="sent,printing" \
-G
Example Response
{
"object": "list",
"data": [
{
"id": "print_ID",
"object": "print",
"account": "acc_ID",
"user": null,
"team": null,
"reference": "single_letter.pdf",
"confirmed": false,
"pages": 1,
"sheets": 1,
"file": {
"name": "single_letter.pdf",
"pages": 1
},
"splitting": {
"method": "none",
"phrase": null,
"pages": null
},
"printing": {
"double_sided": "no",
"double_sided_specific_pages": null,
"premium_quality": false
},
"postage": {
"service": "uk_second_class",
"ideal_envelope": "c5",
"mail_date": null
},
"background": {
"first_page": null,
"other_pages": null
},
"confidential": false,
"extra_documents": [],
"remove_letters": {
"with_phrase": null,
"series": []
},
"nudge": {
"x": null,
"y": null
},
"letters": [
{
"id": "ltr_ID",
"object": "letter",
"status": "draft",
"pages": 1,
"sheets": 1,
"postage_service": "uk_second_class",
"envelope": "c5",
"address": {
"name": "Mr A B Sample",
"line": "Sample Address 1\nSample Address 2\nSAMPLE TOWN\nSample County\n",
"postcode": "AB1 2CD",
"country": "GB"
},
"tracking_number": null,
"print_stream": "uk_second_class_c5",
"cost": {
"amount": 49,
"after_tax": 59,
"currency": "GBP"
},
"shipped_date": null,
"pdf_status": "built",
"pdf": "https://files.rnbdata.uk/example"
}
],
"cost": {
"amount": 40,
"after_tax": 59,
"currency": "GBP"
},
"confirmation_email": true,
"testmode": true,
"created": 1629361000,
"confirmed_at": null,
"metadata": {}
}
],
"total_available": 1001,
"has_more": true
}
The Print Job Object
Property | Description |
---|---|
id | The ID of this Print Job object. |
object | The type of object. This is always print . |
account | The ID of the account this Print Job belongs to. |
user | The user object who created this Print Job, can be null as well. |
team | The ID of the team the user belongs to, can be null as well. |
reference | A user-provided reference for this Print Job. |
confirmed | Whether this Print Job is confirmed. |
pages | The total number of pages in this Print Job. |
sheets | The total number of paper sheets to be used for this Print Job. |
file | name - The name of the uploaded file. pages - The number of pages in the uploaded file. |
mail.failed | Mail item has failed to process or deliver |
Backgrounds
Use a Background object to add a background to a Print Job.
You need to specify the Background's ID to a Print Job's background.first_page
and/or background.other_pages
for it to be applied.
The Background Object
Property | Description |
---|---|
id | The ID of this Background object. |
object | The type of object. This is always background . |
name | The user-provided name of this Background. |
filename | The name of the uploaded file. |
team | The Team object this Background belongs to. |
preview | The URL for a PNG preview image of this Background. |
created | The UNIX timestamp of when this Background was created. |
Retrieve a Background
Retrieve an existing Background.
Example Request
curl https://api.rnbdata.uk/v1/backgrounds/bg_ID \
-u key_EXAMPLE:
Example Response
{
"id": "bg_ID",
"object": "background",
"name": "background.pdf",
"filename": "background.pdf",
"team": null,
"preview": "https://api.rnbdata.uk/v1/files/pics/bg_ID.png",
"created": 1629361000
}
Update a Background
Update an existing Background.
Request Body Parameters
Parameter | Description |
---|---|
name | The user-provided name of this Background. |
team | The Team ID to assign this Background to. |
Example Request
curl https://api.rnbdata.uk/v1/backgrounds/bg_ID \
-u key_EXAMPLE: \
-d name="My Background"
Example Response
{
"id": "bg_ID",
"object": "background",
"name": "My Background",
"filename": "background.pdf",
"team": null,
"preview": "https://api.rnbdata.uk/v1/files/pics/bg_ID.png",
"created": 1629361000
}
Delete a Background
Delete a Background.
Example Request
curl https://api.rnbdata.uk/v1/backgrounds/bg_ID \
-u key_EXAMPLE: \
-X DELETE
Example Response
{
"id": "bg_ID",
"object": "background",
"deleted": true
}
List Backgrounds
List all available Backgrounds.
Request Query Parameters
Parameter | Description |
---|---|
team | The Team ID for which Backgrounds to return. |
limit | The number of Backgrounds to return. Must be between 1 and 1,000. By default, 10 Backgrounds are returned. |
skip | The number of results to skip over before returning. Useful for pagination. |
Example Request
curl https://api.rnbdata.uk/v1/backgrounds \
-u key_EXAMPLE: \
-d limit=1 \
-G
Example Response
{
"object": "list",
"data": [
{
"id": "bg_ID",
"object": "background",
"name": "My Background",
"filename": "background.pdf",
"team": null,
"preview": "https://api.rnbdata.uk/v1/files/pics/bg_ID.png",
"created": 1629361000
}
],
"total_available": 1001,
"has_more": true
}
Tools
Modify your files with Tools.
The Merge Tool Object
Property | Description |
---|---|
id | The ID of this Merge object. |
object | The type of object. This is always merge . |
download_link | The download link for the resulting file. |
Merge Files
Merge multiple files together.
Request Body Parameters
Parameter | Description |
---|---|
files REQUIRED | An array of multipart/form-data encoded files to merge together. |
Example Request
curl https://api.rnbdata.uk/v1/tools/merge \
-u key_EXAMPLE: \
-F files[]=@1.pdf \
-F files[]=@2.pdf
Example Response
{
"id": "merge_ID",
"object": "merge",
"download_link": "https://api.rnbdata.uk/v1/tools/merge/merge_ID/download"
}
Errors
On top of detailed JSON-encoded error messages, Intelliprint also gives back conventional HTTP status codes you can use to determine the result.
2.x.x status codes mean the request succeeded. 4.x.x status codes mean an error on your end (You can refer to the error.message to learn more). 5.x.x status codes mean an error on Intelliprint's end.
Error Object Breakdown
Field | Description |
---|---|
message | This is a human readable message describing the error. |
type | The type of error. One of invalid_request_error , authentication_error , rate_limited or internal_error . |
code | The error code. One of body_too_large , body_incorrect_format , parameter_invalid , parameter_missing , parameter_unknown , no_api_key , invalid_api_key , forbidden , payment_error , not_found , rate_limited or internal_error . |
param | Not always present. The parameter that caused the error. |
Example Error Response
{
"error": {
"message": "Missing required param: file",
"type": "invalid_request_error",
"code": "parameter_missing",
"param": "file"
}
}
Register for API Access
To get started with our API, you'll need to create an account and request API credentials. This process ensures that only authorized developers have access to our services.
1. Create an account on our dashboard.
2. Navigate to the "Developers" section of your account.
3. Request API access by clicking the "Enable API Access" button.
Authentication Guide
Once you have API access, you'll need to generate and use your API keys for secure authentication.
1. Generate your API key in the "API Keys" section of the developer dashboard.
2. Securely store your API key - it will only be shown once.
3. Include your API key in the Authorization header of all API requests.
Authorization: Bearer YOUR_API_KEY
Sandbox Testing Environment
Before going live, use our sandbox environment to test your integration without sending real mail.
To use the sandbox, simply set testmode
to true
in your API requests.
Test mode operations have no cost and don't result in real mail being sent.
The sandbox environment functions exactly like production, allowing you to test all API features.
// Example sandbox test request
const response = await axios.post('https://api.rnbdata.uk/v1/prints', {
// Request parameters
testmode: true // Enable sandbox mode
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
});
Going Live: Production Guide
Once you've thoroughly tested your integration in the sandbox, you're ready to switch to production mode.
1. Ensure you've completed comprehensive testing in the sandbox environment.
2. Set testmode
to false
or omit it completely in your API requests.
3. Monitor your first few production requests to ensure everything works as expected.
4. Set up webhooks to receive real-time status updates for your mail.
Production Checklist
- Implement proper error handling
- Set up retry mechanisms with exponential backoff
- Secure API key storage
- Implement address validation
- Set up proper logging and monitoring
Ready to Integrate?
Get your API key and start sending mail programmatically in minutes.