Tickets API
Create, list, read and reply to tickets in your workspace from your own code. JSON in, JSON out, one API key.
Basics
| Base URL | https://getsupportx.com/api/v1 |
|---|---|
| Format | JSON requests and responses |
| Errors | Always { "error": "what went wrong" } with a matching status code |
| Rate limit | 120 requests a minute for each key |
| OpenAPI | /api/v1/openapi.json |
Authentication
A workspace admin creates an API key in the workspace's settings. Send it on every request as a Bearer token. A key belongs to one workspace and can only see that workspace's tickets.
Authorization: Bearer gsx_...Each key carries scopes: tickets:read to list and read, and tickets:write to create and reply.
| Status | Meaning |
|---|---|
| 401 | The key is missing, revoked or expired. |
| 403 | The key lacks the scope, the workspace is not active, or its plan does not include the API. |
| 429 | More than 120 requests in a minute for this key. Wait, then retry. |
Keep the key on your server
List tickets
GET /tickets returns tickets with the most recent activity first.
| Query | Meaning |
|---|---|
| status | One of OPEN, PENDING, ON_HOLD, SOLVED, CLOSED. An unknown value is ignored. |
| q | Free text over the subject and the requester. |
| limit | 1 to 100. Default 50. |
curl "https://getsupportx.com/api/v1/tickets?status=OPEN&limit=20" \
-H "Authorization: Bearer $GSX_API_KEY"The response is { "tickets": [ … ] }. Each ticket has the fields shown under Create a ticket.
Create a ticket
POST /tickets files a ticket "via API". Your team is notified and the ticket.created webhook fires, exactly as for a ticket that arrived by email.
| Field | Required | Notes |
|---|---|---|
| subject | Yes | Up to 200 characters. |
| requesterEmail | Yes | The customer's email address. |
| body | Yes | The first message. Up to 10,000 characters. |
| requesterName | No | The customer's name. |
| priority | No | One of LOW, NORMAL, HIGH, URGENT. An unknown value is an error, not a silent default. |
| opening | No | customer (default) files the body as the customer's own message. agent files it as a public message from your team, for a ticket you open on someone's behalf. |
| sendEmail | No | Only with opening: "agent". true emails the opening message to the customer. Off by default. |
curl -X POST "https://getsupportx.com/api/v1/tickets" \
-H "Authorization: Bearer $GSX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "Cannot log in",
"requesterEmail": "[email protected]",
"requesterName": "Sam Customer",
"body": "I get an error when I sign in.",
"priority": "NORMAL"
}'{
"ticket": {
"id": "…",
"number": 1042,
"subject": "Cannot log in",
"status": "OPEN",
"priority": "NORMAL",
"channel": "API",
"requester": { "id": "…", "email": "[email protected]", "name": "Sam Customer" },
"assignee": null,
"lastMessageAt": "…",
"lastActivityAt": "…",
"createdAt": "…",
"updatedAt": "…"
}
}Read a ticket
GET /tickets/{id} returns the ticket, its tags and every message in the thread. Use the ticket's id, not its number.
curl "https://getsupportx.com/api/v1/tickets/TICKET_ID" \
-H "Authorization: Bearer $GSX_API_KEY"Internal notes are included
isInternal: true is a private note from your team. Do not show it to the customer.Reply to a ticket
POST /tickets/{id}/reply adds a message signed "API".
| Field | Required | Notes |
|---|---|---|
| body | Yes | Up to 10,000 characters. |
| isInternal | No | true stores a private note. Nothing is sent to the customer. |
| sendEmail | No | A public reply is emailed to the customer by default. false stores it without sending. |
curl -X POST "https://getsupportx.com/api/v1/tickets/TICKET_ID/reply" \
-H "Authorization: Bearer $GSX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "body": "Thanks, we are looking into it." }'- The response is
{ "message": { … }, "delivery": { "status": "…", "reason": "…" } }. Readdeliveryto learn whether the email went out. - A reply to a merged ticket lands on the ticket it was merged into.
409means the ticket was merged and its target could not be found.
Webhooks
To hear about tickets instead of polling, add a webhook in your workspace's settings. Events are sent when a ticket is created or replied to. Each request is signed with HMAC-SHA256 in the X-GSX-Signature header, so you can check it came from us.
Read next