Authentication and API keys

Every request to the Email Verification API must include your API key. This page explains how to send it and how to create, rotate and revoke it.

Send your key with every request#

Pass the key as a bearer token in the Authorization header:

Authorization: Bearer YOUR_API_KEY

As an alternative, you can send it in an X-API-Key header:

X-API-Key: YOUR_API_KEY

If the key is missing, malformed, unknown or revoked, the API answers 401 with the error code invalid_api_key and a WWW-Authenticate header. See Errors and status codes.

Create your API key#

Your account has one API key.

  1. In the portal sidebar, select API Keys.
  2. Select Create key.
  3. Enter a Name that tells you where it's used, for example Production server, then select Create.
  4. Copy the key and store it safely, then select I've saved it.

Warning

The full key is shown only once, when it is created. We can't show it again. If you lose it, rotate the key to get a new one.

API keys start with tn_. The API Keys page shows the start of your key, its Status, when it was Created and when it was Last used.

Keep your key safe#

Rotate your key#

Rotating replaces your key with a new one. Use it when a key may have leaked, or as a regular security habit.

  1. On API Keys, select Rotate.
  2. Confirm with Rotate key.
  3. Copy the new key and update it everywhere you use the API.

Warning

The old key stops working immediately. Update your servers straight away to avoid failed requests.

Revoke your key#

Revoking switches the key off for good. On API Keys, select Revoke, then Revoke key. Requests with that key then fail with 401 invalid_api_key. To use the API again, create a new key.