REST API v1 · Entwickler · API-Referenz

Moderation-API-Referenz

Alle 9 Moderation-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.

Moderation-Endpunkte
EndpunktScopeBeschreibung
GET/guilds/{guildId}/moderation/casesmoderation:readList moderation cases
GET/guilds/{guildId}/moderation/cases/{number}moderation:readGet a moderation case
POST/guilds/{guildId}/moderation/users/{userId}/warnmoderation:writeWarn a member
POST/guilds/{guildId}/moderation/users/{userId}/timeoutmoderation:writeTime out a member
POST/guilds/{guildId}/moderation/users/{userId}/untimeoutmoderation:writeRemove a member’s timeout
POST/guilds/{guildId}/moderation/users/{userId}/kickmoderation:writeKick a member
POST/guilds/{guildId}/moderation/users/{userId}/banmoderation:writeBan a user
POST/guilds/{guildId}/moderation/users/{userId}/unbanmoderation:writeUnban a user
GET/guilds/{guildId}/moderation/actions/{actionId}moderation:writeGet the result of a moderation action

Neben den unten genannten eigenen Fehlern kann jeder Endpunkt diese allgemeinen zurückgeben:

List moderation cases

GET/guilds/{guildId}/moderation/cases

Scope: moderation:readSensibel

Newest first (deleted cases are left out). Pass before=<nextCursor> for the next page.

Dieses Feature muss auf dem Server aktiviert sein: Moderation

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
actionQuerystringNeinEines von warn, timeout, untimeout, kick, ban, tempban, softban, unban, note, purge
sourceQuerystringNeinEines von command, automod, escalation, antiraid, antinuke, console, api, flow
userIdQuerystringNeinOnly cases against this user
Discord-ID (String)
moderatorIdQuerystringNeinDiscord-ID (String)
activeQuerystringNein1 = only running warnings / timeouts / tempbans
Eines von 1, 0, true, false
limitQueryintegerNein1–100 · Standard 25
beforeQueryintegerNein1–999.999.999

Antwort

