Skip to main content
Drin uses conventional HTTP status codes and returns a consistent JSON envelope on any non-2xx response. Switch on error.type — it’s stable and machine-readable; never parse the message.

The envelope

Every non-2xx response carries the same shape:
Error response

Error types

Each type maps to a status range. The status tells you how to react; the type tells you why.

Request IDs

Every response echoes a request id in the X-Request-Id header. Include it when you contact support — it lets us find the exact request in our logs.
Retrying safely. The SDK auto-retries 429 and 5xx with exponential backoff and full jitter. A POST is only retried when you pass an Idempotency-Key, so a send is never duplicated. If you build your own client, do the same — never blindly retry a bare POST.
Working in TypeScript? Each type is also a typed error subclass (DrinValidationError, DrinRateLimitError, DrinSuppressedError, …), so you can branch with instanceof. See the Errors guide and the TypeScript SDK.