API reference

Error code: server_error

server_error returns HTTP 500 with type: api_error. An unexpected server-side error occurred. Branch on this code — it is stable — and apply the fix below.

2 min read

500HTTP status
server_errorerror.code
RetryHandling

What triggers it

An unexpected server-side error occurred. A transient platform fault unrelated to your request.

Example response

{
  "error": {
    "type": "api_error",
    "code": "server_error",
    "message": "An unexpected server-side error occurred."
  }
}

How to fix it

Retry with backoff; if it persists, contact support quoting the request id.

This class is transient — see Retrying failed requests.

In practice

In a well-built client, server_error is handled by branching on error.code rather than on the human error.message, which may be reworded over time. The HTTP status (500) gives the broad api_error class; the code gives the specifics; and, on field errors, error.param pinpoints the input to fix.

This code is transient, so it belongs in the retry path: back off with jitter, honour Retry-After on a 429, and pair writes with an idempotency key so a retry after a timeout never double-applies. See Retrying failed requests and Build a resilient API client.

Frequently asked questions

Is server_error safe to retry?

Yes, with exponential backoff — it is transient.

Will this code ever change?

No. Error codes are stable contract. The human message may be reworded, but the code you branch on will not change.

Do I branch on the code or the HTTP status?

Both — the status for the retry-or-not decision, the code for the specific behaviour. See the error envelope.

Funding for UK limited companies

Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.