Antwortfelder · 200
FeldTypErforderlichBeschreibung
itemsarray of objectJa
items[].numberintegerJa
items[].actionstringJaEines von warn, timeout, untimeout, kick, ban, tempban, softban, unban, note, purge
items[].userIdstringJaThe target
items[].userTagstring | nullJa
items[].moderatorIdstringJa
items[].reasonstring | nullJa
items[].durationSecondsinteger | nullJa
items[].evidencearray of stringJa
items[].sourcestringJaEines von command, automod, escalation, antiraid, antinuke, console, api, flow
items[].activebooleanJa
items[].expiresAtstring | nullJaISO 8601 date-time
items[].resolvedAtstring | nullJaISO 8601 date-time
items[].dmStatusstring | nullJaEines von sent, failed, off
items[].apiKeyobject | nullJaSet when the action was made with an API key
items[].apiKey.idinteger | nullJa
items[].apiKey.namestring | nullJa
items[].createdAtstring | nullJaISO 8601 date-time
nextCursorstring | nullJa
Antwort · 200
{
  "items": [
    {
      "number": 7,
      "action": "warn",
      "userId": "876543210987654321",
      "userTag": "example",
      "moderatorId": "234567890123456789",
      "reason": "Tournament prize",
      "durationSeconds": 3600,
      "evidence": [
        "example"
      ],
      "source": "command",
      "active": true,
      "expiresAt": "2026-10-07T12:00:00.000Z",
      "resolvedAt": "2026-10-07T12:00:00.000Z",
      "dmStatus": "sent",
      "apiKey": {
        "id": 98765,
        "name": "Example"
      },
      "createdAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "nextCursor": "98700"
}

Beispiele

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/moderation/cases?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/moderation/cases?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/moderation/cases",
    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

Get a moderation case

GET/guilds/{guildId}/moderation/cases/{number}

Scope: moderation:readSensibel

With its timeline (created, reason / evidence edits, DM, expired, revoked, escalated).

Dieses Feature muss auf dem Server aktiviert sein: Moderation

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
numberPfadstringJa

Antwort

Antwortfelder · 200
FeldTypErforderlichBeschreibung
numberintegerJa
actionstringJaEines von warn, timeout, untimeout, kick, ban, tempban, softban, unban, note, purge
userIdstringJaThe target
userTagstring | nullJa
moderatorIdstringJa
reasonstring | nullJa
durationSecondsinteger | nullJa
evidencearray of stringJa
sourcestringJaEines von command, automod, escalation, antiraid, antinuke, console, api, flow
activebooleanJa
expiresAtstring | nullJaISO 8601 date-time
resolvedAtstring | nullJaISO 8601 date-time
dmStatusstring | nullJaEines von sent, failed, off
apiKeyobject | nullJaSet when the action was made with an API key
apiKey.idinteger | nullJa
apiKey.namestring | nullJa
createdAtstring | nullJaISO 8601 date-time
eventsarray of objectJa
events[].typestringJa
events[].actorIdstring | nullJa
events[].dataanyJa
events[].createdAtstring | nullJaISO 8601 date-time
Antwort · 200
{
  "number": 7,
  "action": "warn",
  "userId": "876543210987654321",
  "userTag": "example",
  "moderatorId": "234567890123456789",
  "reason": "Tournament prize",
  "durationSeconds": 3600,
  "evidence": [
    "example"
  ],
  "source": "command",
  "active": true,
  "expiresAt": "2026-10-07T12:00:00.000Z",
  "resolvedAt": "2026-10-07T12:00:00.000Z",
  "dmStatus": "sent",
  "apiKey": {
    "id": 98765,
    "name": "Example"
  },
  "createdAt": "2026-10-07T12:00:00.000Z",
  "events": [
    {
      "type": "example",
      "actorId": "234567890123456789",
      "data": null,
      "createdAt": "2026-10-07T12:00:00.000Z"
    }
  ]
}

Beispiele

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

Warn a member

POST/guilds/{guildId}/moderation/users/{userId}/warn

Scope: moderation:writeSensibelIdempotency-Key

Same as /warn: a warning case (counts toward escalation), DM per the Moderation settings. Acts in the name of the key’s creator, who must still have the matching Discord permission; the target must be below their and the bot’s highest role (never the owner, the bot or the creator). The bot runs it within a few seconds — poll GET …/moderation/actions/{actionId}. At most 10 actions a minute per key. Written to the audit log.

Dieses Feature muss auf dem Server aktiviert sein: Moderation

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
userIdPfadstringJaDie Discord-Nutzer-ID des Mitglieds · Discord-ID (String)
Idempotency-KeyHeaderstringNeinOptional. Sende einen eindeutigen Wert (eine UUID) und verwende ihn bei einem erneuten Versuch wieder: Die Änderung erfolgt nur einmal. So funktioniert’s

Request-Body

Request-Body
FeldTypErforderlichBeschreibung
reasonstringJaRequired. Shown in the case, the mod log and the member’s DM
1–500 Zeichen
evidencearray of stringNeinUp to 5 links
bis zu 5 Elemente

Antwort

Antwortfelder · 202
FeldTypErforderlichBeschreibung
actionIdstringJa
actionstringJaEines von warn, timeout, untimeout, kick, ban, unban
userIdstringJa
statusstringJaEines von pending, running, done, failed
caseNumberinteger | nullJa
errorstring | nullJaRefusal code when failed (e.g. HIERARCHY_HIGHER, MODERATOR_MISSING_PERMISSION, NOT_BANNED, BOT_MISSING_PERMISSIONS)
requestedAtstring | nullJaISO 8601 date-time
Antwort · 202
{
  "actionId": "234567890123456789",
  "action": "warn",
  "userId": "876543210987654321",
  "status": "pending",
  "caseNumber": 10,
  "error": "example",
  "requestedAt": "2026-10-07T12:00:00.000Z"
}

Beispiele

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/moderation/users/876543210987654321/warn" \
  -H "Authorization: Bearer $BOTGG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"reason":"Tournament prize","evidence":["example"]}'
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/moderation/users/876543210987654321/warn', {
  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',
    evidence: [
      'example',
    ],
  }),
});
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/moderation/users/876543210987654321/warn",
    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",
        "evidence": [
            "example",
        ],
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Time out a member

POST/guilds/{guildId}/moderation/users/{userId}/timeout

Scope: moderation:writeSensibelIdempotency-Key

Same as /timeout: Discord timeout for durationSeconds, a case, DM per the settings. Acts in the name of the key’s creator, who must still have the matching Discord permission; the target must be below their and the bot’s highest role (never the owner, the bot or the creator). The bot runs it within a few seconds — poll GET …/moderation/actions/{actionId}. At most 10 actions a minute per key. Written to the audit log.

