REST API v1 · Разработчикам · Справочник API

Справочник API: Апелляции на бан

Все 4 эндпоинта раздела «Апелляции на бан» в REST API BotGG v1: права, параметры, поля, ошибки и готовые примеры на curl, JavaScript и Python.

Документация для разработчиков
На этой странице

Эндпоинты

Пути указаны относительно https://console.botgg.app/api/v1. Передавайте API-ключ в заголовке Authorization: Bearer botgg_…; ID — строки.

Эндпоинты: Апелляции на бан
ЭндпоинтПравоОписание
GET/guilds/{guildId}/appealsappeals:readList ban appeals
GET/guilds/{guildId}/appeals/{number}appeals:readGet a ban appeal
POST/guilds/{guildId}/appeals/{number}/approveappeals:writeApprove a ban appeal (unban)
POST/guilds/{guildId}/appeals/{number}/rejectappeals:writeReject a ban appeal

Кроме собственных ошибок (см. ниже), любой эндпоинт может вернуть эти общие:

List ban appeals

GET/guilds/{guildId}/appeals

Право: appeals:read

Newest first. status=open (default) = open + waiting for the user’s answer; all = every status. Pass before=<nextCursor> for the next page.

На сервере должен быть включён модуль: Апелляции на бан

Параметры
ИмяГдеТипОбязательноеОписание
guildIdпутьstringДаID вашего сервера · Discord ID (строка)
statusquerystringНетОдно из open, question, approved, rejected, closed, all · По умолчанию "open"
userIdquerystringНетOnly this user’s appeals
Discord ID (строка)
limitqueryintegerНет1–100 · По умолчанию 25
beforequeryintegerНет1–999 999 999

Ответ

