Skip to content
QwryAI
Documentation
Pages

Endpoints

List tickets

Page through an agent's tickets, newest first, filtered by status, assignee, channel, dates or title

The query_tickets tool returns the agent's Helpdesk tickets 20 at a time, newest first, the same tickets your team works on under Tickets. Filters combine with AND. Pass a saved view's view_id to get that view's tickets in its own order.

POSThttps://api.qwryai.com/public/v1/tools/query_tickets

Authentication

Send your API key as Authorization: Bearer YOUR_API_KEY. The key needs Manage conversations and helpdesk. See Authentication.

Body parameters

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from list_agents.
pageintegerYesPage number, starting at 1 (up to 10000). Each page holds 20 tickets.
statusstringNoOne status category: open, in_progress, on_hold, waiting_on_customer, resolved or closed.
searchstringNoText to find in ticket titles, up to 200 characters. A literal, case-insensitive match.
assigneeIdstringNoOnly tickets assigned to this team member. list_helpdesk_agents lists member ids.
unassignedbooleanNotrue for tickets nobody is assigned to. Don't send it with assigneeId.
channelstringNoOnly tickets from this source, such as chat or email.
startDatestringNoFirst creation day to include, YYYY-MM-DD (UTC). Send it with endDate.
endDatestringNoLast creation day to include, YYYY-MM-DD (UTC). The range can span at most 184 days.
view_idstringNoA saved view's id from list_saved_views. Applies that view's conditions and sort as well as your filters.

Request example

Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/query_tickets' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chatbotId": "YOUR_AGENT_ID",
    "page": 1,
    "status": "open",
    "startDate": "2026-11-01",
    "endDate": "2026-11-30"
  }'

Response

JSON
{
  "success": true,
  "data": {
    "items": [
      {
        "_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"
      }
    ],
    "total": 1,
    "page": 1,
    "hasMore": false,
    "searchMode": "literal_title"
  }
}
FieldTypeDescription
itemsarrayUp to 20 tickets. ticketId is the ticket's number, such as TKT-73; status is its category; source is where it started.
totalintegerHow many tickets match the filters.
pageintegerThe page you asked for.
hasMorebooleantrue while there are more pages. Ask for page + 1.
viewobjectOnly with view_id: the view's id, name and sort.
searchModestringAlways literal_title: search is a plain text match on titles.

Read one ticket with its description and comments with Get a ticket. See Pagination for paging loops.

Errors

HTTP statuscodeWhen
400INVALID_ARGUMENTSpage is missing, or an argument fails the schema, such as an unknown status or a badly written date. issues lists each one.
400CHATBOT_ID_REQUIREDchatbotId is missing or isn't a valid agent id.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Manage conversations and helpdesk.
404CHATBOT_NOT_FOUNDNo agent with that chatbotId in your workspace.
409VALIDATION_INVALID_BODYOnly one of startDate and endDate was sent, the range is over 184 days, both assigneeId and unassigned were sent, or view_id doesn't match a saved view.
413RESULT_TOO_LARGEThe page is over 40,000 bytes. Add filters.

See Error Handling for authentication and rate-limit errors.

Explore the documentation