Skip to main content
Every error response carries three things: a machine-readable code, the HTTP status, and a requestId. The requestId comes back in the x-request-id response header — include it in any support report, it’s how we find your exact request in the logs.

Status codes

The error taxonomy is closed: each code maps to exactly one HTTP status.

Typed errors in the SDKs

The SDKs resolve every failure into a typed error so you can branch on instanceof instead of string-matching a code. All of them extend WebhookError, which carries code, status, requestId, and — for a throttle — retryAfterMs.
Each status maps to its own subclass of WebhookAPIError: Three more errors never come from a server status, so catch them separately:
  • WebhookConfigError — the client was constructed with bad options (e.g. a plaintext base URL). Thrown eagerly, before any request.
  • WebhookConnectionError — the request never reached the server (DNS, TLS, connection, or a client-side timeout).
  • WebhookUnexpectedResponseError — a response the SDK can’t interpret (an unmodelled status, or a body that failed validation).
Catch the base WebhookError to handle any SDK failure uniformly; catch a subclass to handle one precisely.