Tickets
Read the tickets of a contact or conversation and update or move them from your own system.
A ticket records a request that needs follow-up, such as a complaint, a quote or a support case. Tickets move through the stages you configured in Tickets, from open to closed.
Use the API to keep another system in sync with Tolky:
- Read tickets of a contact, of a conversation or a single ticket, with its history of events.
- Update a ticket: subject, description, definition of done, importance, assigned operator, open or closed.
- Move a ticket to another stage of your board.
A ticket cannot be closed while its conversations are still open. The response tells you so. Send the request again with forceCloseConversations: true to close those conversations together with the ticket.
ReferenceTechnical details
Get tickets
POST /api/externalAPIs/public/tickets/getTickets with a host token (Authorization: Bearer $TOLKY_TOKEN).
Send one search key. When you send more than one, the first in this order wins: ticketId, leadId, conversationId.
| Name | Type | Required | Description |
|---|---|---|---|
ticketId | string | One of the three | A single ticket. |
leadId | string | One of the three | All tickets of a contact. |
conversationId | string | One of the three | All tickets of a conversation. |
avatarId | string or string[] | No | Only tickets of these avatars. |
includeEvents | boolean | No | Include the ticket history. Default true. |
includeClosed | boolean | No | Include closed tickets. Default true. |
includeDeleted | boolean | No | Include deleted tickets. Default false. |
curl -X POST "https://api.tolky.to/api/externalAPIs/public/tickets/getTickets" \
-H "Authorization: Bearer $TOLKY_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "leadId": "3f0c2a8e-...", "includeClosed": false }'{
"code": 200,
"message": "OK",
"data": {
"success": true,
"count": 1,
"data": [
{
"id": "3f0c2a8e-...",
"protocol": "...",
"subject": "Refund request",
"description": "Customer asked for a refund of order #4821.",
"definitionOfDone": "Refund confirmed to the customer.",
"status": { "name": "In progress", "level": 2, "color": "#F5A623", "isClosed": false },
"importance": 2,
"closed": false,
"assignedUser": { "id": "3f0c2a8e-...", "name": "Ana" },
"contact": { "name": "Maria", "email": "maria@example.com", "phone": "5511999999999" },
"events": [],
"createdAt": "2026-07-01T12:00:00.000Z"
}
],
"searchCriteria": { "ticketId": null, "leadId": "3f0c2a8e-...", "conversationId": null },
"message": "Successfully retrieved 1 ticket(s)"
}
}| Field | Description |
|---|---|
data[].protocol | Ticket protocol shown to customers and operators. |
data[].status | Current stage: name, level, color and whether it is a closing stage. |
data[].importance | Importance level. importanceColor comes with it. |
data[].assignedUser | Operator responsible, or null. |
data[].contact | Contact name, e-mail and phone. |
data[].leadId, conversationId, avatarId | Links to the contact, the conversation and the avatar. |
data[].events | History, newest first: type, createdAt, description, summary, pendingActions. |
data[].ticketLevelId | ID of the current stage. |
Tickets are returned newest first.
Update or move a ticket
POST /api/externalAPIs/public/tickets/updateTicket. Send ticketId and at least one change. You can update fields and move the ticket in the same call.
| Name | Type | Required | Description |
|---|---|---|---|
ticketId | string | Yes | Ticket to change. |
subject | string | No | New subject. |
description | string | No | New description. |
definitionOfDone | string | No | What must happen for the ticket to be done. |
importance | object | No | { "importance_level": 2 }, using a level configured in your account. |
assignedUser | object or null | No | { "hostPeopleId": "..." } to assign an operator, null to remove. The operator must belong to the ticket's department. |
closed | boolean | No | Close or reopen the ticket. |
forceCloseConversations | boolean | No | When closing, also close the ticket's open conversations. |
newLevel | string or number | No | Stage to move to: the stage ID, its name or its level number. |
reason | string | No | Reason recorded with the move. |
curl -X POST "https://api.tolky.to/api/externalAPIs/public/tickets/updateTicket" \
-H "Authorization: Bearer $TOLKY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ticketId": "3f0c2a8e-...",
"description": "Refund approved by finance.",
"newLevel": "Resolved",
"reason": "Refund paid"
}'{
"code": 200,
"message": "OK",
"data": {
"success": true,
"message": "Ticket updated and moved successfully",
"data": {
"ticketId": "3f0c2a8e-...",
"operationsPerformed": { "updated": true, "moved": true },
"updateResult": { "id": "3f0c2a8e-...", "description": "Refund approved by finance." },
"moveResult": { "code": 200, "success": true, "message": "Ticket movido com sucesso" },
"finalTicketState": { "id": "3f0c2a8e-...", "status_name": "Resolved", "closed": true }
}
}
}| Field | Description |
|---|---|
data.operationsPerformed | Which operations ran: updated and moved. |
data.updateResult | The updated ticket. When the update was not applied, it comes with success: false and a message. When closing with open conversations, it also returns needCloseConversations: true and openConversations. |
data.moveResult | Result of the stage move: success and message. |
data.finalTicketState | The ticket after the changes. |
Errors
Both endpoints answer errors with HTTP 500 and the reason in message, including validation errors such as a missing ticketId, no search key, no change sent, or an operator outside the ticket's department.