REST API v1 · Entwickler · API-Referenz
Tickets-API-Referenz
Alle 4 Tickets-Endpunkte der BotGG-REST-API v1: Scopes, Parameter, Felder, Fehler und sofort ausführbare Beispiele in curl, JavaScript und Python.
Entwicklerdokumentation
Auf dieser Seite
Endpunkte
Pfade sind relativ zu https://console.botgg.app/api/v1. Sende deinen API-Schlüssel als Authorization: Bearer botgg_…; IDs sind Strings.
| Endpunkt | Scope | Beschreibung |
|---|---|---|
GET/guilds/{guildId}/tickets | tickets:read | List tickets |
GET/guilds/{guildId}/tickets/{ticketNo} | tickets:read | Get a ticket |
GET/guilds/{guildId}/tickets/{ticketNo}/transcript | tickets:read | Get a closed ticket’s transcript |
POST/guilds/{guildId}/tickets/{ticketNo}/close | tickets:write | Close a ticket |
Neben den unten genannten eigenen Fehlern kann jeder Endpunkt diese allgemeinen zurückgeben:
List tickets
GET/guilds/{guildId}/tickets
Newest first. status=active = open + pending. Pass before=<nextCursor> for the next page.
Dieses Feature muss auf dem Server aktiviert sein: Tickets
| Name | In | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
guildId | Pfad | string | Ja | Die ID deines Servers · Discord-ID (String) |
status | Query | string | Nein | Eines von open, pending, closed, active |
panelId | Query | integer | Nein | mindestens 1 |
userId | Query | string | Nein | Only tickets opened by this user Discord-ID (String) |
limit | Query | integer | Nein | 1–100 · Standard 25 |
before | Query | integer | Nein | 1–999.999.999 |
Antwort
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
items | array of object | Ja | |
items[].ticketNo | integer | Ja | |
items[].status | string | Ja | Eines von open, pending, closed |
items[].userId | string | Ja | The opener |
items[].panelId | integer | null | Ja | |
items[].subject | string | null | Ja | |
items[].source | string | null | Ja | Eines von panel, command, context_menu, dashboard, flow |
items[].isThread | boolean | Ja | |
items[].channelId | string | null | Ja | |
items[].claimedBy | string | null | Ja | |
items[].openedAt | string | null | Ja | ISO 8601 date-time |
items[].lastMessageAt | string | null | Ja | ISO 8601 date-time |
items[].closedAt | string | null | Ja | ISO 8601 date-time |
items[].closedBy | string | null | Ja | null = closed by the bot (autoclose, API, …) |
items[].closeReason | string | null | Ja | |
items[].closeType | string | null | Ja | Eines von manual, autoclose, user_leave, request, channel_deleted, thread_archived |
items[].messageCount | object | Ja | |
items[].messageCount.user | integer | Ja | |
items[].messageCount.staff | integer | Ja | |
items[].rating | integer | null | Ja | |
items[].hasTranscript | boolean | Ja | |
nextCursor | string | null | Ja |
{
"items": [
{
"ticketNo": 10,
"status": "open",
"userId": "876543210987654321",
"panelId": 98765,
"subject": "Help with my order",
"source": "panel",
"isThread": true,
"channelId": "234567890123456789",
"claimedBy": "example",
"openedAt": "2026-10-07T12:00:00.000Z",
"lastMessageAt": "2026-10-07T12:00:00.000Z",
"closedAt": "2026-10-07T12:00:00.000Z",
"closedBy": "example",
"closeReason": "example",
"closeType": "manual",
"messageCount": {
"user": 10,
"staff": 10
},
"rating": 10,
"hasTranscript": true
}
],
"nextCursor": "98700"
}Beispiele
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/tickets?limit=25" \
-H "Authorization: Bearer $BOTGG_API_KEY"// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/tickets?limit=25', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);import os
import requests
res = requests.get(
"https://console.botgg.app/api/v1/guilds/123456789012345678/tickets",
headers={
"Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
},
params={
"limit": 25,
},
timeout=10,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)Fehler
| HTTP | Codes |
|---|---|
| 409 | FEATURE_DISABLED |
| 503 | SERVICE_UNAVAILABLE |
Get a ticket
GET/guilds/{guildId}/tickets/{ticketNo}
Includes the form answers, added members and a pending close request.
Dieses Feature muss auf dem Server aktiviert sein: Tickets
| Name | In | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
guildId | Pfad | string | Ja | Die ID deines Servers · Discord-ID (String) |
ticketNo | Pfad | string | Ja |
Antwort
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
ticketNo | integer | Ja | |
status | string | Ja | Eines von open, pending, closed |
userId | string | Ja | The opener |
panelId | integer | null | Ja | |
subject | string | null | Ja | |
source | string | null | Ja | Eines von panel, command, context_menu, dashboard, flow |
isThread | boolean | Ja | |
channelId | string | null | Ja | |
claimedBy | string | null | Ja | |
openedAt | string | null | Ja | ISO 8601 date-time |
lastMessageAt | string | null | Ja | ISO 8601 date-time |
closedAt | string | null | Ja | ISO 8601 date-time |
closedBy | string | null | Ja | null = closed by the bot (autoclose, API, …) |
closeReason | string | null | Ja | |
closeType | string | null | Ja | Eines von manual, autoclose, user_leave, request, channel_deleted, thread_archived |
messageCount | object | Ja | |
messageCount.user | integer | Ja | |
messageCount.staff | integer | Ja | |
rating | integer | null | Ja | |
hasTranscript | boolean | Ja | |
panelTitle | string | null | Ja | |
firstResponseAt | string | null | Ja | ISO 8601 date-time |
firstResponseBy | string | null | Ja | |
answers | array of object | Ja | Form answers given when opening |
answers[].fieldId | string | null | Ja | |
answers[].label | string | Ja | |
answers[].value | string | Ja | |
members | array of object | Ja | Users / roles added to the ticket |
members[].targetId | string | Ja | |
members[].type | string | Ja | Eines von user, role |
closeRequest | object | null | Ja | |
closeRequest.reason | string | null | Ja | |
closeRequest.closeAt | string | null | Ja | ISO 8601 date-time |
closeRequest.viaApi | boolean | Ja |
{
"ticketNo": 10,
"status": "open",
"userId": "876543210987654321",
"panelId": 98765,
"subject": "Help with my order",
"source": "panel",
"isThread": true,
"channelId": "234567890123456789",
"claimedBy": "example",
"openedAt": "2026-10-07T12:00:00.000Z",
"lastMessageAt": "2026-10-07T12:00:00.000Z",
"closedAt": "2026-10-07T12:00:00.000Z",
"closedBy": "example",
"closeReason": "example",
"closeType": "manual",
"messageCount": {
"user": 10,
"staff": 10
},
"rating": 10,
"hasTranscript": true,
"panelTitle": "example",
"firstResponseAt": "2026-10-07T12:00:00.000Z",
"firstResponseBy": "example",
"answers": [
{
"fieldId": "234567890123456789",
"label": "Example",
"value": "example"
}
],
"members": [
{
"targetId": "234567890123456789",
"type": "user"
}
],
"closeRequest": {
"reason": "Tournament prize",
"closeAt": "2026-10-07T12:00:00.000Z",
"viaApi": true
}
}Beispiele
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789" \
-H "Authorization: Bearer $BOTGG_API_KEY"// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);import os
import requests
res = requests.get(
"https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789",
headers={
"Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
},
timeout=10,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)Fehler
| HTTP | Codes |
|---|---|
| 404 | TICKET_NOT_FOUND |
| 409 | FEATURE_DISABLED |
| 503 | SERVICE_UNAVAILABLE |
Get a closed ticket’s transcript
GET/guilds/{guildId}/tickets/{ticketNo}/transcript
The messages saved when the ticket was closed, oldest first, as text: no avatars and no attachment links (only file name, size and type). Pass after=<nextCursor> for the next page. 404 TRANSCRIPT_NOT_FOUND for open tickets or when transcripts are off.
Dieses Feature muss auf dem Server aktiviert sein: Tickets
| Name | In | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
guildId | Pfad | string | Ja | Die ID deines Servers · Discord-ID (String) |
ticketNo | Pfad | string | Ja | |
limit | Query | integer | Nein | 1–500 · Standard 100 |
after | Query | string | Nein | A message id from nextCursorDiscord-ID (String) |
Antwort
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
ticketNo | integer | Ja | |
generatedAt | string | null | Ja | ISO 8601 date-time |
messageContent | boolean | Ja | false: the bot ran without the Message Content intent, so other users’ text may be empty |
totalMessages | integer | Ja | |
users | object | Ja | |
messages | array of object | Ja | |
messages[].id | string | Ja | |
messages[].authorId | string | null | Ja | |
messages[].content | string | Ja | |
messages[].createdAt | string | Ja | ISO 8601 date-time |
messages[].editedAt | string | null | Ja | ISO 8601 date-time |
messages[].system | boolean | Ja | |
messages[].replyTo | string | null | Ja | |
messages[].embeds | array of object | Ja | |
messages[].embeds[].title | string | null | Ja | |
messages[].embeds[].description | string | null | Ja | |
messages[].embeds[].fields | array of object | Ja | |
messages[].embeds[].fields[].name | string | Ja | |
messages[].embeds[].fields[].value | string | Ja | |
messages[].attachments | array of object | Ja | |
messages[].attachments[].name | string | Ja | |
messages[].attachments[].size | integer | Ja | |
messages[].attachments[].contentType | string | null | Ja | |
messages[].stickers | array of string | Ja | |
nextCursor | string | null | Ja | Pass as after for the next page |
{
"ticketNo": 10,
"generatedAt": "2026-10-07T12:00:00.000Z",
"messageContent": true,
"totalMessages": 10,
"users": {},
"messages": [
{
"id": "example",
"authorId": "234567890123456789",
"content": "example",
"createdAt": "2026-10-07T12:00:00.000Z",
"editedAt": "2026-10-07T12:00:00.000Z",
"system": true,
"replyTo": "example",
"embeds": [
{
"title": "example",
"description": "example",
"fields": [
{}
]
}
],
"attachments": [
{
"name": "Example",
"size": 10,
"contentType": "example"
}
],
"stickers": [
"example"
]
}
],
"nextCursor": "98700"
}Beispiele
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789/transcript?limit=100" \
-H "Authorization: Bearer $BOTGG_API_KEY"// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789/transcript?limit=100', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);import os
import requests
res = requests.get(
"https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789/transcript",
headers={
"Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
},
params={
"limit": 100,
},
timeout=10,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)Fehler
| HTTP | Codes |
|---|---|
| 404 | TICKET_NOT_FOUND, TRANSCRIPT_NOT_FOUND |
| 409 | FEATURE_DISABLED |
| 503 | SERVICE_UNAVAILABLE |
Close a ticket
POST/guilds/{guildId}/tickets/{ticketNo}/close
The bot closes it within about a minute exactly like a staff close: transcript (if enabled for the panel), transcript-channel log, DM to the opener, channel deleted / thread archived. The reason is shown as "<reason> (via API: <key name>)". Written to the audit log.
Dieses Feature muss auf dem Server aktiviert sein: Tickets
| Name | In | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
guildId | Pfad | string | Ja | Die ID deines Servers · Discord-ID (String) |
ticketNo | Pfad | string | Ja | |
Idempotency-Key | Header | string | Nein | Optional. Sende einen eindeutigen Wert (eine UUID) und verwende ihn bei einem erneuten Versuch wieder: Die Änderung erfolgt nur einmal. So funktioniert’s |
Request-Body
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
reason | string | null | Nein | Shown in the close log and the opener’s DM bis zu 500 Zeichen |
Antwort
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
ticketNo | integer | Ja | |
status | "closing" | Ja | |
reason | string | null | Ja | |
requestedAt | string | Ja | ISO 8601 date-time |
{
"ticketNo": 10,
"status": "closing",
"reason": "Tournament prize",
"requestedAt": "2026-10-07T12:00:00.000Z"
}Beispiele
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789/close" \
-H "Authorization: Bearer $BOTGG_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"reason":"Tournament prize"}'// Node.js 18+ (built-in fetch) — on your server, never in a browser
const res = await fetch('https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789/close', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.BOTGG_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID(), // reuse it when you retry this request
},
body: JSON.stringify({
reason: 'Tournament prize',
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${data.error}: ${data.message}`);
console.log(data);import os, uuid
import requests
res = requests.post(
"https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789/close",
headers={
"Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()), # reuse it when you retry this request
},
json={
"reason": "Tournament prize",
},
timeout=10,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)Fehler
| HTTP | Codes |
|---|---|
| 400 | INVALID_JSON |
| 404 | TICKET_NOT_FOUND |
| 409 | FEATURE_DISABLED, TICKET_CLOSED |
| 413 | PAYLOAD_TOO_LARGE |
| 415 | UNSUPPORTED_MEDIA_TYPE |
| 422 | IDEMPOTENCY_KEY_REUSED |
| 503 | SERVICE_UNAVAILABLE |