Developer Documentation

Generate API Token

Overview

Generate an API token to authenticate requests when using DocuPost APIs. Keep your token secure to prevent unauthorized access.

Generate API Token

Step-by-step
  1. Navigate to Developer page

  2. Click Generate API Token

  3. Copy the generated token

  4. Store the token securely

Managing Your API Token

API Token Security

Keeping your API token secure is important for protecting your interactions with DocuPost APIs. Here are some best practices to ensure the safety of your API token.

  • Do not share your API token with untrusted users or applications. This helps prevent unauthorized access to your account.

  • Store your API token in a secure location, such as an environment variable or a secrets management tool.

  • Regularly review access logs and monitor for suspicious activity.

If your API token becomes compromised, it is important to take immediate action. You can revoke or generate a new token from your Developer page. This will disable the compromised token, preventing any further unauthorized access.

Using Your API Token

To use the API token in your requests, include it in the query string of your HTTP request. This token authenticates your request with the DocuPost service. Keep your token private and do not share it with anyone you do not trust.

DocuPost provides two main API endpoints for sending mail:

Send Letter API: https://app.docupost.com/api/1.1/wf/sendletter (method: POST) Send Postcard API: https://app.docupost.com/api/1.1/wf/sendpostcard (method: POST)

Here's how to use the API token with these endpoints:

  1. Generate an API token from your Developer page on DocuPost.

  2. Use the Send Letter API endpoint to send letters programmatically via U.S. mail.

  3. Use the Send Postcard API endpoint to send postcards via U.S. mail.

  4. Include your API token in the query string for authentication.

Revoking or re-generating Token

If your API token becomes compromised, you should revoke or re-generate it. This ensures unauthorized users can't access your account.

  • When you believe your token has been leaked

  • If you no longer trust an application using your token

  • When you are updating your security protocols

To revoke or re-generate your API token, follow these steps:

  1. Go to the Developer page on your DocuPost account.

  2. Locate the section labeled API Tokens.

  3. To create a new token, click on the Generate New Token button.

  4. Note down the new token for future use.

Frequently Asked Questions

  • An API token is a unique key required for authenticating API requests to DocuPost. Treat it like a password and do not share it with untrusted users or applications.

  • You can revoke an API token from your Developer page. This will invalidate the token and prevent it from being used in future requests.

  • Yes, you can regenerate your API token from the Developer page. This will provide you with a new token, and the old one will become invalid.

  • If your token is compromised, revoke it immediately from the Developer page and generate a new one to ensure security.