Endpoints
Get a ticket
Read one ticket by its number, with its status, assignee, description and first comments
The get_ticket_detail tool returns one ticket of the agent, found by its number such as TKT-73. It includes the ticket's status, priority, assignee and timestamps, the customer's description, and its comments ten at a time. It only reads: it never changes the ticket or replies to the customer.
POST
https://api.qwryai.com/public/v1/tools/get_ticket_detailAuthentication
Send your API key as Authorization: Bearer YOUR_API_KEY. The key needs Manage conversations and helpdesk. See Authentication.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
chatbotId | string | Yes | The agent's id, from list_agents. |
ticketId | string | Yes | The ticket's number, as shown in Tickets and returned by List tickets, such as TKT-73. |
offset | integer | Yes | Where its comment list starts. Send 0 for the first ten comments. See List ticket messages. |
Request example
curl -X POST 'https://api.qwryai.com/public/v1/tools/get_ticket_detail' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"chatbotId": "YOUR_AGENT_ID", "ticketId": "TKT-73", "offset": 0}'const response = await fetch("https://api.qwryai.com/public/v1/tools/get_ticket_detail", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ chatbotId: "YOUR_AGENT_ID", ticketId: "TKT-73", offset: 0 }),
});
const { data: ticket } = await response.json();import requests
response = requests.post(
"https://api.qwryai.com/public/v1/tools/get_ticket_detail",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"chatbotId": "YOUR_AGENT_ID", "ticketId": "TKT-73", "offset": 0},
)
ticket = response.json()["data"]Response
{
"success": true,
"data": {
"_id": "<recordId>",
"ticketId": "TKT-73",
"title": "Late delivery for order 1043",
"status": "open",
"priority": "medium",
"category": "general",
"source": "chat",
"assignedAgentId": null,
"assignedAgentName": null,
"timestamps": {
"created": "2026-11-30T18:15:02.074Z",
"updated": "2026-11-30T18:56:55.709Z",
"assigned": null,
"resolved": null,
"closed": null
},
"respondedAt": null,
"createdAt": "2026-11-30T18:15:02.074Z",
"updatedAt": "2026-11-30T18:56:55.709Z",
"description": "My delivery for order 1043 is two weeks late. Please help me resolve this.",
"descriptionTruncated": false,
"comments": [],
"nextOffset": null
}
}| Field | Type | Description |
|---|---|---|
ticketId | string | The ticket's number. |
title | string | The ticket's title. |
status | string | Its status category: open, in_progress, on_hold, waiting_on_customer, resolved or closed. See List ticket statuses. |
priority, category | string | As set on the ticket. |
source | string | Where the ticket started, such as chat, email or whatsapp. |
assignedAgentId, assignedAgentName | string or null | The team member it's assigned to, or null. |
timestamps | object | When the ticket was created, last updated, assigned, resolved and closed. |
respondedAt | string or null | The response time recorded on the ticket, or null. |
description | string | The ticket's description, up to 2,000 characters. |
descriptionTruncated | boolean | true when the description was longer and was cut. |
comments | array | Up to ten comments from offset. |
nextOffset | integer or null | Send it as offset to read the next comments; null when there are none. |
Errors
| HTTP status | code | When |
|---|---|---|
| 400 | INVALID_ARGUMENTS | ticketId or offset is missing, or offset isn't a whole number from 0. |
| 400 | CHATBOT_ID_REQUIRED | chatbotId is missing or isn't a valid agent id. |
| 403 | INSUFFICIENT_PERMISSION | The key doesn't hold Manage conversations and helpdesk. |
| 404 | CHATBOT_NOT_FOUND | No agent with that chatbotId in your workspace. |
| 500 | TOOL_FAILED | No ticket with that number belongs to this agent, or the read failed. Check the number with Search tickets. |
See Error Handling for authentication and rate-limit errors.