Dieses Feature muss auf dem Server aktiviert sein: Moderation

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
userIdPfadstringJaDie Discord-Nutzer-ID des Mitglieds · Discord-ID (String)
Idempotency-KeyHeaderstringNeinOptional. Sende einen eindeutigen Wert (eine UUID) und verwende ihn bei einem erneuten Versuch wieder: Die Änderung erfolgt nur einmal. So funktioniert’s

Request-Body

Request-Body
FeldTypErforderlichBeschreibung
reasonstringJaRequired. Shown in the case, the mod log and the member’s DM
1–500 Zeichen
durationSecondsintegerJa1 minute to 28 days
60–2.419.200
evidencearray of stringNeinUp to 5 links
bis zu 5 Elemente

Antwort

Antwortfelder · 202
FeldTypErforderlichBeschreibung
actionIdstringJa
actionstringJaEines von warn, timeout, untimeout, kick, ban, unban
userIdstringJa
statusstringJaEines von pending, running, done, failed
caseNumberinteger | nullJa
errorstring | nullJaRefusal code when failed (e.g. HIERARCHY_HIGHER, MODERATOR_MISSING_PERMISSION, NOT_BANNED, BOT_MISSING_PERMISSIONS)
requestedAtstring | nullJaISO 8601 date-time
Antwort · 202
{
  "actionId": "234567890123456789",
  "action": "warn",
  "userId": "876543210987654321",
  "status": "pending",
  "caseNumber": 10,
  "error": "example",
  "requestedAt": "2026-10-07T12:00:00.000Z"
}

Beispiele

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/moderation/users/876543210987654321/timeout" \
  -H "Authorization: Bearer $BOTGG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"reason":"Tournament prize","durationSeconds":3600,"evidence":["example"]}'
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/moderation/users/876543210987654321/timeout', {
  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',
    durationSeconds: 3600,
    evidence: [
      'example',
    ],
  }),
});
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/moderation/users/876543210987654321/timeout",
    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",
        "durationSeconds": 3600,
        "evidence": [
            "example",
        ],
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Remove a member’s timeout

POST/guilds/{guildId}/moderation/users/{userId}/untimeout

Scope: moderation:writeSensibelIdempotency-Key

Same as /untimeout. Acts in the name of the key’s creator, who must still have the matching Discord permission; the target must be below their and the bot’s highest role (never the owner, the bot or the creator). The bot runs it within a few seconds — poll GET …/moderation/actions/{actionId}. At most 10 actions a minute per key. Written to the audit log.

Dieses Feature muss auf dem Server aktiviert sein: Moderation

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
userIdPfadstringJaDie Discord-Nutzer-ID des Mitglieds · Discord-ID (String)
Idempotency-KeyHeaderstringNeinOptional. Sende einen eindeutigen Wert (eine UUID) und verwende ihn bei einem erneuten Versuch wieder: Die Änderung erfolgt nur einmal. So funktioniert’s

Request-Body

Request-Body
FeldTypErforderlichBeschreibung
reasonstringJaRequired. Shown in the case, the mod log and the member’s DM
1–500 Zeichen

Antwort

Antwortfelder · 202
FeldTypErforderlichBeschreibung
actionIdstringJa
actionstringJaEines von warn, timeout, untimeout, kick, ban, unban
userIdstringJa
statusstringJaEines von pending, running, done, failed
caseNumberinteger | nullJa
errorstring | nullJaRefusal code when failed (e.g. HIERARCHY_HIGHER, MODERATOR_MISSING_PERMISSION, NOT_BANNED, BOT_MISSING_PERMISSIONS)
requestedAtstring | nullJaISO 8601 date-time
Antwort · 202
{
  "actionId": "234567890123456789",
  "action": "warn",
  "userId": "876543210987654321",
  "status": "pending",
  "caseNumber": 10,
  "error": "example",
  "requestedAt": "2026-10-07T12:00:00.000Z"
}

Beispiele

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/moderation/users/876543210987654321/untimeout" \
  -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/moderation/users/876543210987654321/untimeout', {
  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/moderation/users/876543210987654321/untimeout",
    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

Kick a member

POST/guilds/{guildId}/moderation/users/{userId}/kick

Scope: moderation:writeSensibelIdempotency-Key