Поля ответа · 200
ПолеТипОбязательноеОписание
itemsarray of objectДа
items[].numberintegerДа
items[].userIdstringДа
items[].userTagstring | nullДа
items[].statusstringДаОдно из open, question, approved, rejected, closed
items[].banCaseNumberinteger | nullДа
items[].claimedBystring | nullДа
items[].decidedBystring | nullДаnull = system / API
items[].decidedAtstring | nullДаISO 8601 date-time
items[].reasonstring | nullДа
items[].createdAtstring | nullДаISO 8601 date-time
items[].lastActivityAtstring | nullДаISO 8601 date-time
nextCursorstring | nullДа
Ответ · 200
{
  "items": [
    {
      "number": 7,
      "userId": "876543210987654321",
      "userTag": "example",
      "status": "open",
      "banCaseNumber": 10,
      "claimedBy": "example",
      "decidedBy": "example",
      "decidedAt": "2026-10-07T12:00:00.000Z",
      "reason": "Tournament prize",
      "createdAt": "2026-10-07T12:00:00.000Z",
      "lastActivityAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "nextCursor": "98700"
}

Примеры

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals?status=open&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/appeals?status=open&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/appeals",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    params={
        "status": "open",
        "limit": 25,
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Ошибки

Ошибки
HTTPКоды
409FEATURE_DISABLED
503SERVICE_UNAVAILABLE

Get a ban appeal

GET/guilds/{guildId}/appeals/{number}

Право: appeals:read

With the answers, the ban reason and the conversation the appellant sees. Internal staff notes are never returned.

На сервере должен быть включён модуль: Апелляции на бан

Параметры
ИмяГдеТипОбязательноеОписание
guildIdпутьstringДаID вашего сервера · Discord ID (строка)
numberпутьstringДа

Ответ

Поля ответа · 200
ПолеТипОбязательноеОписание
numberintegerДа
userIdstringДа
userTagstring | nullДа
statusstringДаОдно из open, question, approved, rejected, closed
banCaseNumberinteger | nullДа
claimedBystring | nullДа
decidedBystring | nullДаnull = system / API
decidedAtstring | nullДаISO 8601 date-time
reasonstring | nullДа
createdAtstring | nullДаISO 8601 date-time
lastActivityAtstring | nullДаISO 8601 date-time
banReasonstring | nullДа
answersarray of objectДа
answers[].idstringДа
answers[].typestringДа
answers[].labelstringДа
answers[].valueanyДа
messagesarray of objectДаThe conversation the appellant sees (staff questions + replies). Internal notes are never included.
messages[].authorstringДаОдно из user, staff
messages[].authorIdstring | nullДа
messages[].textstringДа
messages[].createdAtstring | nullДаISO 8601 date-time
applyingbooleanДаA console/API decision is still being applied in Discord
failedActionobject | nullДа
failedAction.typestringДа
failedAction.errorstring | nullДа
Ответ · 200
{
  "number": 7,
  "userId": "876543210987654321",
  "userTag": "example",
  "status": "open",
  "banCaseNumber": 10,
  "claimedBy": "example",
  "decidedBy": "example",
  "decidedAt": "2026-10-07T12:00:00.000Z",
  "reason": "Tournament prize",
  "createdAt": "2026-10-07T12:00:00.000Z",
  "lastActivityAt": "2026-10-07T12:00:00.000Z",
  "banReason": "example",
  "answers": [
    {
      "id": "example",
      "type": "example",
      "label": "Example",
      "value": null
    }
  ],
  "messages": [
    {
      "author": "user",
      "authorId": "234567890123456789",
      "text": "Example answer",
      "createdAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "applying": true,
  "failedAction": {
    "type": "example",
    "error": "example"
  }
}

Примеры

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals/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/appeals/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/appeals/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)

Ошибки

Approve a ban appeal (unban)

POST/guilds/{guildId}/appeals/{number}/approve

Право: appeals:writeЧувствительноеIdempotency-Key

Same as Approve in the console: the bot unbans within a few seconds (an unban moderation case when Moderation is enabled), creates a single-use invite and DMs the user per the appeal settings. Written to the audit log.

На сервере должен быть включён модуль: Апелляции на бан

Параметры
ИмяГдеТипОбязательноеОписание
guildIdпутьstringДаID вашего сервера · Discord ID (строка)
numberпутьstringДа
Idempotency-KeyзаголовокstringНетНеобязательно. Передайте уникальное значение (UUID) и повторяйте его при ретраях — операция выполнится один раз. Как это работает

Тело запроса

Тело запроса
ПолеТипОбязательноеОписание
reasonstring | nullНетSent to the appellant (DM / appeal page)
до 1 000 символов

Ответ

Поля ответа · 202
ПолеТипОбязательноеОписание
numberintegerДа
userIdstringДа
userTagstring | nullДа
statusstringДаОдно из open, question, approved, rejected, closed
banCaseNumberinteger | nullДа
claimedBystring | nullДа
decidedBystring | nullДаnull = system / API
decidedAtstring | nullДаISO 8601 date-time
reasonstring | nullДа
createdAtstring | nullДаISO 8601 date-time
lastActivityAtstring | nullДаISO 8601 date-time
banReasonstring | nullДа
answersarray of objectДа
answers[].idstringДа
answers[].typestringДа
answers[].labelstringДа
answers[].valueanyДа
messagesarray of objectДаThe conversation the appellant sees (staff questions + replies). Internal notes are never included.
messages[].authorstringДаОдно из user, staff
messages[].authorIdstring | nullДа
messages[].textstringДа
messages[].createdAtstring | nullДаISO 8601 date-time
applyingbooleanДаA console/API decision is still being applied in Discord
failedActionobject | nullДа
failedAction.typestringДа
failedAction.errorstring | nullДа
Ответ · 202
{
  "number": 7,
  "userId": "876543210987654321",
  "userTag": "example",
  "status": "open",
  "banCaseNumber": 10,
  "claimedBy": "example",
  "decidedBy": "example",
  "decidedAt": "2026-10-07T12:00:00.000Z",
  "reason": "Tournament prize",
  "createdAt": "2026-10-07T12:00:00.000Z",
  "lastActivityAt": "2026-10-07T12:00:00.000Z",
  "banReason": "example",
  "answers": [
    {
      "id": "example",
      "type": "example",
      "label": "Example",
      "value": null
    }
  ],
  "messages": [
    {
      "author": "user",
      "authorId": "234567890123456789",
      "text": "Example answer",
      "createdAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "applying": true,
  "failedAction": {
    "type": "example",
    "error": "example"
  }
}

Примеры

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals/234567890123456789/approve" \
  -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/appeals/234567890123456789/approve', {
  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/appeals/234567890123456789/approve",
    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)

Ошибки

Reject a ban appeal

POST/guilds/{guildId}/appeals/{number}/reject

Право: appeals:writeЧувствительноеIdempotency-Key

Same as Reject in the console: the user gets the rejection DM per the appeal settings and the re-appeal cooldown starts. Written to the audit log.

На сервере должен быть включён модуль: Апелляции на бан

Параметры
ИмяГдеТипОбязательноеОписание
guildIdпутьstringДаID вашего сервера · Discord ID (строка)
numberпутьstringДа
Idempotency-KeyзаголовокstringНетНеобязательно. Передайте уникальное значение (UUID) и повторяйте его при ретраях — операция выполнится один раз. Как это работает

Тело запроса

Тело запроса
ПолеТипОбязательноеОписание
reasonstring | nullНетSent to the appellant (DM / appeal page)
до 1 000 символов

Ответ

Поля ответа · 202
ПолеТипОбязательноеОписание
numberintegerДа
userIdstringДа
userTagstring | nullДа
statusstringДаОдно из open, question, approved, rejected, closed
banCaseNumberinteger | nullДа
claimedBystring | nullДа
decidedBystring | nullДаnull = system / API
decidedAtstring | nullДаISO 8601 date-time
reasonstring | nullДа
createdAtstring | nullДаISO 8601 date-time
lastActivityAtstring | nullДаISO 8601 date-time
banReasonstring | nullДа
answersarray of objectДа
answers[].idstringДа
answers[].typestringДа
answers[].labelstringДа
answers[].valueanyДа
messagesarray of objectДаThe conversation the appellant sees (staff questions + replies). Internal notes are never included.
messages[].authorstringДаОдно из user, staff
messages[].authorIdstring | nullДа
messages[].textstringДа
messages[].createdAtstring | nullДаISO 8601 date-time
applyingbooleanДаA console/API decision is still being applied in Discord
failedActionobject | nullДа
failedAction.typestringДа
failedAction.errorstring | nullДа
Ответ · 202
{
  "number": 7,
  "userId": "876543210987654321",
  "userTag": "example",
  "status": "open",
  "banCaseNumber": 10,
  "claimedBy": "example",
  "decidedBy": "example",
  "decidedAt": "2026-10-07T12:00:00.000Z",
  "reason": "Tournament prize",
  "createdAt": "2026-10-07T12:00:00.000Z",
  "lastActivityAt": "2026-10-07T12:00:00.000Z",
  "banReason": "example",
  "answers": [
    {
      "id": "example",
      "type": "example",
      "label": "Example",
      "value": null
    }
  ],
  "messages": [
    {
      "author": "user",
      "authorId": "234567890123456789",
      "text": "Example answer",
      "createdAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "applying": true,
  "failedAction": {
    "type": "example",
    "error": "example"
  }
}

Примеры

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/appeals/234567890123456789/reject" \
  -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/appeals/234567890123456789/reject', {
  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/appeals/234567890123456789/reject",
    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)

Ошибки

Готовы прокачать свой сервер?

Добавьте BotGG бесплатно и включайте нужные функции в веб-консоли.