Tickets
Tickets are the core of cStar. Each one represents a customer support conversation. Create, update, and resolve tickets through the API.
The Ticket object
Unique ticket identifier (tkt_ prefix)
Ticket subject line, up to 255 characters. Subjects from email and the widget are shortened to fit.
One of the team's ticket status keys (GET /settings, ticketStatuses[].key), for example new, open, pending, waiting_on_customer, resolved, closed.
One of the team's priority keys (GET /settings, priorities[].key), for example critical, high, normal, low. Other values return 400 parameter_invalid with the allowed keys.
Associated customer ID (cus_ prefix)
Assigned teammate's userId (GET /members), or null
Array of tag strings
Internal notes (not visible to customers)
Custom field values keyed by field ID (GET /custom-fields?entity=ticket), stored as strings
Number of public messages on this ticket. Internal notes are not counted, so List Messages can return more.
When the ticket was created
Last modification timestamp
When the ticket first moved to resolved or closed, or null while it is open. Reopening clears it.
Endpoints
/api/v1/teams/{teamId}/ticketsList Tickets
Try itRetrieve a paginated list of tickets with optional filtering by status, priority, customer, or search term.
Query Parameters
status string Filter by one of the team's ticket status keys (GET /settings)
priority string Filter by one of the team's priority keys (GET /settings), for example critical
search string Search the ticket title and customer name (not message content)
customerId string Filter tickets by customer
page integer Page number (1-indexed)
Default: 1
pageSize integer Results per page (max 100)
Default: 20
Code Examples
curl -X GET "https://www.cstar.help/api/v1/teams/{teamId}/tickets?status=open&page=1" \
-H "Authorization: Bearer sk_live_your_key" Responses
{
"success": true,
"data": [
{
"id": "tkt_550e8400e29b41d4a716446655440000",
"title": "Cannot log in to my account",
"status": "open",
"priority": "high",
"customerId": "cus_7c9e667974254de0944be07fc1f90ae7",
"tags": [
"login",
"authentication"
],
"messageCount": 3,
"createdAt": "2025-12-10T14:30:00Z"
}
],
"pagination": {
"total": 142,
"page": 1,
"pageSize": 20,
"hasMore": true
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked",
"doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "insufficient_permissions",
"message": "Your API key does not have permission for this operation",
"doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"retryAfter": 60,
"doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} /api/v1/teams/{teamId}/tickets/{ticketId}Get Ticket
Try itRetrieve a single ticket by ID. Includes the full message thread.
Path Parameters
ticketId string requiredThe ticket ID (tkt_ prefix)
Code Examples
curl -X GET "https://www.cstar.help/api/v1/teams/{teamId}/tickets/{ticketId}" \
-H "Authorization: Bearer sk_live_your_key" Responses
{
"success": true,
"data": {
"id": "tkt_550e8400e29b41d4a716446655440000",
"title": "Cannot log in to my account",
"status": "open",
"priority": "high",
"customerId": "cus_7c9e667974254de0944be07fc1f90ae7",
"assignedTo": null,
"tags": [
"login",
"authentication"
],
"notes": null,
"messageCount": 3,
"messages": [
{
"id": "msg_a1b2c3d4e5f6",
"content": "I keep getting \"invalid credentials\" when I try to log in.",
"sender": "customer",
"senderName": "Jane Smith",
"createdAt": "2025-12-10T14:30:00Z"
}
],
"createdAt": "2025-12-10T14:30:00Z",
"updatedAt": "2025-12-10T15:00:00Z"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T15:00:00Z"
}
} {
"success": false,
"error": {
"type": "not_found_error",
"code": "resource_not_found",
"message": "Ticket not found",
"doc_url": "https://www.cstar.help/developers/errors#resource_not_found",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked",
"doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "insufficient_permissions",
"message": "Your API key does not have permission for this operation",
"doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"retryAfter": 60,
"doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} /api/v1/teams/{teamId}/ticketsCreate Ticket
Try itCreate a new support ticket. Optionally attach it to an existing customer or provide customer details inline. An unknown body field returns 400 with that field as param.
Request Body
title string requiredTicket subject line, 1 to 255 characters. Longer values return 400 with param "title".
priority string One of the team's priority keys (GET /settings, priorities[].key), for example critical, high, normal, low. Other values return 400 parameter_invalid with the allowed keys.
Default: normal
status string Starting status, one of the team's ticket status keys (GET /settings). Other values, and 'merged', return 400 parameter_invalid.
Default: new
customerId string Existing customer ID (cus_ prefix)
customerEmail string Email of an existing customer on this team, used when customerId is not provided. Returns 422 if no customer has it.
customerName string Customer name (used if customerId is not provided)
messages object[] Opening messages, oldest first. Each is { sender: "customer" | "agent" | "system", content, isInternal?, messageType? }, with the same rules as Add Message: isInternal true (or messageType "internal") saves a private team note. Unknown fields, another sender, or isInternal and messageType that disagree return 400 with param messages[i].<field>.
tags string[] Array of tag strings. Each tag is stored lowercase, with spaces and underscores turned into a dash and cut to 50 characters; empty and repeated tags are dropped. 'Invoice_Paid' is stored as 'invoice-paid'.
notes string Internal notes
customFields object Values keyed by ticket custom field ID (GET /custom-fields?entity=ticket). Each must fit its field: a number (JSON number or numeric string, within the field's min and max), true or false for a checkbox, one of the options for a select, YYYY-MM-DD for a date, an http(s) URL for a URL. An unknown ID or a value that doesn't fit is a 400 naming customFields.<id>.
metadata object Arbitrary key-value metadata (max 50 keys). On update, keys are merged. Set a key to null to remove it. Values must be strings (send 5 as "5"); other types return 400 naming the key.
Code Examples
curl -X POST "https://www.cstar.help/api/v1/teams/{teamId}/tickets" \
-H "Authorization: Bearer sk_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"title": "Cannot log in to my account",
"priority": "high",
"customerName": "Jane Smith",
"tags": ["login", "authentication"]
}' Responses
{
"success": true,
"data": {
"id": "tkt_550e8400e29b41d4a716446655440000",
"title": "Cannot log in to my account",
"status": "new",
"priority": "high",
"tags": [
"login",
"authentication"
],
"createdAt": "2025-12-10T14:30:00Z"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "title is required",
"param": "title",
"doc_url": "https://www.cstar.help/developers/errors#parameter_missing",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_in_use",
"message": "A request with this Idempotency-Key is still being processed. Retry after it finishes.",
"doc_url": "https://www.cstar.help/developers/errors#idempotency_key_in_use",
"request_id": "req_abc123"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used for a request with a different body. Generate a new key for this request.",
"doc_url": "https://www.cstar.help/developers/errors#idempotency_key_reused",
"request_id": "req_abc123"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked",
"doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "insufficient_permissions",
"message": "Your API key does not have permission for this operation",
"doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"retryAfter": 60,
"doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} /api/v1/teams/{teamId}/tickets/{ticketId}Update Ticket
Try itUpdate one or more fields on an existing ticket. Only include the fields you want to change.
Path Parameters
ticketId string requiredThe ticket ID (tkt_ prefix)
Request Body
title string New subject, up to 255 characters. Sending the unchanged subject of an older, longer ticket is allowed.
status string One of the team's ticket status keys (GET /settings). Other values return 400 parameter_invalid with the allowed keys. 'merged' returns 400 (param status): merging tickets sets it. A merged ticket stays merged: any other status returns 409.
priority string One of the team's priority keys (GET /settings, priorities[].key), for example critical, high, normal, low. Other values return 400 parameter_invalid with the allowed keys.
assignedTo string The teammate to assign: a member's userId or id from GET /members, or null to unassign. Someone not on the team returns 400 (param assignedTo).
tags string[] Array of tag strings that replaces the current ones. Each tag is stored lowercase, with spaces and underscores turned into a dash and cut to 50 characters; empty and repeated tags are dropped. 'Invoice_Paid' is stored as 'invoice-paid'.
notes string Internal notes
customFields object Replaces all custom field values (keyed by field ID). Same checks as on create; a value sent back unchanged is kept even if its field was since deleted. null or an empty string clears a value.
metadata object Key-value metadata to merge. Existing keys preserved, new keys added. Set a key to null to remove it. Values must be strings (send 5 as "5"); other types return 400 naming the key.
Code Examples
curl -X PATCH "https://www.cstar.help/api/v1/teams/{teamId}/tickets/{ticketId}" \
-H "Authorization: Bearer sk_live_your_key" \
-H "Content-Type: application/json" \
-d '{ "status": "resolved", "notes": "Password reset sent" }' Responses
{
"success": true,
"data": {
"id": "tkt_550e8400e29b41d4a716446655440000",
"title": "Cannot log in to my account",
"status": "resolved",
"priority": "high",
"updatedAt": "2025-12-10T16:00:00Z"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T16:00:00Z"
}
} {
"success": false,
"error": {
"type": "not_found_error",
"code": "resource_not_found",
"message": "Ticket not found",
"doc_url": "https://www.cstar.help/developers/errors#resource_not_found",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_in_use",
"message": "A request with this Idempotency-Key is still being processed. Retry after it finishes.",
"doc_url": "https://www.cstar.help/developers/errors#idempotency_key_in_use",
"request_id": "req_abc123"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used for a request with a different body. Generate a new key for this request.",
"doc_url": "https://www.cstar.help/developers/errors#idempotency_key_reused",
"request_id": "req_abc123"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked",
"doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "insufficient_permissions",
"message": "Your API key does not have permission for this operation",
"doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"retryAfter": 60,
"doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} /api/v1/teams/{teamId}/tickets/{ticketId}Delete Ticket
Try itPermanently delete a ticket and all its messages. This action cannot be undone.
Path Parameters
ticketId string requiredThe ticket ID (tkt_ prefix)
Code Examples
curl -X DELETE "https://www.cstar.help/api/v1/teams/{teamId}/tickets/{ticketId}" \
-H "Authorization: Bearer sk_live_your_key" Responses
{
"success": true,
"data": {
"deleted": true
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "not_found_error",
"code": "resource_not_found",
"message": "Ticket not found",
"doc_url": "https://www.cstar.help/developers/errors#resource_not_found",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked",
"doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "insufficient_permissions",
"message": "Your API key does not have permission for this operation",
"doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"retryAfter": 60,
"doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}