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.
| Endpoint | Scope | Description |
|---|---|---|
GET/guilds/{guildId}/bank/members/{userId} | bank:read | Get a member’s balance |
GET/guilds/{guildId}/bank/members/{userId}/transactions | bank:read | List a member’s transactions |
POST/guilds/{guildId}/bank/members/{userId}/transactions | bank:write | Add to or remove from a member’s balance |
GET/guilds/{guildId}/bank/leaderboard | bank:read | Top balances |
Besides its own errors below, every endpoint can return these common ones:
Get a member’s balance
GET/guilds/{guildId}/bank/members/{userId}
Members without an account yet get the server’s starting balance.
Needs this feature enabled on the server: Bank
| Name | In | Type | Required | Description |
|---|---|---|---|---|
guildId | path | string | Yes | Your server’s ID · Discord ID (string) |
userId | path | string | Yes | The member’s Discord user ID · Discord ID (string) |
Response
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | |
balance | integer | Yes | |
currency | object | Yes | |
currency.name | string | Yes | |
currency.plural | string | Yes | |
currency.emoji | string | null | Yes |
{
"userId": "876543210987654321",
"balance": 1350,
"currency": {
"name": "Example",
"plural": "example",
"emoji": "🪙"
}
}Examples
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/bank/members/876543210987654321" \
-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/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);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
| HTTP | Codes |
|---|---|
| 409 | BANK_DISABLED |
| 503 | SERVICE_UNAVAILABLE |
List a member’s transactions
GET/guilds/{guildId}/bank/members/{userId}/transactions
Newest first. Pass before=<nextCursor> for the next page.
Needs this feature enabled on the server: Bank
| Name | In | Type | Required | Description |
|---|---|---|---|---|
guildId | path | string | Yes | Your server’s ID · Discord ID (string) |
userId | path | string | Yes | The member’s Discord user ID · Discord ID (string) |
limit | query | integer | No | 1–100 · Default 25 |
before | query | integer | No | at least 1 |
Response
| Field | Type | Required | Description |
|---|---|---|---|
items | array of object | Yes | |
items[].id | integer | Yes | |
items[].type | string | Yes | |
items[].amount | integer | Yes | |
items[].balanceAfter | integer | Yes | |
items[].reason | string | null | Yes | |
items[].counterpartyId | string | null | Yes | |
items[].createdAt | string | Yes | |
nextCursor | string | null | Yes |
{
"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 -s "https://console.botgg.app/api/v1/guilds/123456789012345678/bank/members/876543210987654321/transactions?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/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);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
| HTTP | Codes |
|---|---|
| 409 | BANK_DISABLED |
| 503 | SERVICE_UNAVAILABLE |
Add to or remove from a member’s balance
POST/guilds/{guildId}/bank/members/{userId}/transactions
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
guildId | path | string | Yes | Your server’s ID · Discord ID (string) |
userId | path | string | Yes | The member’s Discord user ID · Discord ID (string) |
Idempotency-Key | header | string | No | Optional. Send a unique value (a UUID) and reuse it when you retry: the change happens only once. How it works |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | add = credit, remove = debit One of add, remove |
amount | integer | Yes | 1–1,000,000,000,000 |
reason | string | null | No | Shown in the Bank ledger and log up to 200 characters |
Response
| Field | Type | Required | Description |
|---|---|---|---|
transactionId | integer | Yes | |
userId | string | Yes | |
type | string | Yes | One of add, remove |
amount | integer | Yes | |
previousBalance | integer | Yes | |
balance | integer | Yes | |
createdAt | string | Yes |
{
"transactionId": 98765,
"userId": "876543210987654321",
"type": "add",
"amount": 100,
"previousBalance": 1250,
"balance": 1350,
"createdAt": "2026-10-07T12:00:00.000Z"
}Examples
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"}'// 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);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
| HTTP | Codes |
|---|---|
| 400 | INVALID_JSON |
| 404 | MEMBER_NOT_FOUND |
| 409 | BANK_DISABLED, INSUFFICIENT_FUNDS |
| 413 | PAYLOAD_TOO_LARGE |
| 415 | UNSUPPORTED_MEDIA_TYPE |
| 422 | IDEMPOTENCY_KEY_REUSED, BOT_ACCOUNT, BALANCE_LIMIT |
| 503 | SERVICE_UNAVAILABLE |
Top balances
GET/guilds/{guildId}/bank/leaderboard
Needs this feature enabled on the server: Bank
| Name | In | Type | Required | Description |
|---|---|---|---|---|
guildId | path | string | Yes | Your server’s ID · Discord ID (string) |
limit | query | integer | No | 1–100 · Default 10 |
Response
| Field | Type | Required | Description |
|---|---|---|---|
items | array of object | Yes | |
items[].rank | integer | Yes | |
items[].userId | string | Yes | |
items[].balance | integer | Yes | |
currency | object | Yes | |
currency.name | string | Yes | |
currency.plural | string | Yes | |
currency.emoji | string | null | Yes |
{
"items": [
{
"rank": 1,
"userId": "876543210987654321",
"balance": 1350
}
],
"currency": {
"name": "Example",
"plural": "example",
"emoji": "🪙"
}
}Examples
curl -s "https://console.botgg.app/api/v1/guilds/123456789012345678/bank/leaderboard?limit=10" \
-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/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);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
| HTTP | Codes |
|---|---|
| 409 | BANK_DISABLED |
| 503 | SERVICE_UNAVAILABLE |