How to send a letter through API

The automatic way to send your letter

API stands for application programming interface. Our API documentation contains several different endpoints that allow you to interact with Stannp without accessing our platform. For example, whilst using your own CRM. We primarily use GET and POST endpoints. A GET endpoint usually will allow you to "get" information from Stannp like the status of one of your recipients. A POST endpoint will typically allow you to send us information. All of our endpoints that let you send postcards or letters are POST endpoints. 

All endpoints will require your API key. This can be found in your API settings.

Specific details about sending a letter which I will be discussing below can be found on this page.


Send a single letter

POST : https://us.stannp.com/api/v1/letters/create

This endpoint is the primary way to send letters through the API. You can find all the parameters below.

Either send a letter by using the template parameter and selecting one of your already designed letter templates or, use the file parameter and supply us with a binary, URL or base64 encoded string. It's important to note that if you're supplying us with a URL the file needs to be presented as either a PDF or DOC file.

It is also important to supply recipient information. address1 and zipcode are the minimum required to get a valid address. However, it is always best to supply us with all the information you have regarding the address. 

There are also a number of great options you can pick between. Let us know if you want your letter to be duplex or simplex or, if you wish for it to have a clearzone around your address block for maximum address readability. You can also add a "tag" with tags which can help you track your sends.  How to send a letter through API-image1

If you wish to send an XL window envelope all you need to do is set the size parameter to "US-LETTER-XL-WINDOW". 


Sending a Mail-merged letter

POST : https://us.stannp.com/api/v1/letters/post

Alternatively, you can supply an already mail-merged pdf with the address already present and have us read it. However, the address does still need to have a placement in line with our design guide. This is because we will be scanning a specific place on the page for the address information. If it is not there, then we cannot use the address information.

Several points noted in the previous section also apply to this request. 

How to send a letter through API-image2