Skip to main content
When a request fails, Membership.io returns an errors array.

Request id

Every handled error includes a request id in meta.request_id and usually in the X-Request-ID response header. Include this id when reporting a bug or support issue.

Validation errors

Validation errors use status 422. When available, source.pointer points to the invalid request body field.

Common statuses

Do not branch on errors[].status from the mio CLI. The CLI writes the same envelope shape to stderr, but through v0.12.1 it reconstructs status from its own exit code, which is coarser than the API’s status — so 403 is reported as "401", 409 and 422 both as "400", and 503 as "500". Branch on meta.exit_code instead (2 usage, 3 auth, 4 not found, 6 rate limited, 7 server), or call the API directly when you need to tell 403 from 401 or 409 from 422. Reading the status verbatim is fixed on main and will land in the next release; the exit-code contract is unchanged either way.

Rate limit errors

When a per-endpoint rate limit is exceeded the response carries code rate_limited and a Retry-After header with the number of seconds until the window resets.
See Rate limits for the full list of limited endpoints and their thresholds.