Same as /kick: DM (before the kick) per the settings, then the kick and a case. Acts in the name of the key’s creator, who must still have the matching Discord permission; the target must be below their and the bot’s highest role (never the owner, the bot or the creator). The bot runs it within a few seconds — poll GET …/moderation/actions/{actionId}. At most 10 actions a minute per key. Written to the audit log.

Dieses Feature muss auf dem Server aktiviert sein: Moderation

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
userIdPfadstringJaDie Discord-Nutzer-ID des Mitglieds · Discord-ID (String)
Idempotency-KeyHeaderstringNeinOptional. Sende einen eindeutigen Wert (eine UUID) und verwende ihn bei einem erneuten Versuch wieder: Die Änderung erfolgt nur einmal. So funktioniert’s

Request-Body

Request-Body
FeldTypErforderlichBeschreibung
reasonstringJaRequired. Shown in the case, the mod log and the member’s DM
1–500 Zeichen
evidencearray of stringNeinUp to 5 links
bis zu 5 Elemente

Antwort

Antwortfelder · 202
FeldTypErforderlichBeschreibung
actionIdstringJa
actionstringJaEines von warn, timeout, untimeout, kick, ban, unban
userIdstringJa
statusstringJaEines von pending, running, done, failed
caseNumberinteger | nullJa
errorstring | nullJaRefusal code when failed (e.g. HIERARCHY_HIGHER, MODERATOR_MISSING_PERMISSION, NOT_BANNED, BOT_MISSING_PERMISSIONS)
requestedAtstring | nullJaISO 8601 date-time
Antwort · 202
{
  "actionId": "234567890123456789",
  "action": "warn",
  "userId": "876543210987654321",
  "status": "pending",
  "caseNumber": 10,
  "error": "example",
  "requestedAt": "2026-10-07T12:00:00.000Z"
}

Beispiele

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/moderation/users/876543210987654321/kick" \
  -H "Authorization: Bearer $BOTGG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"reason":"Tournament prize","evidence":["example"]}'
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/moderation/users/876543210987654321/kick', {
  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',
    evidence: [
      'example',
    ],
  }),
});
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/moderation/users/876543210987654321/kick",
    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",
        "evidence": [
            "example",
        ],
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Ban a user

POST/guilds/{guildId}/moderation/users/{userId}/ban

Scope: moderation:writeSensibelIdempotency-Key

Same as /ban: with durationSeconds a temporary ban the bot lifts automatically; deleteMessageSeconds deletes recent messages. Works for users who already left. Acts in the name of the key’s creator, who must still have the matching Discord permission; the target must be below their and the bot’s highest role (never the owner, the bot or the creator). The bot runs it within a few seconds — poll GET …/moderation/actions/{actionId}. At most 10 actions a minute per key. Written to the audit log.

Dieses Feature muss auf dem Server aktiviert sein: Moderation

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
userIdPfadstringJaDie Discord-Nutzer-ID des Mitglieds · Discord-ID (String)
Idempotency-KeyHeaderstringNeinOptional. Sende einen eindeutigen Wert (eine UUID) und verwende ihn bei einem erneuten Versuch wieder: Die Änderung erfolgt nur einmal. So funktioniert’s

Request-Body

Request-Body
FeldTypErforderlichBeschreibung
reasonstringJaRequired. Shown in the case, the mod log and the member’s DM
1–500 Zeichen
deleteMessageSecondsintegerNeinDelete the user’s messages of the last N seconds (≤ 7 days)
0–604.800
durationSecondsinteger | nullNeinTemporary ban (≤ 365 days); omit for a permanent ban
60–31.536.000
evidencearray of stringNeinUp to 5 links
bis zu 5 Elemente

Antwort

Antwortfelder · 202
FeldTypErforderlichBeschreibung
actionIdstringJa
actionstringJaEines von warn, timeout, untimeout, kick, ban, unban
userIdstringJa
statusstringJaEines von pending, running, done, failed
caseNumberinteger | nullJa
errorstring | nullJaRefusal code when failed (e.g. HIERARCHY_HIGHER, MODERATOR_MISSING_PERMISSION, NOT_BANNED, BOT_MISSING_PERMISSIONS)
requestedAtstring | nullJaISO 8601 date-time
Antwort · 202
{
  "actionId": "234567890123456789",
  "action": "warn",
  "userId": "876543210987654321",
  "status": "pending",
  "caseNumber": 10,
  "error": "example",
  "requestedAt": "2026-10-07T12:00:00.000Z"
}

