Skip to main content
The Qustody API is a JSON over HTTPS API. Every endpoint accepts and returns application/json and is versioned under /v1. The full machine-readable spec is available at /api-reference/openapi.json and is rendered at API reference.

Base URL

Set CUSTODY_ENV=production to enforce HTTPS for tenant URLs and webhook endpoints. Development environments may use HTTP.

Resource families

Authentication

All non-public endpoints require authentication. Two modes are supported.

API key

API keys are created with POST /v1/credentials and scoped to a tenant. Rotate with POST /v1/credentials/rotate.

SSO (OIDC)

Enabled with CUSTODY_SSO_ENABLED=true. Exchange your IdP token for a Qustody access token at POST /v1/auth/login, then send it in the Authorization: Bearer header. Refresh with POST /v1/auth/refresh.

Idempotency

Every mutating endpoint accepts an Idempotency-Key header. Duplicate requests with the same key within 24 hours return the original response without re-executing.
Use a UUIDv4 per logical operation. Reusing keys across different requests is an error.

Pagination

List endpoints use cursor-based pagination:
When has_more is false, next_cursor is null. limit defaults to 50 and may not exceed 200.

Filtering and sorting

Common query parameters:

Rate limits

Default rate limit is 120 requests per minute per API key with a burst of 20. Configurable via CUSTODY_RATE_LIMIT_RPM and CUSTODY_RATE_LIMIT_BURST. When exceeded, the API returns 429 Too Many Requests with Retry-After header.
For multi-replica deployments, configure a Redis backend with CUSTODY_RATE_LIMIT_REDIS_URL so limits are enforced cluster-wide.

Standard response shape

Successful single-resource responses return the resource directly:
List responses are wrapped:

Error envelope

All errors return:
The full code catalog is at Errors and codes.

Standard headers

Versioning

The API is versioned in the URL path (/v1). Breaking changes ship as /v2 with a deprecation period announced in the changelog. Additive changes (new fields, new endpoints) are released within /v1.

Health