REST API v1 · Developers · API reference

Bank API reference

All 4 Bank 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.

Bank endpoints
EndpointScopeDescription
GET/guilds/{guildId}/bank/members/{userId}bank:readGet a member’s balance
GET/guilds/{guildId}/bank/members/{userId}/transactionsbank:readList a member’s transactions
POST/guilds/{guildId}/bank/members/{userId}/transactionsbank:writeAdd to or remove from a member’s balance
GET/guilds/{guildId}/bank/leaderboardbank:readTop balances

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

Get a member’s balance

GET/guilds/{guildId}/bank/members/{userId}

Scope: bank:read

Members without an account yet get the server’s starting balance.

Needs this feature enabled on the server: Bank

Parameters
NameInTypeRequiredDescription
guildIdpathstringYesYour server’s ID · Discord ID (string)
userIdpathstringYesThe member’s Discord user ID · Discord ID (string)

Response

Response fields · 200
FieldTypeRequiredDescription
userIdstringYes
balanceintegerYes
currencyobjectYes
currency.namestringYes
currency.pluralstringYes
currency.emojistring | nullYes
Response · 200
{
  "userId": "876543210987654321",
  "balance": 1350,
  "currency": {
    "name": "Example",
    "plural": "example",
    "emoji": "🪙"
  }
}

Examples

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/bank/members/876543210987654321" \
  -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/bank/members/876543210987654321', {
  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/bank/members/876543210987654321",
    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

List a member’s transactions

GET/guilds/{guildId}/bank/members/{userId}/transactions

Scope: bank:read

Newest first. Pass before=<nextCursor> for the next page.

Needs this feature enabled on the server: Bank

Parameters
NameInTypeRequiredDescription
guildIdpathstringYesYour server’s ID · Discord ID (string)
userIdpathstringYesThe member’s Discord user ID · Discord ID (string)
limitqueryintegerNo1–100 · Default 25
beforequeryintegerNoat least 1

Response

Response fields · 200
FieldTypeRequiredDescription
itemsarray of objectYes
items[].idintegerYes
items[].typestringYes
items[].amountintegerYes
items[].balanceAfterintegerYes
items[].reasonstring | nullYes
items[].counterpartyIdstring | nullYes
items[].createdAtstringYes
nextCursorstring | nullYes
Response · 200
{
  "items": [
    {
      "id": 98765,
      "type": "example",
      "amount": 100,
      "balanceAfter": 1350,
      "reason": "Tournament prize",
      "counterpartyId": "234567890123456789",
      "createdAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "nextCursor": "98700"
}

Examples

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

Add to or remove from a member’s balance

POST/guilds/{guildId}/bank/members/{userId}/transactions

Scope: bank:writeIdempotency-Key

Same rules as a banker change. Logged in the Bank ledger (type api) and the Bank log channel.

Needs this feature enabled on the server: Bank

Parameters
NameInTypeRequiredDescription
guildIdpathstringYesYour server’s ID · Discord ID (string)
userIdpathstringYesThe member’s Discord user ID · Discord ID (string)
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
typestringYesadd = credit, remove = debit
One of add, remove
amountintegerYes1–1,000,000,000,000
reasonstring | nullNoShown in the Bank ledger and log
up to 200 characters

Response

Response fields · 201
FieldTypeRequiredDescription
transactionIdintegerYes
userIdstringYes
typestringYesOne of add, remove
amountintegerYes
previousBalanceintegerYes
balanceintegerYes
createdAtstringYes
Response · 201
{
  "transactionId": 98765,
  "userId": "876543210987654321",
  "type": "add",
  "amount": 100,
  "previousBalance": 1250,
  "balance": 1350,
  "createdAt": "2026-10-07T12:00:00.000Z"
}

Examples

curl
curl -s -X POST "https://console.botgg.app/api/v1/guilds/123456789012345678/bank/members/876543210987654321/transactions" \
  -H "Authorization: Bearer $BOTGG_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"type":"add","amount":100,"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/bank/members/876543210987654321/transactions', {
  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({
    type: 'add',
    amount: 100,
    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/bank/members/876543210987654321/transactions",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),  # reuse it when you retry this request
    },
    json={
        "type": "add",
        "amount": 100,
        "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

Top balances

GET/guilds/{guildId}/bank/leaderboard

Scope: bank:read

Needs this feature enabled on the server: Bank

Parameters
NameInTypeRequiredDescription
guildIdpathstringYesYour server’s ID · Discord ID (string)
limitqueryintegerNo1–100 · Default 10

Response

Response fields · 200
FieldTypeRequiredDescription
itemsarray of objectYes
items[].rankintegerYes
items[].userIdstringYes
items[].balanceintegerYes
currencyobjectYes
currency.namestringYes
currency.pluralstringYes
currency.emojistring | nullYes
Response · 200
{
  "items": [
    {
      "rank": 1,
      "userId": "876543210987654321",
      "balance": 1350
    }
  ],
  "currency": {
    "name": "Example",
    "plural": "example",
    "emoji": "🪙"
  }
}

Examples

curl
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/bank/leaderboard?limit=10" \
  -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/bank/leaderboard?limit=10', {
  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/bank/leaderboard",
    headers={
        "Authorization": f"Bearer {os.environ['BOTGG_API_KEY']}",
    },
    params={
        "limit": 10,
    },
    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.