Skip to main content

Tickets

Quick Overview

List, view, and manage tickets including messages, labels, queue assignment, transfer, and status changes.

List Tickets​

GET /v1/tickets

List all tickets with pagination and search.

Query Parameters​

ParameterTypeDefaultDescription
searchParamstring-Search term.
pageNumberinteger1Page number.
pageSizeinteger-Number of results per page.
sortBystring-Sort order: asc or desc.

Response​

{
"tickets": [
{
"id": "ticket_abc123",
"status": "OPEN",
"contactId": "contact_xyz789",
"userId": null,
"queueId": null
}
],
"count": 1,
"hasMore": false
}

Get a Ticket​

GET /v1/tickets/{ticketId}

Get details for a single ticket.

Path Parameters​

ParameterTypeRequiredDescription
ticketIdstringYesTicket ID.

Response​

{
"ticket": {
"id": "ticket_abc123",
"status": "OPEN",
"contact": {},
"user": null,
"queue": null,
"labels": []
}
}

Errors​

StatusError CodeDescription
404ERR_TICKET_NOT_FOUNDTicket not found.

List Ticket Messages​

GET /v1/tickets/{ticketId}/messages

List messages for a ticket with pagination.

Path Parameters​

ParameterTypeRequiredDescription
ticketIdstringYesTicket ID.

Query Parameters​

ParameterTypeDefaultDescription
pageNumberinteger1Page number.
pageSizeinteger-Number of results per page.

Response​

{
"messages": [
{
"id": "msg_abc123",
"body": "Hello",
"fromMe": false,
"channel": "WHATSAPP"
}
],
"count": 1,
"hasMore": false
}

Errors​

StatusError CodeDescription
404ERR_TICKET_NOT_FOUNDTicket not found.

Add Labels to a Ticket​

POST /v1/tickets/{ticketId}/labels

Add one or more labels to a ticket.

Path Parameters​

ParameterTypeRequiredDescription
ticketIdstringYesTicket ID.

Request Body​

{
"labelSlugs": ["vip", "urgent"]
}
FieldTypeRequiredDescription
labelSlugsarrayYesLabel slugs to add.

Response​

{
"ticket": {
"id": "ticket_abc123",
"labels": [
{ "id": "label_abc123", "slug": "vip" },
{ "id": "label_def456", "slug": "urgent" }
]
}
}

Errors​

StatusError CodeDescription
400ERR_LABEL_SLUGS_REQUIREDLabel slugs required.
404ERR_TICKET_NOT_FOUND or ERR_LABEL_NOT_FOUNDTicket or label not found.

Remove Labels from a Ticket​

DELETE /v1/tickets/{ticketId}/labels

Remove one or more labels from a ticket.

Path Parameters​

ParameterTypeRequiredDescription
ticketIdstringYesTicket ID.

Request Body​

{
"labelSlugs": ["vip"]
}
FieldTypeRequiredDescription
labelSlugsarrayYesLabel slugs to remove.

Response​

{
"ticket": {
"id": "ticket_abc123",
"labels": []
}
}

Errors​

StatusError CodeDescription
400ERR_LABEL_SLUGS_REQUIREDLabel slugs required.
404ERR_TICKET_NOT_FOUNDTicket not found.

Assign Ticket to a Queue​

PUT /v1/tickets/{ticketId}/queue

Assign or unassign a ticket to a queue.

Path Parameters​

ParameterTypeRequiredDescription
ticketIdstringYesTicket ID.

Request Body​

{
"queueId": "queue_abc123"
}

To unassign, set queueId to null:

{
"queueId": null
}
FieldTypeRequiredDescription
queueIdstring | nullYesQueue ID to assign, or null to unassign.

Response​

{
"ticket": {
"id": "ticket_abc123",
"queueId": "queue_abc123",
"queue": { "id": "queue_abc123", "name": "Sales" }
}
}

Errors​

StatusError CodeDescription
404ERR_TICKET_NOT_FOUND or ERR_QUEUE_NOT_FOUNDTicket or queue not found.

Transfer a Ticket​

PUT /v1/tickets/{ticketId}/transfer

Transfer a ticket to a user and optionally assign to a queue.

Path Parameters​

ParameterTypeRequiredDescription
ticketIdstringYesTicket ID.

Request Body​

{
"userId": "user_abc123",
"queueId": "queue_def456"
}
FieldTypeRequiredDescription
userIdstringYesUser ID to transfer to.
queueIdstringYesQueue ID to assign.

Response​

{
"ticket": {
"id": "ticket_abc123",
"userId": "user_abc123",
"queueId": "queue_def456",
"user": { "id": "user_abc123", "name": "Agent Name" },
"queue": { "id": "queue_def456", "name": "Sales" }
}
}

Errors​

StatusError CodeDescription
404ERR_TICKET_NOT_FOUND, ERR_USER_NOT_FOUND_IN_WORKSPACE, or ERR_QUEUE_NOT_FOUNDTicket, user, or queue not found.

Update Ticket Status​

PUT /v1/tickets/{ticketId}/status

Update the status of a ticket.

Path Parameters​

ParameterTypeRequiredDescription
ticketIdstringYesTicket ID.

Request Body​

{
"status": "IN_PROGRESS"
}

When setting status to IN_PROGRESS and no assignee is set, you must provide userId:

{
"status": "IN_PROGRESS",
"userId": "user_abc123"
}
FieldTypeRequiredDescription
statusstringYesNew ticket status.
userIdstringNoUser ID to assign when setting status to IN_PROGRESS and no assignee exists.

Response​

{
"ticket": {
"id": "ticket_abc123",
"status": "IN_PROGRESS",
"userId": "user_abc123"
}
}

Errors​

StatusError CodeDescription
400ERR_USER_ID_REQUIREDuserId required when starting progress without an assignee.
404ERR_TICKET_NOT_FOUND or ERR_USER_NOT_FOUND_IN_WORKSPACETicket or user not found.