External ticket source
The /api/v1/external section is for a system that keeps tickets on its own side: billing, a CRM, a customer portal. Its support staff work in SupportHub.
Your system calls the section itself: it creates a ticket under its own id, sends the customer’s messages, closes and reopens the ticket and passes on the rating. It reads what the staff did from an event feed with a cursor. SupportHub never calls your system, so your system needs no public address.
Operators see such a ticket with the “External system” channel. An operator’s reply goes only to the event feed: SupportHub sends nothing to the customer’s Telegram or email. Your system shows the reply to the customer.
Who owns what
- Your system: the ticket and its id, the customer, the subject, the ticket’s fields (
fields), the conversation the customer sees. - SupportHub: the assignee, the department, notes, tags and priority after creation, SLA, the working status.
- Both sides: public messages and the open or closed state.
Basics
- The base address is
https://supporthub.cc/api/v1, and the paths below start from it. - The key is the project’s API key (Settings → API Keys), sent in the
Authorization: Bearer sk_...header, as everywhere in the API (see Authentication). A project has one external source. - Request and response bodies are JSON in UTF-8. Times go both ways in UTC, ISO 8601 with
Z. SupportHub sends them to the second. - External ids (
ticket_ext_id, a message’sid,contact.id) are strings of up to 64 characters fromA-Z a-z 0-9 . _ : -. Aticket_ext_idis unique among the project’s tickets, a messageidamong its messages. - The limit is 20,000 requests a minute per key, shared with the rest of the API. Above it you get
429with aRetry-Afterheader (see Limits & errors). - Both sides skip fields they don’t know: SupportHub in your requests, your system in responses and events. New fields and event types are added without a new contract version.
/api/v1/external/pingCheck the connection
Answers that the key is accepted and the section is on. contract is the contract version, limits holds the maximums: characters in a message text, bytes in a file, files in a message, fields and tags of a ticket.
curl https://supporthub.cc/api/v1/external/ping \
-H "Authorization: Bearer sk_..."{
"ok": true,
"contract": 1,
"project": { "id": "1c2b...", "name": "My project" },
"limits": {
"text_chars": 10000,
"file_bytes": 268435456,
"files_per_message": 10,
"fields": 20,
"tags": 20
}
}The ticket
/api/v1/external/tickets/{ticket_ext_id}Create or update a ticket
The first call creates an open ticket and answers 201. A repeat with the same ticket_ext_id answers 200 and updates the ticket.
{
"contact": {
"id": "10452",
"email": "client@example.com",
"telegram_id": 123456789,
"name": "John Smith",
"locale": "en"
},
"subject": "The server does not start",
"tags": ["tech"],
"priority": "normal",
"fields": [
{ "id": "server", "label": "Server", "value": "#812 vm-fra-2", "url": "https://example.com/admin/servers/812" }
],
"created_at": "2026-11-27T10:15:30Z",
"history": false
}Fields:
contact: the customer, required.contact.idis their id in your system, also required. A ticket keeps its customer: a repeat with anothercontact.iddoesn’t move it.name,emailandlocaleare updated on every call.localeis reduced to the primary language:ru-RUbecomesru- SupportHub looks the customer up by
contact.id, then bytelegram_id, then byemail. So send only a confirmed email and Telegram id, or the ticket may end up with another person’s contact subject: the subject, up to 200 characters. Required to create a ticket, a repeat updates ittags: up to 20 tags of up to 64 characters each.priority:low,normal,highorurgent. Both are read only at creation. After that, tags and priority are managed in SupportHubfields: up to 20 ticket fields,idup to 32 characters,labelup to 64,valueup to 500,urlhttp or https only. Operators see the fields next to the ticket, and a field with aurlis a link. A repeat replaces the whole listcreated_at: when the ticket appeared on your side. Read only at creation, the moment of the call by defaulthistory:truefor a ticket you are moving in. Operators get no notification, the assistant doesn’t answer, SLA times run from the move
curl -X PUT https://supporthub.cc/api/v1/external/tickets/1024 \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-d '{"contact": {"id": "10452", "email": "client@example.com", "name": "John Smith"}, "subject": "The server does not start"}'{
"id": "8a3f...",
"ext_id": "1024",
"status": "open",
"created": true,
"agent_url": "https://supporthub.cc/tickets/8a3f...?ws=..."
}status is open or closed, and created tells whether this call created the ticket. agent_url is a link that opens the ticket in SupportHub for your staff.
Messages
/api/v1/external/tickets/{ticket_ext_id}/messagesSend a message
The first call answers 201. A repeat with the same id answers 200 with the message already stored, and the body of the repeat isn’t applied.
{
"id": "88731",
"author": "customer",
"text": "The server has not answered since this morning",
"media_ids": ["m1..."]
}Fields:
id: the message’s id in your system, requiredauthor:customerorstaff(a member of your staff), required. Operators see astaffmessage as a support reply. This is how replies your staff wrote on your side reach SupportHubauthor_name: the staff member’s name forstaff, up to 100 characterstext: up to 10,000 characters. Plain text from the customer, Markdown from staffmedia_ids: up to 10 files fromPOST /api/v1/media/upload. An unknown id rejects the whole message with422- A text or at least one file is required
created_at: the message’s time on your side. Read only withhistory: true, a live message gets the time it arriveshistory:truefor a message of an old conversation you are moving in
A customer message reopens a closed ticket. A staff message and a message with history: true change no state and notify nobody. Send the messages of one ticket in the order they were written.
curl -X POST https://supporthub.cc/api/v1/external/tickets/1024/messages \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-d '{"id": "88731", "author": "customer", "text": "The server has not answered since this morning"}'{ "id": "f1...", "ext_id": "88731", "created": true }Closing, reopening and rating
/api/v1/external/tickets/{ticket_ext_id}/closeClose a ticket
by is who closed it: customer, staff or system. The response is {"status": "closed"}.
curl -X POST https://supporthub.cc/api/v1/external/tickets/1024/close \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-d '{"by": "customer"}'/api/v1/external/tickets/{ticket_ext_id}/reopenReopen a ticket
The same body: by is customer, staff or system. The response is {"status": "open"}.
{ "by": "staff" }/api/v1/external/tickets/{ticket_ext_id}/ratePass on the customer’s rating
rating is 1 to 5, comment an optional comment. A new rating replaces the earlier one. The response is {"rating": 5}.
{ "rating": 5, "comment": "Thanks, it works now" }All three calls are idempotent and safe to repeat.
Files
- Upload a customer’s file with
POST /api/v1/media/upload:multipart/form-data, afilefield, up to 256 MB. Pass itsidin the message’smedia_ids. See Media for details. - The server tells the file type by its content. HTML, SVG and scripts are accepted, but an operator gets them only as a download.
- A file’s
urlin an event is a path on the API host:/api/v1/media/<id>. Download the file with the same key. The response is the file itself or a302to a signed storage link, which you follow without theAuthorizationheader. - Copy the files to your side: SupportHub keeps them for a limited time, 90 days by default.
The event feed
/api/v1/external/updatesGet events
offset: theidof the last event your system stored. Start with0timeout: how many seconds to wait for new events, 0 to 30. With0the answer comes at oncelimit: how many events to return at a time, 1 to 100
Events come oldest first. An event’s id grows but isn’t consecutive. If there are no new events and timeout is above zero, the request waits until an event appears or the time runs out. Then the response is {"updates": []}.
curl "https://supporthub.cc/api/v1/external/updates?offset=1795774562123456&timeout=25" \
-H "Authorization: Bearer sk_..."{
"updates": [
{
"id": 1795774841204913,
"type": "message.created",
"timestamp": "2026-11-27T10:20:41Z",
"data": {
"id": "5d0c...",
"ticket_ext_id": "1024",
"author": "operator",
"author_name": "Anna",
"text": "We restarted the server, please check.",
"media": [
{
"id": "m2...",
"url": "/api/v1/media/m2...",
"mime_type": "image/png",
"original_name": "status.png",
"size": 48211,
"width": 1280,
"height": 720
}
],
"created_at": "2026-11-27T10:20:41Z"
}
},
{
"id": 1795775467530128,
"type": "ticket.closed",
"timestamp": "2026-11-27T10:31:07Z",
"data": { "ticket_ext_id": "1024", "by": "operator", "at": "2026-11-27T10:31:07Z" }
}
]
}offset is the acknowledgement: your system has stored every event up to and including it. If an operator’s reply stays unacknowledged for ten minutes, it gets the “Not delivered” mark in SupportHub. The mark goes away as soon as you acknowledge the reply.
- Request
/external/updateswith theoffsetof the last stored event andtimeout=25. Give the HTTP client a longer timeout, 35 seconds for example. - Store the events on your side in order. Drop repeats: check the event
idand the messageid. - Make the next request with
offsetset to theidof the last stored event. Keep thatoffsetin your database so that after a restart you carry on from the same place.
What comes in the feed
The feed carries only what originated in SupportHub and is meant for the customer. Your own calls don’t come back as an echo. Notes, assignments, tags, working statuses and scheduled replies that haven’t gone out yet stay out of the feed. Events keep their order within a ticket. An event may come more than once.
message.created: a new message for the customer.datahasid,ticket_ext_id,author,author_name,text,media,created_at.message.edited: a message was edited.datahasid,ticket_ext_id,text,media,edited_at.message.deleted: a message was deleted.datahasid,ticket_ext_id,deleted_at.ticket.closed: the ticket was closed.datahasticket_ext_id,by(operator,assistantorsystem),at.ticket.reopened: the ticket was reopened.datahasticket_ext_id,by(operatororsystem),at. Always accept it.
authorisoperator,systemorassistant.systemis a service line of the project for the customer: the ticket was taken, transferred, closed. Show it as a neutral line. It has anidof its own and is never edited or deleted.assistantis reserved for the project’s AI assistant. Its replies will appear in the feed later, without a new contract version, so handle the value now.textis Markdown: bold, italics, strikethrough, code, code blocks, lists, quotes, links. The text has no HTML.medialists the message’s files:id,url,mime_type,original_name,size,width,height.- Skip
message.editedandmessage.deletedfor a message you have never received.
Errors and your outbox
The section’s errors come in the common envelope {"error_code", "error_message", "detail", "request_id"}, and so does a body that fails validation: 422 with VALIDATION_ERROR. Decide by error_code, not by the HTTP status.
Send your calls through an outbox on your side. We recommend these rules for it:
- Network errors,
5xx,429: retry with a growing pause and keep the order of calls within a ticket. After a429, wait at least as long asRetry-Aftersays. 401: the key was revoked. Stop syncing and tell your admin.404 TICKET_NOT_FOUNDon a message, close, reopen or rating: SupportHub has no such ticket, either not created yet or deleted by an operator. Repeat thePUTand the public history withhistory: true, then the call itself. This repeat is safe.403 TICKET_LIMIT_REACHED: the plan’s monthly ticket limit is used up. It happens only on creation. Retry once an hour and tell your admin.403 CONTACT_BLOCKED: the customer is blocked in the project. Stop sending for this ticket and show it to your staff.403 PLAN_FEATURE_UNAVAILABLE: the API channel is switched off on the platform. Don’t retry, don’t drop the call, tell your admin.413 MEDIA_TOO_LARGE,422 VALIDATION_ERROR: don’t retry, tell your admin.- Other
4xx: don’t retry, don’t drop, tell your admin.
ticket.closed with by: "operator" comes to the feed. The next call for that ticket answers 404 TICKET_NOT_FOUND. Create the ticket again with PUT, send its public history with history: true and repeat the call. This way the customer’s next message brings the ticket back.Switching on and off
- Switching on. Move your open tickets in. For each one call
PUTwithhistory: true, then send its public history as messages withhistory: true, in order and with theircreated_at. - Switching off. Close the open tickets with
closeandby: "system", or they stay open in the operators’ inbox. The customer won’t see it in your system: SupportHub doesn’t echo your own calls.
{
"id": "88702",
"author": "staff",
"author_name": "Olga",
"text": "We will check and get back to you.",
"created_at": "2026-11-20T09:02:11Z",
"history": true
}ticket.assigned), typing indicator, read receipts or reactions. Edits of the customer’s messages aren’t passed on yet either.
