Important:  Ensure that your account funding balance is sufficient.  Review pricing and funding options at: https://app.docupost.com/funds 

When testing, make sure that you cancel all test postcards after testing your integration.  Cancelling within an hour of testing will ensure that your letter is not mailed, and that your funds will be refunded.

Endpoint: 

https://app.docupost.com/api/1.1/wf/sendpostcard

Method: POST

Auth: API token in query string

Querystring Parameters:

  • api_token - (string) Your DocuPost account API token is used to authenticate all API requests.  Generate a token here.  Do not share your API token with untrusted applications or users.

  • front_image - (string) A valid image URL for the front of your postcard. Image should be 1875 x 1275. PNG recommended. Your API request will succeed but your mailing will later fail if the image is the incorrect size.
     
  • back_image - (string) A valid image URL for the back of your postcard. Image should be 1875 x 1275. PNG recommended. Your API request will succeed but your mailing will later fail if the image is the incorrect size. Important: Your recipient/sender and postage information will be automatically overlaid onto your image. See our template here. 
     
  • to_name - (string) The name of your recipient (who the postcard is being sent to) Must be less than 40 characters.

  • to_address1 - (string) The address of your recipient.

  • to_address2 - (optional) (string) The second line address for your recipient.

  • to_city - (string) The city of your recipient.

  • to_state - (string) The 2-letter abbreviation code ONLY for your recipient U.S. state.  Mail will fail to send if an invalid state is supplied.

  • to_zip - (string) The 5-digit postal code for your recipient

  • from_name - (string) Your sender / return address name. Must be less than 40 characters.

  • from_address1 - (string) The address of your sender/return address.

  • from_address2 - (optional) (string) The second line address for your sender/return address.

  • from_city - (string) The city of your sender/return address.

  • from_state - (string) The 2-letter abbreviation code ONLY for your sender's U.S. state.  Mail will fail to send if an invalid state is supplied.

  • from_zip - (string) The 5-digit postal code for your recipient

 

Put together, your POST request would look something like this:

https://app.docupost.com/api/1.1/wf/sendpostcard?api_token={YOUR_API_TOKEN}&to_name=John Doe&to_address1=123 Test Ln&to_city=Los Angeles&to_state=CA&to_zip=90210&from_name=Sender Corp&from_address1=123 test Rd&from_city=Los Angeles&from_state=CA&from_zip=90210&front_image={YOUR_FRONT_IMAGE_URL}&back_image={YOUR_BACK_IMAGE_URL}

 

Errors and troubleshooting

Your data will be validated at the time of making the API call to ensure your API token is correct and your account balance is sufficient.

If you receive a success message but your mailpiece displays "Error" on your Dashboard, this means there was a problem processing your request or graphics.

Images must be 1875 x 1275 pixels. Be sure that all of your query string parameters are valid based on the above documentation (for example, character limit and 2-letter state abbreviation codes)

If you are still having problems after troubleshooting, please reach out to us.