Beispiele

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/moderation/users/876543210987654321/ban" \
  -H "Authorization: Bearer $BOTGG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"reason":"Tournament prize","deleteMessageSeconds":3600,"durationSeconds":3600,"evidence":["example"]}'
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/moderation/users/876543210987654321/ban', {
  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',
    deleteMessageSeconds: 3600,
    durationSeconds: 3600,
    evidence: [
      'example',
    ],
  }),
});
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/moderation/users/876543210987654321/ban",
    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",
        "deleteMessageSeconds": 3600,
        "durationSeconds": 3600,
        "evidence": [
            "example",
        ],
    },
    timeout=10,
)
data = res.json()
if not res.ok:
    raise RuntimeError(f"{res.status_code} {data['error']}: {data['message']}")
print(data)

Fehler

Unban a user

POST/guilds/{guildId}/moderation/users/{userId}/unban

Scope: moderation:writeSensibelIdempotency-Key

Same as /unban (ends a running tempban). 409 NOT_BANNED when the user isn’t banned. Acts in the name of the key’s creator, who must still have the matching Discord permission; the target must be below their and the bot’s highest role (never the owner, the bot or the creator). The bot runs it within a few seconds — poll GET …/moderation/actions/{actionId}. At most 10 actions a minute per key. Written to the audit log.

Dieses Feature muss auf dem Server aktiviert sein: Moderation

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
userIdPfadstringJaDie Discord-Nutzer-ID des Mitglieds · Discord-ID (String)
Idempotency-KeyHeaderstringNeinOptional. Sende einen eindeutigen Wert (eine UUID) und verwende ihn bei einem erneuten Versuch wieder: Die Änderung erfolgt nur einmal. So funktioniert’s

Request-Body

Request-Body
FeldTypErforderlichBeschreibung
reasonstringJaRequired. Shown in the case, the mod log and the member’s DM
1–500 Zeichen

Antwort

Antwortfelder · 202
FeldTypErforderlichBeschreibung
actionIdstringJa
actionstringJaEines von warn, timeout, untimeout, kick, ban, unban
userIdstringJa
statusstringJaEines von pending, running, done, failed
caseNumberinteger | nullJa
errorstring | nullJaRefusal code when failed (e.g. HIERARCHY_HIGHER, MODERATOR_MISSING_PERMISSION, NOT_BANNED, BOT_MISSING_PERMISSIONS)
requestedAtstring | nullJaISO 8601 date-time
Antwort · 202
{
  "actionId": "234567890123456789",
  "action": "warn",
  "userId": "876543210987654321",
  "status": "pending",
  "caseNumber": 10,
  "error": "example",
  "requestedAt": "2026-10-07T12:00:00.000Z"
}

Beispiele

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/moderation/users/876543210987654321/unban" \
  -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/moderation/users/876543210987654321/unban', {
  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/moderation/users/876543210987654321/unban",
    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

Get the result of a moderation action

GET/guilds/{guildId}/moderation/actions/{actionId}

Scope: moderation:writeSensibel

Only actions made with the same API key. done → caseNumber; failed → error (the bot re-checks everything right before acting).

Dieses Feature muss auf dem Server aktiviert sein: Moderation

Parameter
NameInTypErforderlichBeschreibung
guildIdPfadstringJaDie ID deines Servers · Discord-ID (String)
actionIdPfadstringJa

Antwort

Antwortfelder · 200
FeldTypErforderlichBeschreibung
actionIdstringJa
actionstringJaEines von warn, timeout, untimeout, kick, ban, unban
userIdstringJa
statusstringJaEines von pending, running, done, failed
caseNumberinteger | nullJa
errorstring | nullJaRefusal code when failed (e.g. HIERARCHY_HIGHER, MODERATOR_MISSING_PERMISSION, NOT_BANNED, BOT_MISSING_PERMISSIONS)
requestedAtstring | nullJaISO 8601 date-time
Antwort · 200
{
  "actionId": "234567890123456789",
  "action": "warn",
  "userId": "876543210987654321",
  "status": "pending",
  "caseNumber": 10,
  "error": "example",
  "requestedAt": "2026-10-07T12:00:00.000Z"
}

Beispiele

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

Bereit, deinen Server aufs nächste Level zu bringen?

Füge BotGG kostenlos hinzu und aktiviere die Features dann in der Web-Konsole.