Complete reference for the Tickets API. Create, update, list, and close support tickets programmatically.
Tickets API Reference
Manage support tickets programmatically.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /teams/{teamId}/tickets |
List tickets |
| POST | /teams/{teamId}/tickets |
Create ticket |
| GET | /teams/{teamId}/tickets/{ticketId} |
Get ticket |
| PATCH | /teams/{teamId}/tickets/{ticketId} |
Update ticket |
| DELETE | /teams/{teamId}/tickets/{ticketId} |
Delete ticket |
| GET | /teams/{teamId}/tickets/{ticketId}/messages |
List messages |
| POST | /teams/{teamId}/tickets/{ticketId}/messages |
Add message |
List Tickets
GET /api/v1/teams/{teamId}/tickets
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page |
integer | Page number (default: 1) |
pageSize |
integer | Items per page (default: 20, max: 100) |
status |
string | Filter by status (new, open, pending, resolved, closed) |
priority |
string | Filter by priority (low, normal, high, critical) |
assignedTo |
uuid | Filter by assigned agent |
customerId |
uuid | Filter by customer |
Example
curl "https://www.cstar.help/api/v1/teams/{teamId}/tickets?status=open&priority=high" \
-H "Authorization: Bearer sk_live_xxx"
Response
{
"success": true,
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Need help with billing",
"status": "open",
"priority": "high",
"customerId": "customer-uuid",
"customerName": "Jane Doe",
"assignedTo": "agent-uuid",
"messageCount": 3,
"tags": ["billing", "urgent"],
"createdAt": "2025-12-14T10:00:00Z",
"updatedAt": "2025-12-14T10:30:00Z"
}
],
"pagination": {
"total": 42,
"page": 1,
"pageSize": 20,
"hasMore": true
}
}
Create Ticket
POST /api/v1/teams/{teamId}/tickets
Request Body
{
"title": "Cannot access dashboard",
"customerId": "customer-uuid",
"priority": "high",
"status": "new",
"tags": ["login", "dashboard"],
"initialMessage": "I keep getting a 403 error when trying to log in."
}
Required Fields
title: Ticket subject linecustomerId: Customer UUID
Optional Fields
priority: low, normal (default), high, criticalstatus: new (default), open, pending, resolved, closedtags: Array of tag stringsassignedTo: Agent UUIDinitialMessage: Creates first customer message
Update Ticket
PATCH /api/v1/teams/{teamId}/tickets/{ticketId}
Request Body
{
"status": "resolved",
"priority": "normal",
"assignedTo": "agent-uuid"
}
All fields are optional. Only include fields you want to update.
Add Message
POST /api/v1/teams/{teamId}/tickets/{ticketId}/messages
Request Body
{
"content": "Thanks for reaching out! I can help you with this.",
"sender": "agent"
}
| Field | Description |
|---|---|
content |
Message text (required) |
sender |
"agent", "customer", or "system" |
Webhooks
Ticket events trigger webhooks:
ticket.created- New ticket createdticket.updated- Ticket fields changedticket.closed- Ticket status changed to closed/resolved
See Webhook Events Reference for payload details.