TicketRpc
This RPC group provides ticket-related API operations for creating tickets, associating tickets with conversations, updating tickets, and retrieving tickets by query or identifier. All methods documented here are exposed through the JSON RPC transport at POST /api/rpc.
Endpoints
POST /api/rpc (Method: TicketRpc.create)
Description: Creates a new ticket, optionally linking it to a conversation.
Request Body:
{ "method": "TicketRpc.create", "params": { "conversationId": "string" } }Parameters:
Name Type Required Description conversationIdStringNo Optional conversation identifier to link after the ticket is created. subjectStringYes Ticket subject. statusEnumNo Ticket status. Accepted values: new,open,pending,solved,closed. Defaults tonew.priorityEnumNo Ticket priority. Accepted values: low,normal,high,urgent. Defaults tonormal.contactIdStringYes Primary contact associated with the ticket. assigneeIdString | NullNo User ID of the assigned agent. linkedConversationIdsArray<String>No Existing linked conversation IDs. autoResponseConfig.onStatusChangeBooleanNo Enables status-change notifications. Defaults to true.autoResponseConfig.onAssignmentBooleanNo Enables assignment-change notifications. Defaults to true.Response:
{ "success": true, "data": { "_id": "string", "subscriptionId": "string", "ticketNumber": 1001, "subject": "string", "status": "new", "priority": "normal", "contactId": "string", "assigneeId": "string|null", "linkedConversationIds": [], "autoResponseConfig": { "onStatusChange": true, "onAssignment": true }, "createdAt": "date-time", "updatedAt": "date-time" } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "TicketRpc.create", "params": { "subject": "Customer cannot log in", "contactId": "65f0c9d8a3b2f4e1c9d12345", "priority": "high", "status": "new", "conversationId": "65f0c9d8a3b2f4e1c9d67890" } }'
POST /api/rpc (Method: TicketRpc.linkConversation)
Description: Links an existing ticket to a conversation.
Request Body:
{ "method": "TicketRpc.linkConversation", "params": { "ticketId": "string", "conversationId": "string" } }Parameters:
Name Type Required Description ticketIdStringYes Ticket identifier to update. conversationIdStringYes Conversation identifier to associate with the ticket. Response:
{ "success": true, "data": null }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "TicketRpc.linkConversation", "params": { "ticketId": "65f0c9d8a3b2f4e1c9d12345", "conversationId": "65f0c9d8a3b2f4e1c9d67890" } }'
POST /api/rpc (Method: TicketRpc.update)
Description: Updates an existing ticket.
Request Body:
{ "method": "TicketRpc.update", "params": { "_id": "string" } }Parameters:
Name Type Required Description _idStringYes Ticket identifier to update. subjectStringNo Updated ticket subject. statusEnumNo Updated status. Accepted values: new,open,pending,solved,closed.priorityEnumNo Updated priority. Accepted values: low,normal,high,urgent.contactIdStringNo Updated primary contact identifier. assigneeIdString | NullNo Updated agent assignment. linkedConversationIdsArray<String>No Updated set of linked conversation IDs. autoResponseConfig.onStatusChangeBooleanNo Updated status-change notification setting. autoResponseConfig.onAssignmentBooleanNo Updated assignment-change notification setting. subscriptionIdStringNo Included in the schema but removed before the update is applied. ticketNumberNumberNo Included in the schema but removed before the update is applied. createdAtDateNo Included in the schema but removed before the update is applied. updatedAtDateNo Included in the schema but removed before the update is applied. Response:
{ "success": true, "data": { "_id": "string", "subscriptionId": "string", "ticketNumber": 1001, "subject": "string", "status": "open", "priority": "high", "contactId": "string", "assigneeId": "string|null", "linkedConversationIds": [], "autoResponseConfig": { "onStatusChange": true, "onAssignment": true }, "createdAt": "date-time", "updatedAt": "date-time" } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "TicketRpc.update", "params": { "_id": "65f0c9d8a3b2f4e1c9d12345", "status": "open", "assigneeId": "65f0c9d8a3b2f4e1c9abcd12" } }'
POST /api/rpc (Method: TicketRpc.getData)
Description: Retrieves a list of tickets.
Request Body:
{ "method": "TicketRpc.getData", "params": { "filter": {}, "sort": {}, "page": 1, "pageSize": 25 } }Parameters:
Name Type Required Description filterObjectNo Optional MongoDB-style filter object. The schema accepts an open object. sortObjectNo Optional MongoDB-style sort object. The schema accepts an open object. pageNumberNo Page number, starting at 1. Defaults to1.pageSizeNumberNo Number of records per page. Defaults to 25.Response:
{ "success": true, "data": { "data": [ { "_id": "string", "subscriptionId": "string", "ticketNumber": 1001, "subject": "string", "status": "new", "priority": "normal", "contactId": "string", "assigneeId": "string|null", "linkedConversationIds": [], "autoResponseConfig": { "onStatusChange": true, "onAssignment": true }, "createdAt": "date-time", "updatedAt": "date-time" } ], "totalCount": 0 } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "TicketRpc.getData", "params": { "filter": { "status": "open" }, "sort": { "updatedAt": -1 }, "page": 1, "pageSize": 25 } }'
POST /api/rpc (Method: TicketRpc.findById)
Description: Retrieves a single ticket by its ID.
Request Body:
{ "method": "TicketRpc.findById", "params": { "_id": "string" } }Parameters:
Name Type Required Description _idStringYes Ticket identifier to look up. Response:
{ "success": true, "data": { "_id": "string", "subscriptionId": "string", "ticketNumber": 1001, "subject": "string", "status": "new", "priority": "normal", "contactId": "string", "assigneeId": "string|null", "linkedConversationIds": [], "autoResponseConfig": { "onStatusChange": true, "onAssignment": true }, "createdAt": "date-time", "updatedAt": "date-time" } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "TicketRpc.findById", "params": { "_id": "65f0c9d8a