LiyaSupport
API Reference

Tickets API

Create, read, update, and manage support tickets programmatically.

8 min read Updated July 2026

Endpoints

GET/v1/ticketsList tickets
POST/v1/ticketsCreate a ticket
GET/v1/tickets/:idRetrieve a ticket
PATCH/v1/tickets/:idUpdate a ticket
DELETE/v1/tickets/:idDelete a ticket
GET/v1/tickets/:id/messagesList messages
POST/v1/tickets/:id/messagesSend a reply
POST/v1/tickets/:id/tagsAdd tags
DELETE/v1/tickets/:id/tags/:tagRemove a tag

Create a ticket

POST /v1/tickets

Create a new support ticket. If the contact email doesn't exist in your workspace, a new contact record is created automatically.

Request

bash
curl -X POST https://api.liyasupport.com/v1/tickets \
  -H "Authorization: Bearer lsk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Payment still processing",
    "body": "Hi, I made a payment 2 hours ago but my plan still shows Free.",
    "contact": {
      "email": "[email protected]",
      "name": "Jane Doe"
    },
    "channel": "api",
    "priority": "high",
    "tags": ["billing"]
  }'

Request body parameters

ParameterTypeRequiredDescription
subjectstringYesTicket subject line
bodystringYesFull message body (plain text or HTML)
contact.emailstringYesCustomer's email address
contact.namestringNoCustomer's display name
contact.idstringNoExisting contact ID (instead of email)
channelstringNoSource channel: api, email, chat, widget. Default: api
prioritystringNourgent, high, normal, low. Default: normal
assignee_idstringNoAssign to agent user ID
group_idstringNoAssign to agent group ID
tagsstring[]NoArray of tag strings
custom_attributesobjectNoKey/value pairs for custom ticket attributes

Response

json
{
  "id": "tkt_01JABCDE123",
  "subject": "Payment still processing",
  "status": "open",
  "priority": "high",
  "channel": "api",
  "created_at": "2026-07-03T14:22:00Z",
  "updated_at": "2026-07-03T14:22:01Z",
  "contact": {
    "id": "cnt_01JXYZ789",
    "name": "Jane Doe",
    "email": "[email protected]"
  },
  "assignee": null,
  "tags": ["billing"],
  "ai": {
    "intent": "billing_issue",
    "urgency": "high",
    "sentiment": "frustrated",
    "confidence": 87,
    "draft_ready": true
  }
}

List tickets

GET /v1/tickets

Query parameters

ParameterTypeDefaultDescription
statusstringallopen, pending, resolved, all
prioritystringFilter by priority: urgent, high, normal, low
assigneestringFilter by assignee user ID or 'unassigned'
groupstringFilter by group ID
channelstringFilter by channel: email, chat, widget, api
tagstringFilter by tag (exact match)
created_afterISO dateFilter tickets created after this date
created_beforeISO dateFilter tickets created before this date
sortstringcreated_at:descSort field and direction
limitinteger25Results per page (max 100)
cursorstringPagination cursor from previous response
bash
curl "https://api.liyasupport.com/v1/tickets?status=open&priority=high&limit=20" \
  -H "Authorization: Bearer lsk_live_..."

Update a ticket

PATCH /v1/tickets/:id

Partially update a ticket. Only the fields you include are modified.

bash
curl -X PATCH https://api.liyasupport.com/v1/tickets/tkt_01JABCDE123 \
  -H "Authorization: Bearer lsk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "status": "resolved",
    "assignee_id": "usr_01JAGENT456"
  }'

Updatable fields

FieldTypeNotes
statusstringopen, pending, resolved
prioritystringurgent, high, normal, low
assignee_idstringAgent user ID; null to unassign
group_idstringGroup ID; null to remove group
subjectstring
custom_attributesobjectMerged with existing; provide key: null to remove a key

Send a reply

POST /v1/tickets/:id/messages

bash
curl -X POST https://api.liyasupport.com/v1/tickets/tkt_01JABCDE123/messages \
  -H "Authorization: Bearer lsk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "body": "Hi Jane! Your payment was processed at 2:34 PM...",
    "type": "outbound",
    "author_id": "usr_01JAGENT456"
  }'

Message parameters

ParameterTypeRequiredDescription
bodystringYesReply content (plain text or HTML)
typestringYesoutbound (to customer) or note (internal only)
author_idstringNoUser ID of the sending agent. Defaults to the API key owner.
attachmentsobject[]NoArray of attachment objects: {filename, content_type, data (base64)}
Use type: "note" to add internal notes visible only to agents — these are never sent to the customer.

Ticket object reference

FieldTypeDescription
idstringUnique ticket ID (tkt_…)
subjectstringTicket subject line
statusstringopen | pending | resolved | archived
prioritystringurgent | high | normal | low
channelstringemail | chat | widget | api | phone
contactobjectContact object: id, name, email, avatar_url
assigneeobject?Assigned agent: id, name, email
groupobject?Assigned group: id, name
tagsstring[]Array of tag strings
ai.intentstringDetected intent category
ai.urgencystringAI-detected urgency: urgent | high | normal | low
ai.sentimentstringfrustrated | neutral | positive | unknown
ai.confidencenumberAI confidence score 0–100
ai.draft_readybooleanWhether an AI draft is available
created_atISO dateTicket creation time
updated_atISO dateLast modification time
resolved_atISO date?Time the ticket was resolved (null if open)
custom_attributesobjectCustom key/value attributes