The most common integration: pull tickets into your own system. Going the other way — creating, assigning and closing them — is covered in Create a ticket.

List the tickets of a project

Page through with page/size until you’ve read hits results. database is required; without it the request is a 400. A user without a role on the project gets an empty page rather than a 403. Results come from the search index: besides the ticket fields they carry couchDbId, database and an attachments array whose entries have a fetchable name. Sort with sortby and sortOrder together (e.g. sortby=LASTMODIFIEDDATE&sortOrder=desc); with only one of them the order is unspecified. state.state is one of created, started or completed. Finished tickets also occur as Completed in older data — see Detecting completion.

Useful filters

Counts without fetching everything

Use aggregate with an index field name to get facet counts in the same call:
Handy for dashboards without paging through every ticket. The counts respect the other filters in the request.

Single ticket

This returns the stored document. Attachments appear there by file name only; list results carry the resolved attachments[]. You need to be able to see the ticket: a 403 means your role does not cover it, a 404 that it does not exist.

Custom field values

On an Expert plan a project can have up to three custom fields. The project document defines them in customFields (GET /projects/{database}/{id}); the values a user filled in sit on each ticket, in the ticket’s own customFields array. Both the list results and the single ticket carry it:
Each entry repeats the field’s definition (id, label, type, and the choices in richOptions) and adds value. What value holds depends on the type: For a choice field, look the ids up in the same entry’s richOptions to get the text (also HTML). A field that was never filled in has no value (or null), and a ticket on which no field was filled in may have no customFields at all, or null. Match fields on id, which is the same id as in the project’s customFields; the label can be renamed. To get only tickets with a value in a field, search on the field’s label with POST /tickets/search and ask for the values in includeFields:
This filter checks that a value is filled in, not what it is: filter on the value yourself. With several labels a ticket needs a value in all of them; add "customFilterType": "OR" for any of them. The filter exists only on the POST search, not on GET /tickets. Custom field values are read-only through the API: creating or updating a ticket ignores customFields.
For incremental sync (only what changed since the last run), see Polling for changes.