Authentication
Every request to the Tomba API carries an API key and your account secret as headers. Apps that act on behalf of other Tomba users use OAuth 2.0 access tokens instead.
Request headers
| Header | Value |
|---|---|
X-Tomba-Key | An API key: ta_ followed by 37 characters. |
X-Tomba-Secret | Your account secret: ts_ followed by a UUID. |
Your account has one secret, shared by all of its keys. Keys are what you create, name, expire, and revoke for each integration.
Keep both values on a server (Security). Anyone who obtains them can spend your credits, and every key of an account shares the account's rate limits.
Get your key and secret
Create keys and copy your secret on the API keys page of the dashboard. GET /v1/me also returns the secret, as secret_token.
Key expiry
- Every key expires. The default and maximum lifetime is 365 days. When you create a key through the API, set
expires_in_daysto any value from 1 to 365. - Tomba emails the account owner 30 days, 7 days, and 1 day before a key expires.
GET /v1/keysreturns each key'sexpires_atandexpiredfields.
A request with an expired key fails with status 400 and error type api_key_expired. The response includes an X-Tomba-Key-Expired header with the expiry time in RFC 3339 format:
Code
Rotate keys
To replace a key without downtime:
- Create a new key in the dashboard or with
POST /v1/keys. - Deploy the new key to your integration.
- Delete the old key in the dashboard or with
DELETE /v1/keys/{id}.
Code
The response returns the new key in data.message:
Code
PUT /v1/keys/{id} rotates a key in place instead: it issues a new value with a new 365-day term, and the old value stops working immediately. The response doesn't include the new value; read it with GET /v1/keys/{id}.
To rotate the secret, use Settings in the dashboard. Every key then works only with the new secret, so update all integrations at once.
| Operation | Endpoint |
|---|---|
| List keys | GET /v1/keys |
| Get a key | GET /v1/keys/{id} |
| Create a key | POST /v1/keys |
| Rename a key | PATCH /v1/keys/{id} |
| Rotate a key | PUT /v1/keys/{id} |
| Delete a key | DELETE /v1/keys/{id} |
The number of active keys an account can hold depends on its plan; expired keys don't count toward it. In a workspace, GET /v1/keys returns the keys of every member, including their values.
OAuth 2.0
Apps that act on behalf of other Tomba users, such as MCP clients and workflow tools, use OAuth 2.0 and send the access token as Authorization: Bearer <access_token>.
| Item | Value |
|---|---|
| Discovery | https://api.tomba.io/.well-known/oauth-authorization-server |
| Authorization endpoint | https://app.tomba.io/oauth/authorize |
| Token endpoint | https://api.tomba.io/v1/oauth/token |
| Revocation endpoint | https://api.tomba.io/v1/oauth/revoke |
| Dynamic client registration | https://api.tomba.io/v1/oauth/register |
| Device authorization | https://api.tomba.io/v1/oauth/device |
| Grant types | Authorization code with PKCE (S256), refresh token, device code |
| Token lifetime | Access tokens: 15 minutes. Refresh tokens: 30 days. |
Request only the scopes your app needs:
| Scope | Grants access to |
|---|---|
search | Domain search, email finder, author finder, LinkedIn finder, phone finder, similar domains, technology, company search, domain suggestions |
verify | Email verifier |
enrich | Email enrichment, person, company, and combined enrichment, email sources |
leads | Leads, lead lists, lead attributes, bulk jobs |
account | Account settings and API keys |
read | Account details, rate limits, email count, email format, location, domain status, phone validator |
GET /v1/logs and GET /v1/usage don't accept OAuth tokens; call them with a key and secret. Users review and revoke app access under Connected apps.
The remote MCP server accepts additional credential formats; its page lists them.
Endpoints without authentication
The Logo API and GET /v1/domain-status need no credentials.
Errors
| Status | errors.type | Cause |
|---|---|---|
| 400 | authentication_failed | A credential header is missing or malformed. |
| 400 | api_key_expired | The key is past its expiry date. |
| 401 | authentication_failed | The key and secret don't match an account, or the account can't use the API yet: it's unconfirmed, has no password set, or its subscription has expired. The message says which. |
| 403 | authentication_failed | The account is blocked or deleted. |
| 401 | invalid_token | The OAuth access token is invalid, expired, or revoked. |
| 403 | insufficient_scope | The OAuth access token lacks the scope the endpoint needs. |
Errors lists every error type.