Skip to main content
The Dotlet API supports two ways to authenticate, depending on where the request comes from. Most endpoints accept either method. DNS record endpoints are the exception: create, get, update, delete, and sync on /api/v1/registrar/dns/{domain_name}/records/* currently accept an API key only. Listing records (GET /api/v1/registrar/dns/{domain_name}/records) accepts either method, same as everything else.

Authenticate with an API key

Generate an API key from your Dotlet dashboard, then pass it on every request in the X-API-Key header.
Treat your API key like a password. Don’t commit it to version control or expose it in client-side code. If a key is exposed, revoke it from your dashboard and generate a new one.

Authenticate with a bearer token

For endpoints that operate on behalf of a signed-in user, obtain a token from the password token endpoint and send it in the Authorization header.
Tokens expire. If a request fails with a 401, request a new token rather than retrying with the expired one.
This example works because listing DNS records accepts either an API key or a bearer token. Creating, reading a single record, updating, deleting, or syncing records currently accepts an API key only, use X-API-Key for those, even in a session-based context.

Handling authentication errors

Next step

Quickstart

Use your API key to check domain availability and register your first domain.