REST API v1 · Developers · API reference

Tickets API reference

All 4 Tickets endpoints of the BotGG REST API v1: scopes, parameters, fields, errors and ready-to-run curl, JavaScript and Python examples.

Developer docs
On this page

Endpoints

Paths are relative to https://console.botgg.app/api/v1. Send your API key as Authorization: Bearer botgg_…; IDs are strings.

Tickets endpoints
EndpointScopeDescription
GET/guilds/{guildId}/ticketstickets:readList tickets
GET/guilds/{guildId}/tickets/{ticketNo}tickets:readGet a ticket
GET/guilds/{guildId}/tickets/{ticketNo}/transcripttickets:readGet a closed ticket’s transcript
POST/guilds/{guildId}/tickets/{ticketNo}/closetickets:writeClose a ticket

Besides its own errors below, every endpoint can return these common ones:

List tickets

GET/guilds/{guildId}/tickets

Scope: tickets:read

Newest first. status=active = open + pending. Pass before=<nextCursor> for the next page.

Needs this feature enabled on the server: Tickets

Parameters
NameInTypeRequiredDescription
guildIdpathstringYesYour server’s ID · Discord ID (string)
statusquerystringNoOne of open, pending, closed, active
panelIdqueryintegerNoat least 1
userIdquerystringNoOnly tickets opened by this user
Discord ID (string)
limitqueryintegerNo1–100 · Default 25
beforequeryintegerNo1–999,999,999

Response

Response fields · 200
FieldTypeRequiredDescription
itemsarray of objectYes
items[].ticketNointegerYes
items[].statusstringYesOne of open, pending, closed
items[].userIdstringYesThe opener
items[].panelIdinteger | nullYes
items[].subjectstring | nullYes
items[].sourcestring | nullYesOne of panel, command, context_menu, dashboard
items[].isThreadbooleanYes
items[].channelIdstring | nullYes
items[].claimedBystring | nullYes
items[].openedAtstring | nullYesISO 8601 date-time
items[].lastMessageAtstring | nullYesISO 8601 date-time
items[].closedAtstring | nullYesISO 8601 date-time
items[].closedBystring | nullYesnull = closed by the bot (autoclose, API, …)
items[].closeReasonstring | nullYes
items[].closeTypestring | nullYesOne of manual, autoclose, user_leave, request, channel_deleted, thread_archived
items[].messageCountobjectYes
items[].messageCount.userintegerYes
items[].messageCount.staffintegerYes
items[].ratinginteger | nullYes
items[].hasTranscriptbooleanYes
nextCursorstring | nullYes
Response · 200
{
  "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"
}

Examples

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/tickets?limit=25" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// 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);
Python (requests)
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)

Errors

Get a ticket

GET/guilds/{guildId}/tickets/{ticketNo}

Scope: tickets:read

Includes the form answers, added members and a pending close request.

Needs this feature enabled on the server: Tickets

Parameters
NameInTypeRequiredDescription
guildIdpathstringYesYour server’s ID · Discord ID (string)
ticketNopathstringYes

Response

Response fields · 200
FieldTypeRequiredDescription
ticketNointegerYes
statusstringYesOne of open, pending, closed
userIdstringYesThe opener
panelIdinteger | nullYes
subjectstring | nullYes
sourcestring | nullYesOne of panel, command, context_menu, dashboard
isThreadbooleanYes
channelIdstring | nullYes
claimedBystring | nullYes
openedAtstring | nullYesISO 8601 date-time
lastMessageAtstring | nullYesISO 8601 date-time
closedAtstring | nullYesISO 8601 date-time
closedBystring | nullYesnull = closed by the bot (autoclose, API, …)
closeReasonstring | nullYes
closeTypestring | nullYesOne of manual, autoclose, user_leave, request, channel_deleted, thread_archived
messageCountobjectYes
messageCount.userintegerYes
messageCount.staffintegerYes
ratinginteger | nullYes
hasTranscriptbooleanYes
panelTitlestring | nullYes
firstResponseAtstring | nullYesISO 8601 date-time
firstResponseBystring | nullYes
answersarray of objectYesForm answers given when opening
answers[].fieldIdstring | nullYes
answers[].labelstringYes
answers[].valuestringYes
membersarray of objectYesUsers / roles added to the ticket
members[].targetIdstringYes
members[].typestringYesOne of user, role
closeRequestobject | nullYes
closeRequest.reasonstring | nullYes
closeRequest.closeAtstring | nullYesISO 8601 date-time
closeRequest.viaApibooleanYes
Response · 200
{
  "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
  }
}

Examples

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// 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);
Python (requests)
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)

Errors

Get a closed ticket’s transcript

GET/guilds/{guildId}/tickets/{ticketNo}/transcript

Scope: tickets:read

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.

Needs this feature enabled on the server: Tickets

Parameters
NameInTypeRequiredDescription
guildIdpathstringYesYour server’s ID · Discord ID (string)
ticketNopathstringYes
limitqueryintegerNo1–500 · Default 100
afterquerystringNoA message id from nextCursor
Discord ID (string)

Response

Response fields · 200
FieldTypeRequiredDescription
ticketNointegerYes
generatedAtstring | nullYesISO 8601 date-time
messageContentbooleanYesfalse: the bot ran without the Message Content intent, so other users’ text may be empty
totalMessagesintegerYes
usersobjectYes
messagesarray of objectYes
messages[].idstringYes
messages[].authorIdstring | nullYes
messages[].contentstringYes
messages[].createdAtstringYesISO 8601 date-time
messages[].editedAtstring | nullYesISO 8601 date-time
messages[].systembooleanYes
messages[].replyTostring | nullYes
messages[].embedsarray of objectYes
messages[].embeds[].titlestring | nullYes
messages[].embeds[].descriptionstring | nullYes
messages[].embeds[].fieldsarray of objectYes
messages[].embeds[].fields[].namestringYes
messages[].embeds[].fields[].valuestringYes
messages[].attachmentsarray of objectYes
messages[].attachments[].namestringYes
messages[].attachments[].sizeintegerYes
messages[].attachments[].contentTypestring | nullYes
messages[].stickersarray of stringYes
nextCursorstring | nullYesPass as after for the next page
Response · 200
{
  "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"
}

Examples

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/tickets/234567890123456789/transcript?limit=100" \
  -H "Authorization: Bearer $BOTGG_API_KEY"
JavaScript (fetch)
// 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);
Python (requests)
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)

Errors

Close a ticket

POST/guilds/{guildId}/tickets/{ticketNo}/close

Scope: tickets:writeIdempotency-Key

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.

Needs this feature enabled on the server: Tickets

Parameters
NameInTypeRequiredDescription
guildIdpathstringYesYour server’s ID · Discord ID (string)
ticketNopathstringYes
Idempotency-KeyheaderstringNoOptional. Send a unique value (a UUID) and reuse it when you retry: the change happens only once. How it works

Request body

Request body
FieldTypeRequiredDescription
reasonstring | nullNoShown in the close log and the opener’s DM
up to 500 characters

Response

Response fields · 202
FieldTypeRequiredDescription
ticketNointegerYes
status"closing"Yes
reasonstring | nullYes
requestedAtstringYesISO 8601 date-time
Response · 202
{
  "ticketNo": 10,
  "status": "closing",
  "reason": "Tournament prize",
  "requestedAt": "2026-10-07T12:00:00.000Z"
}

Examples

curl
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"}'
JavaScript (fetch)
// 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);
Python (requests)
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)

Errors

Ready to level up your server?

Add BotGG for free, then switch features on in the web console.