For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

API Tokens

Learn how to create, manage, and use API tokens for Email Sandbox.

You need an API Token to integrate Email Sandbox via the API. If you're working with the SMTP, you don't need an API Token.

How to add and manage tokens manually

1

Navigate to Settings in the menu on the left and select API Tokens.

2

To add a new token, click the Add Token button in the upper-right corner.

3

Type the token name into the designated field.

It’s perfectly fine to have a custom name for the API token, as it’s only for your reference, regardless of the use case.

4

Assign permissions by checking the boxes in the corresponding access level columns. You can also give Account Admin access to the token and get access to all Projects, Sandboxes, and users on that account.

If you want to test how it works, you need to get authenticated using your API token. Mailtrap uses Bearer Authentication, so you must pass the token under the Authorization header of your email.

5

Click the Save button and preview the new token under the API Tokens main menu.

How to reset API Tokens from the API Tokens menu

Go to API Tokens, click the three-dot menu icon next to the token you want to reset, and click Reset API Token.

Confirm your choice by clicking on the corresponding button.

Setting an expiration date

By default, any new API tokens you create are set to expire after 365 days. However, when creating a new one, you can set the expiration to 1, 7, 30, 90, 180, or 365 days, or even add a custom date from the drop down menu.

Expired tokens automatically stop working for API authentication but remain visible in the token list with their expiration date. They become eligible for automatic cleanup after 90 days.

To help users rotate their tokens in time and avoid unexpected authentication failures, we’ll send proactive notifications through both email and in-app notifications. Users will be notified:

  • 30 days before expiration - for tokens valid for at least 180 days

  • 3 days before expiration

  • when the token expires

You can also set a token to never expire, but you'll need to confirm this in an additional security prompt.

How to delete a token

To delete a token, click the three-dot menu icon and choose the Delete token option.

Confirm the action by clicking the Confirm button.

Last updated

Was this helpful?