{"openapi":"3.1.0","info":{"title":"GetSupportX API","version":"1.0.0","summary":"Tickets in a GetSupportX workspace.","description":"Create, list, read and reply to support tickets. Every request carries one workspace's API key and can only see that workspace.","contact":{"name":"GetSupportX support","email":"support@getsupportx.com"}},"servers":[{"url":"https://getsupportx.com/api/v1"}],"externalDocs":{"description":"API guide","url":"https://getsupportx.com/api/v1/docs"},"security":[{"apiKey":[]}],"paths":{"/tickets":{"get":{"operationId":"listTickets","summary":"List tickets, most recent activity first","description":"Needs the \"tickets:read\" scope.","parameters":[{"name":"status","in":"query","description":"Only tickets in this status. An unknown value is ignored.","schema":{"type":"string","enum":["OPEN","PENDING","ON_HOLD","SOLVED","CLOSED"]}},{"name":"q","in":"query","description":"Free text over the subject and the requester.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"The tickets.","content":{"application/json":{"schema":{"type":"object","required":["tickets"],"properties":{"tickets":{"type":"array","items":{"$ref":"#/components/schemas/Ticket"}}}}}}},"401":{"description":"Missing, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the needed scope, the workspace is not active, or its plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (120 requests a minute per key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createTicket","summary":"Create a ticket","description":"Needs the \"tickets:write\" scope. The ticket is filed \"via API\". The team is notified and the ticket.created webhook fires.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTicket"}}}},"responses":{"201":{"description":"The created ticket. With opening \"agent\" the response also carries the opening message and its email delivery outcome.","content":{"application/json":{"schema":{"type":"object","required":["ticket"],"properties":{"ticket":{"$ref":"#/components/schemas/Ticket"},"message":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"type":"null"}]},"delivery":{"$ref":"#/components/schemas/Delivery"}}}}}},"400":{"description":"A field is missing or invalid; the message says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the needed scope, the workspace is not active, or its plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (120 requests a minute per key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tickets/{id}":{"get":{"operationId":"getTicket","summary":"Read one ticket and its messages","description":"Needs the \"tickets:read\" scope.","parameters":[{"$ref":"#/components/parameters/ticketId"}],"responses":{"200":{"description":"The ticket with its tags and full thread.","content":{"application/json":{"schema":{"type":"object","required":["ticket","messages"],"properties":{"ticket":{"$ref":"#/components/schemas/TicketDetail"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}}}},"401":{"description":"Missing, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the needed scope, the workspace is not active, or its plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such ticket in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (120 requests a minute per key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tickets/{id}/reply":{"post":{"operationId":"replyToTicket","summary":"Post a reply or an internal note","description":"Needs the \"tickets:write\" scope. The message is signed \"API\". A public reply is emailed to the requester unless sendEmail is false. A reply to a merged ticket lands on the ticket it was merged into.","parameters":[{"$ref":"#/components/parameters/ticketId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reply"}}}},"responses":{"201":{"description":"The stored message and what happened to its email.","content":{"application/json":{"schema":{"type":"object","required":["message","delivery"],"properties":{"message":{"$ref":"#/components/schemas/Message"},"delivery":{"$ref":"#/components/schemas/Delivery"}}}}}},"400":{"description":"The body is missing, too long, or sendEmail is not a boolean.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the needed scope, the workspace is not active, or its plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such ticket in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket was merged and its target could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (120 requests a minute per key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A workspace API key (\"gsx_…\"), created by a workspace admin. Scopes: tickets:read, tickets:write."}},"parameters":{"ticketId":{"name":"id","in":"path","required":true,"description":"The ticket's id (the `id` field, not its `number`).","schema":{"type":"string"}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Person":{"type":"object","properties":{"id":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"Ticket":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","description":"The number people see (#1042)."},"subject":{"type":"string"},"status":{"type":"string","enum":["OPEN","PENDING","ON_HOLD","SOLVED","CLOSED"]},"priority":{"type":"string","enum":["LOW","NORMAL","HIGH","URGENT"]},"channel":{"type":"string","description":"How it arrived, e.g. \"API\", \"EMAIL\"."},"requester":{"anyOf":[{"$ref":"#/components/schemas/Person"},{"type":"null"}]},"assignee":{"anyOf":[{"$ref":"#/components/schemas/Person"},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastActivityAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}},"TicketDetail":{"allOf":[{"$ref":"#/components/schemas/Ticket"},{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}]},"Message":{"type":"object","properties":{"id":{"type":"string"},"ticketId":{"type":"string","description":"Present on a reply's response."},"authorType":{"type":"string","description":"Who wrote it, e.g. \"AGENT\"."},"authorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorName":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"isInternal":{"type":"boolean","description":"true for a note customers never see."},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}},"Delivery":{"type":"object","description":"What happened to the email for this message.","required":["status"],"properties":{"status":{"type":"string","description":"For example \"sent\", \"skipped\", \"none\" or \"failed\"."},"code":{"type":"string"},"reason":{"type":"string","description":"The same outcome in plain words."}}},"CreateTicket":{"type":"object","required":["subject","requesterEmail","body"],"properties":{"subject":{"type":"string","maxLength":200},"requesterEmail":{"type":"string","format":"email"},"requesterName":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":10000},"priority":{"type":"string","enum":["LOW","NORMAL","HIGH","URGENT"]},"opening":{"type":"string","enum":["customer","agent"],"default":"customer","description":"\"customer\": body is the requester's own first message. \"agent\": body is a public message from the team, and no customer message is written."},"sendEmail":{"type":"boolean","default":false,"description":"Only read with opening \"agent\": true emails the opening message to the requester."}}},"Reply":{"type":"object","required":["body"],"properties":{"body":{"type":"string","maxLength":10000},"isInternal":{"type":"boolean","default":false,"description":"true stores an internal note: never shown or emailed to the customer."},"sendEmail":{"type":"boolean","default":true,"description":"false stores a public reply without emailing it."}}}}}}