Skip to main content
When a request to the Orwel REST API fails, the response tells you what happened in two ways: the HTTP status says which kind of problem it is, and the JSON body carries a stable error code you can branch on, plus a message written for people.

Response format

Successful responses never contain error; they wrap their result in data.

Error codes

Rate limits

Limits are counted per API key in one minute windows: 1,000 requests per minute for each orwel_sk_ key. Every response carries the current state in headers: A batch job that reads X-RateLimit-Remaining and slows down near zero never hits a 429. More in Rate Limiting.

What to retry

Reads (GET) are always safe to retry. For writes, check before retrying a POST that may have succeeded: a timeout does not mean the lead was not created. Look it up with List Leads first, or use a value you control (such as the email) to detect the duplicate.

Handling errors in code

The helper returns data on success, waits and retries on 429 and 5xx, and throws with the error code for everything else, so a missing scope or a wrong id shows up immediately in your logs instead of being retried.

Errors outside the REST API

  • Browser SDK: orwel.conversion() does not throw on delivery problems; it resolves { success: false, reason }. See Conversions. Ingest problems sent with the development key are explained in Dev mode.
  • MCP server: authentication errors use the same codes (401 unauthorized, 403 insufficient_scope, 403 plan_not_allowed). Errors inside a tool come back as the tool result so the agent can adjust. See MCP for agents.