The Tickets endpoint in AnswerPal provides full access to the lifecycle of customer support tickets, including creation, updates, and retrieval. Each ticket aggregates all related messages, attachments, and actions. This page documents the Tickets API endpoints and the associated TicketMessages (messages) sub-resource, including complete data models, detailed endpoint documentation, and usage examples.
The Tickets API allows you to list, search, create, update, and delete support tickets. Each ticket contains all communication related to a customer issue, including messages, attachments, status, and topic classification. Tickets are linked to end-users and can be managed programmatically or through the AnswerPal dashboard.
The Ticket object is used for both requests (creating/updating a ticket) and responses (retrieving ticket data). Below are the main properties:
TicketMessage objects have the following properties:
Purpose: List all tickets with support for filtering, sorting, and pagination.
Query Parameters:
Response:
{
"items": [
{
"ticketID": 123,
"dateCreated": "2024-04-01T10:00:00Z",
"status": "Open",
"subject": "Login not working",
"channelID": 2,
"endUserID": 45,
"isClosed": false,
"topics": ["Login Issues", "Authentication"],
"aiFeedbackComments": []
}
],
"totalCount": 1,
"totalPages": 1
}
Purpose: Retrieve a specific ticket by its ID.
Path Parameters:
Response: Returns a Ticket object (see Data Model).
Purpose: Create a new ticket.
Request Body:
{
"subject": "Login not working",
"channelID": 2,
"endUserID": 45,
"status": "Open",
"customFieldsData": { "priority": "urgent" }
}
Response: Returns the created Ticket object.
Purpose: Update an existing ticket.
Path Parameters:
Request Body: Ticket fields to update.
Response: 204 No Content on success.
Purpose: Delete a ticket by ID.
Response: 204 No Content on success.
Purpose: Bulk update tickets (e.g., close, assign, escalate).
Request Body:
{
"ticketIDs": [123, 124],
"action": "close",
"customerRepID": 5
}
Response: 204 No Content on success.
Purpose: Retrieve the historical summary for a ticket.
Response: A string summary of the ticket’s history.
Purpose: Returns a paginated list of messages for a given ticket.
Query Parameters:
Response: See Data Model.
Purpose: Returns all details for a single ticket message.
Path Parameters:
Response: See Data Model.
Purpose: Creates a new message, either in an existing ticket or by creating a new ticket.
Request Body: See Data Model.
Response: Returns the full message details.
Purpose: Update certain fields of a ticket message (e.g., AI reply, custom fields).
Request Body: See Data Model.
Response: 204 No Content.
Purpose: Assigns a new list of topics to a ticket message.
Request Body:
{
"topicIds": [1, 2, 3]
}
Response: 204 No Content.
Purpose: Sends the already prepared AI reply (or a manually modified one) for a message.
Request Body:
{
"modifiedAnswer": "Thank you for your patience. Please reset your password."
}
Response:
{ "message": "Message sent successfully." }
Purpose: Escalates the message for human review or higher support level.
Request Body:
{
"feedbackComment": "User is very upset and needs urgent help.",
"email": "manager@example.com"
}
Response:
{ "message": "Ticket escalated" }
Purpose: Triggers AI topic detection for the message.
Query Parameters:
Response: 204 No Content.
Purpose: Retrieves prompt documents (contextual data) for the message.
Query Parameters:
Response:
{
"promptDocuments": [
{ "documentID": 1, "title": "FAQ", "content": "..." }
]
}
Purpose: Uploads a file to the message.
Request Body:
Response:
{
"ticketMessageAttachmentID": 10,
"fileName": "error_screenshot.png",
"contentType": "image/png"
}
Purpose: Returns a list of attachments for the message.
Response:
[
{
"ticketMessageAttachmentID": 10,
"fileName": "error_screenshot.png",
"contentType": "image/png"
}
]
Purpose: Deletes a specific attachment from the message.
Response: 204 No Content.
Purpose: Lets the end user like or dislike a message via a unique ticket token.
Query Parameters:
Response:
{
"agentAvailable": false,
"customerRepName": "John"
}
Purpose: Deletes a ticket message by ID.
Response: 204 No Content.
Request:
GET /tickets?status=Open&pageNumber=1&pageSize=10
Response:
{
"items": [
{
"ticketID": 123,
"dateCreated": "2024-04-01T10:00:00Z",
"status": "Open",
"subject": "Login not working",
"channelID": 2,
"endUserID": 45,
"isClosed": false,
"topics": ["Login Issues", "Authentication"],
"aiFeedbackComments": []
}
],
"totalCount": 1,
"totalPages": 1
}
Request:
GET /ticketMessages?ticketId=123&pageNumber=1&pageSize=20
Response:
{
"items": [
{
"messageID": 567,
"ticketID": 123,
"dateCreated": "2024-04-01T10:01:00Z",
"senderType": "EndUser",
"message": "I can't log in to my account.",
"topics": [
{ "ticketMessageTopicID": 1, "topicName": "Login Issues" }
]
}
],
"totalCount": 1,
"totalPages": 1
}
AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.
For all support, sales, and partnership inquiries, email us at info@answerpal.eu