API Conventions
Every resource in the API Reference follows the same conventions for listing, filtering, pagination, and lifecycle actions. This page describes the shared behavior once so each resource page can focus on what is specific to it.
Base URL and Authentication
Use the base URL for your assigned region (see Environments & Regions), and send a Bearer token on every request (see Authentication):
Authorization: Bearer {access_token}
Content-Type: application/json
All resource paths are under the /v1 prefix, for example GET /v1/clients.
Listing and Pagination
List endpoints (GET /v1/{resource}) return a JSON array of records and accept the same pagination and shaping parameters:
| Parameter | Default | Description |
|---|---|---|
limit | 10 | Records per page. Values above 100 are capped at 100. |
skip | 0 | Records to skip, for paging. |
sort | created_at | Field to sort by. A value that is not a field of the resource falls back to created_at. |
sortDirection | desc | asc or desc. Any other value falls back to desc. |
fields | all fields | Comma-separated list of fields to return (a sparse fieldset), for example fields=uuid,created_at. Unknown field names are ignored. |
Page through a list by increasing skip in multiples of limit: ?limit=50&skip=0, then ?limit=50&skip=50, and so on. See Pagination for a worked example.
Counting
Most resources expose a count endpoint that applies the same filters as the list endpoint but returns only a number, which is efficient for pagination math and dashboards:
GET /v1/{resource}/total
Response (200): a bare number, for example 42.
Filtering
Each resource page lists its own filter parameters. Filters follow consistent rules:
- Exact match: most filters match a field exactly, for example
?status=outstanding. - Partial match: text search filters match substrings, for example a client
?name=search. - Date ranges: paired
_fromand_toparameters bound a date field, for example?due_from=2024-03-01&due_to=2024-03-31on payments. The bounds are inclusive. - Boolean filters: a boolean filter activates only when set to a truthy value:
1,true,yes, ory. Setting it to0does not filter; use the parameter's opposite where one is provided (for exampleoptout=1rather thanoptin=0on contacts).
Full-text search behavior is resource-specific: the parameter searches whichever field is most useful for that resource (for example, a payment's payment_reference or a contact's value). See each resource page for what its search matches.
Lifecycle: Archive, Delete, and Restore
Records are not hard-deleted through the API. They move between three states:
| Action | Effect | Reversible |
|---|---|---|
Delete (DELETE /v1/{resource}/{uuid}) | Soft delete: sets deleted_at. Excluded from default lists. | Yes, with restore |
Archive (PUT /v1/{resource}/{uuid}/archive) | Sets archived_at. Excluded from default lists. Suits records that are resolved or inactive. | Yes, with restore |
Restore (PUT /v1/{resource}/{uuid}/restore) | Clears archived_at and deleted_at, returning the record to active lists. | N/A |
To include the hidden records in a list, use these filters, which are common across resources:
archived=1returns only archived records.trashed=1returns only deleted records.
By default (without these filters), both archived and deleted records are excluded. Deleting or archiving a record generally also cancels any scheduled, unsent messages tied to it; the resource pages note where this applies.
Sync and Process
Some resources expose a sync or process action that queues background work rather than changing the record directly, most often to rebuild the scheduled reminder messages for a record:
POST /v1/{resource}/{uuid}/sync
POST /v1/{resource}/{uuid}/process
Response (202): the work is accepted and runs asynchronously, so the effect (for example, rescheduled messages) appears shortly after the response, not within it.
References and UUIDs
Records are identified by a uuid, but many endpoints also accept your own reference in place of the UUID:
- Creating a linked record accepts either the related record's UUID or its reference, for example
client(a UUID) orclient_reference(your identifier) when creating a payment. - Some
GETandPATCHendpoints accept a reference or a natural value in the path, for example a client byclient_reference, or a contact by phone number or email address. The resource page notes where this is supported.
Setting your own reference on create (for example client_reference or payment_reference) makes later lookups and syncing with an external system straightforward.
Timestamps and Dates
- Timestamps such as
created_atandupdated_atare UTC, formattedYYYY-MM-DD HH:MM:SS. - Calendar dates such as a payment's
due_ator an event'sdateareYYYY-MM-DDand are interpreted in the agency's timezone.
Provenance Fields
Most records carry two provenance fields:
created_by: the email or UUID of the user or API client that created the record.upload: the UUID of the file import associated with the record, when it is linked to one. Filter by it (?upload={uuid}) to review a batch imported over SFTP.
Caching
Single-record GET responses are cached briefly. After you change a record through the API, the cache for that record is refreshed automatically, so a subsequent read reflects your change. Changes made outside the API can take a short time to appear.
Related Documentation
- API Reference: all resources on one page
- Pagination: paging through large result sets
- Error Handling: status codes and error responses
- Best Practices: idempotency, retries, and batching