Skip to main content
The API uses conventional HTTP status codes. Anything in the 2xx range succeeded; 4xx means the request needs fixing on your side; 5xx means something failed on Retainful’s side.

Status codes

Validation failures return 400, not 422. There is no 403 — an API key either authenticates or it doesn’t.

Error response shape

Every error carries the same five fields:
401 example
Errors you can act on programmatically add three more — code, title, and detail. message and detail carry the same text:
400 example
Branch on code when it’s present. Note that 401, 404, and 429 responses have no code field — check for its presence before reading it.

Error codes

message names only the first field that failed validation. If several fields are wrong, you’ll fix them one round-trip at a time — validate on your side before sending.

Retry guidance

  • Retry: 429 (after the Retry-After-* window) and 5xx (with exponential backoff and a retry cap).
  • Don’t retry unchanged: 400, 401, 404 — the same request fails the same way.
  • Retries are safe by design. Contact creation upserts, so repeating it is harmless. Events are deduplicated on uniqueIdentifier — a retried event updates the stored record instead of triggering the automation twice. Reuse the same identifier when retrying, and only change it for a genuinely new occurrence.
Log the full response body on failures, not just the status code — message almost always names the exact field that failed.