Docs
Open the app

Errors & Status Codes

The API uses standard HTTP status codes. A 2xx means success. Anything else carries a JSON body describing what went wrong.

Error shape

Failed requests return an error object, never a bare string:

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Unauthorized",
    "docs": "https://naut.so/docs/api"
  }
}

Branch on code, not on message. The code is a stable identifier; the message is prose we may reword. docs is on every error.

A 401, 402, 403, 404 and 429 also carry a hint: 1 sentence with the next step, naming the API host that answered.

Some errors carry extra fields:

  • 400 VALIDATION_ERROR adds details, a list of { field, message } naming each input that failed.
  • 401 adds baseUrl and hint, naming the host to call. If you are reading this because a call returned HTML instead of JSON, that is the fix: send requests to https://api.naut.so, not to the website.
  • 402 adds required (credits this call needed), balance (what you hold), and resolve.upgradeUrl / resolve.creditsUrl, so an agent can react without parsing the sentence.
  • 404 on an unknown path adds baseUrl beside the hint.
  • 410 adds baseUrl, the host to send the request to instead.
  • 429 TRIAL_DAILY_LIMIT adds nextAt (when the next share opens), allowedToday and nextAllowed (trial credits open now and after nextAt).

Read the status code first to decide how to react, then read code for detail.

Status codes

Status Code Meaning What to do
200 Success Read the data in the response body.
400 BAD_REQUEST, VALIDATION_ERROR Bad request Your input failed validation. Fix the request and resend.
401 UNAUTHORIZED Unauthorized The key is missing, malformed, or revoked, or its account is deactivated. Check the Authorization header and that the key is active.
402 PAYMENT_REQUIRED Payment required A paid plan is out of credits. Add credits by starting or upgrading a plan (or earn them through referrals), then retry. On the free plan you get a sample instead of a 402. See Pricing & Quotas.
403 FORBIDDEN, UNPAID_PLAN Forbidden FORBIDDEN: the key lacks the scope (for example read:contacts). UNPAID_PLAN: a private reveal on a trial or other unpaid plan, or after a declined first charge. Start the plan, or update the card, in Settings > Plan & billing. Basic calls keep working. See Access & Rate Limits.
404 NOT_FOUND Not found The resource does not exist, is not visible to your account, or the path is not an endpoint. An unrecognised path names itself in message and points you at /v1/me, which lists every endpoint that does exist.
409 CONFLICT Conflict The request clashes with current state, such as creating 1 key too many.
410 HOST_RETIRED Gone You called the retired API address. Send the same request to https://api.naut.so with the same key. See Moving to api.naut.so.
429 RATE_LIMITED, TRIAL_DAILY_LIMIT Too many requests RATE_LIMITED: back off and retry; the per-minute allowance clears within a minute, the reveal ceiling within the hour. TRIAL_DAILY_LIMIT: today's trial share is used; retry after nextAt, or start your plan. See Access & Rate Limits.
5xx INTERNAL and others Server error Something failed on our side. Retry after a short wait; if it persists, get in touch.

Handling errors well

  • Check the status before the body. It tells you whether to read data or an error.
  • Treat 401 as a key problem. Confirm the header reads Authorization: Bearer ck_live_… and the key is active on your API page.
  • Treat 402 as a credits problem. You ran out of credits. Subscribe or upgrade, then retry. Automated agents should prompt their owner to start or upgrade a plan. See For AI Agents.
  • Retry RATE_LIMITED and 5xx with backoff; wait for nextAt on TRIAL_DAILY_LIMIT. Wait and retry rather than resending immediately.
  • Do not retry 400 unchanged. A bad request will fail the same way until you fix the input.