Guide

Responses & errors

Every Identra response — success or failure — is the same JSON envelope. Parse it once and the whole API reads consistently: check success, then read data or error.

2xx Success

JSON
{
  "success": true,
  "data": { "id": "018f3c4a-7b2e-7c1d-9e0a-1f2b3c4d5e6f", "primary_email": "user@example.com" },
  "error": null,
  "meta": { "timestamp": "2026-01-15T09:30:00Z" }
}

4xx · 5xx Error

JSON
{
  "success": false,
  "data": null,
  "error": { "code": "not_found", "message": "No user matches that id." },
  "meta": { "timestamp": "2026-01-15T09:30:00Z" }
}

Status codes

The HTTP status carries the category; the error.code is the stable, machine-readable handle you branch on. Messages are human-readable and client-safe — they never contain internals or secrets.

Statuserror.codeMeaning
200 · 201Success. The payload is in data; error is null.
400bad_requestMalformed request — unparseable body or bad parameter.
401unauthorizedMissing, invalid, or expired credential.
403forbiddenAuthenticated, but not allowed (default-deny).
404not_foundNo such resource in this application.
409conflictState conflict, e.g. an email already in use.
422validationValidation failed; message says which field.
429rate_limitedToo many requests — back off and retry.
500internalUnexpected server error. Never leaks internals.

The envelope, from the contract

This is the ErrorEnvelope type exactly as the API emits it — the success variant swaps a populated data for the null error.

  • data any
  • error ErrorBody required
  • meta Meta required
  • success boolean required