Skip to content

Tickets

Show ticket

Returns one ticket.

  • Required scope: tickets:read
  • Endpoint: POST /api/query
FieldTypeRequiredDescription
idstring (uuid)yesTicket ID

Example request

Terminal window
curl -X POST https://ticketing.example.com/api/query \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "ticketing:query:ticket:detail",
"payload": {
"id": "00000000-0000-4000-8000-000000000001"
}
}'

Example response

Status: 200

{
"data": {
"id": "00000000-0000-4000-8000-000000000001",
"tenantId": "00000000-0000-4000-8000-000000000002",
"version": 1,
"insertedAt": "2026-01-15T09:30:00.000Z",
"modifiedAt": null,
"insertedById": "00000000-0000-4000-8000-000000000003",
"modifiedById": null,
"title": "Printer is on fire",
"status": "open",
"priority": "high"
}
}

List tickets

Lists tickets, newest first.

  • Required scope: tickets:read
  • Endpoint: POST /api/query
FieldTypeRequiredDescription
cursorstringnoPosition from nextCursor of the previous page.
limitintegernoRows per page, 50 by default, at most 200.
searchstringnoFull-text search across the searchable fields.
sortstringnoField to sort by.
sortDirection“asc” | “desc”noasc or desc.
offsetintegernoNumber of rows to skip. Prefer cursor for paging.
totalCountbooleannoSet true to also get total, the number of matching rows.
includeDeletedbooleannoSet true to include deleted rows. Only for entities with soft delete.
onlyDeletedbooleannoSet true to return only deleted rows. Only for entities with soft delete, not together with includeDeleted.
filterobjectnoOne field filter with field, op and value. op is one of eq, ne, lt, gt, lte, gte, in.
filter.fieldstringyes
filter.op“eq” | “ne” | “lt” | “gt” | “lte” | “gte” | “in”yes
filter.valueanyyes
filtersarray of objectnoSeveral field filters, each with field, op and value. op is one of eq, ne, lt, gt, lte, gte, in.
namedFilterstringnoName of a predefined filter of the entity, for example a work queue.
aggregateobjectnoReturns aggregated values instead of rows.
aggregate.groupBystringno
aggregate.measuresarray of objectno

Example request

Terminal window
curl -X POST https://ticketing.example.com/api/query \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "ticketing:query:ticket:list",
"payload": {}
}'

Example response

Status: 200

{
"data": {
"rows": [
{
"id": "00000000-0000-4000-8000-000000000001",
"tenantId": "00000000-0000-4000-8000-000000000002",
"version": 1,
"insertedAt": "2026-01-15T09:30:00.000Z",
"modifiedAt": null,
"insertedById": "00000000-0000-4000-8000-000000000003",
"modifiedById": null,
"title": "Printer is on fire",
"status": "open",
"priority": "high"
}
],
"nextCursor": null
}
}

Close ticket

Closes a ticket and records how it was resolved.

  • Required scope: tickets:write
  • Endpoint: POST /api/write
FieldTypeRequiredDescription
idstring (uuid)yesTicket
resolutionstringyesResolution

Example request

Terminal window
curl -X POST https://ticketing.example.com/api/write \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "ticketing:write:ticket:close",
"payload": {
"id": "00000000-0000-4000-8000-000000000001",
"resolution": "Replaced the cartridge"
}
}'

Example response

Status: 200

{
"isSuccess": true,
"data": {
"id": "00000000-0000-4000-8000-000000000001"
}
}

Create ticket

Opens a new ticket.

  • Required scope: tickets:write
  • Endpoint: POST /api/write
FieldTypeRequiredDescription
titlestringyesTitle
status“open” | “closed”noStatus
priority“low” | “normal” | “high”noPriority

Example request

Terminal window
curl -X POST https://ticketing.example.com/api/write \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "ticketing:write:ticket:create",
"payload": {
"title": "Printer is on fire",
"priority": "high"
}
}'

Example response

Status: 200

{
"isSuccess": true,
"data": {
"kind": "save",
"id": "00000000-0000-4000-8000-000000000001",
"data": {
"id": "00000000-0000-4000-8000-000000000001",
"tenantId": "00000000-0000-4000-8000-000000000002",
"version": 1,
"insertedAt": "2026-01-15T09:30:00.000Z",
"modifiedAt": null,
"insertedById": "00000000-0000-4000-8000-000000000003",
"modifiedById": null,
"title": "Printer is on fire",
"status": "open",
"priority": "high"
},
"changes": {
"title": "Printer is on fire",
"status": "open",
"priority": "high"
},
"previous": {},
"isNew": true,
"entityName": "ticket"
}
}

Update ticket

Changes the title or the priority of a ticket.

  • Required scope: tickets:write
  • Endpoint: POST /api/write
FieldTypeRequiredDescription
idstring (uuid)yesTicket ID
versionnumberyes
changesobjectyes
changes.titlestringnoTitle
changes.status“open” | “closed”noStatus
changes.priority“low” | “normal” | “high”noPriority

Example request

Terminal window
curl -X POST https://ticketing.example.com/api/write \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "ticketing:write:ticket:update",
"payload": {
"id": "00000000-0000-4000-8000-000000000001",
"version": 1,
"changes": {
"priority": "normal"
}
}
}'

Example response

Status: 200

{
"isSuccess": true,
"data": {
"kind": "save",
"id": "00000000-0000-4000-8000-000000000001",
"data": {
"id": "00000000-0000-4000-8000-000000000001",
"tenantId": "00000000-0000-4000-8000-000000000002",
"version": 2,
"insertedAt": "2026-01-15T09:30:00.000Z",
"modifiedAt": "2026-01-15T09:30:00.000Z",
"insertedById": "00000000-0000-4000-8000-000000000003",
"modifiedById": "00000000-0000-4000-8000-000000000003",
"title": "Printer is on fire",
"status": "open",
"priority": "normal"
},
"changes": {
"priority": "normal"
},
"previous": {
"id": "00000000-0000-4000-8000-000000000001",
"tenantId": "00000000-0000-4000-8000-000000000002",
"version": 1,
"insertedAt": "2026-01-15T09:30:00.000Z",
"modifiedAt": null,
"insertedById": "00000000-0000-4000-8000-000000000003",
"modifiedById": null,
"title": "Printer is on fire",
"status": "open",
"priority": "high"
},
"isNew": false,
"entityName": "ticket"
}
}