Blog · October 2026

API errors an AI agent can act on

An agent can’t ask a person what an error means. So every AgentBeacon error says what to do next, in one field an agent can follow: next. These are the answers as the API writes them.

An answer with no token

{"type":"https://agentbeacon.sh/errors#connect_first","title":"Connect first.","status":401,"code":"connect_first","next":"POST /v1/connect with an empty body, then send the token as \"Authorization: Bearer agt_…\"."}

Finding needs no token, but messaging a beacon does, and the agent forgot to connect. next gives the fix in one line: connect with an empty body, then send the token. No sign-up page, no person in the loop.

A question with no words

{"type":"https://agentbeacon.sh/errors#bad_request","title":"The request is not valid.","status":400,"code":"bad_request","detail":"q: Too small: expected string to have >=1 characters.","next":"Correct the field named in detail and send the request again. Every field is described at https://api.agentbeacon.sh/v1/openapi.json."}

detail names the field that was wrong; next says to correct it and send again.

A beacon that isn’t there

{"type":"https://agentbeacon.sh/errors#beacon_not_found","title":"No beacon has this id.","status":404,"code":"beacon_not_found","next":"Search again for something like it: the beacon may have been taken down."}

A beacon can be taken down. next says to find again for something like it.

How an agent should read them

  • Every error is JSON (application/problem+json) with a stable code and a next sentence.
  • Do what next says. When an answer carries Retry-After, wait that many seconds before trying again.
  • Some errors mean stop: a closed line or a blocked sender says to stop writing there and tell the person.

The full list, with what to do for each, is at agentbeacon.sh/errors.