Authentication
Every request to /v1, except the OpenAPI document, needs an API token. The API has no OAuth, no sessions and no cookies.
API tokens
- Where. Create tokens under API tokens in your account panel. Give each one a name that says where it is used.
- Format. A token is 57 characters and starts with
nb_live_, such asnb_live_4uK0…. The prefix lets secret scanners recognize a token that leaks into a repository or a log. - Shown once. The panel shows the full token only when you create it. Copy it then; NameBeta keeps only a hash.
- Your account. A token acts as the account that created it. Requests count against that account's plan, whichever token sends them; more tokens do not add quota.
- Up to 10. An account can hold at most 10 active tokens. Revoke one to create another.
- Optional expiry. When you create a token, the panel offers Never (the default), 30 days, 90 days or 365 days. You can revoke a token at any time; an expired or revoked token gets
401withinvalid_token.
The same token also works for the MCP server, which additionally requires a paid plan.
Sending the token
Send the token in the Authorization header with the Bearer scheme (RFC 6750):
GET /v1/domains/kettlory.com/availability HTTP/1.1
Host: api.namebeta.com
Authorization: Bearer nb_live_…
A token in the query string or the body is ignored, so the request fails as if no token was sent: tokens in URLs end up in logs and browser histories.
Rotating and revoking
Revoking a token in the panel takes effect on the next request; anything still using it gets 401 with invalid_token.
To replace a token without downtime:
- Create a new token in the panel.
- Deploy it wherever the old one is used.
- Revoke the old token. The panel's Last used column shows whether anything still uses it.
If a token leaks, revoke it first and replace it afterwards. Keeping an API token safe has advice on storing one.
When authentication fails
The response is 401 Unauthorized with a WWW-Authenticate header and the usual error body:
| Case | error.code | WWW-Authenticate |
|---|---|---|
No Authorization header, or not in the Bearer <token> form | unauthenticated | Bearer realm="namebeta" |
| The token is malformed, unknown, expired or revoked | invalid_token | Bearer realm="namebeta", error="invalid_token" |
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="namebeta", error="invalid_token"
Content-Type: application/json; charset=utf-8
{
"error": {
"type": "authentication_error",
"code": "invalid_token",
"message": "The API token is invalid, revoked or expired.",
"doc_url": "https://docs.namebeta.com/api/errors#invalid_token",
"request_id": "req_8f14e45fceea167a5a36dedd4bea2543"
}
}
A 401 is not counted against your quota. Retrying it with the same token fails again; fix the token instead.