REST API reference
Every route of the v1 REST API with its scope, parameters, a curl example and the expected response.
On this page
Server ServerChannelsRolesStatistics Members Member profileLeaderboardLinked accountsGive or remove a roleXP and currency Messages Send a messageEdit a messageAction result Moderation Sanctions Giveaways Events Bridges Outgoing webhooksAll routes live under https://robert-bot.com/api/v1/public-api/guilds/{guild_id} and authenticate with an API key. Each heading states the required scope. The full machine-readable specification is available as OpenAPI 3.1.
The examples use these variables:
export ROBERT_KEY="rbt_YOUR_KEY"
export API="https://robert-bot.com/api/v1/public-api/guilds/987654321098765432"
| Method | Path | Scope |
|---|---|---|
| GET | / |
guild.read |
| GET | /channels · /roles · /analytics |
guild.read |
| GET | /members/{user_id} |
members.read |
| GET | /leaderboard · /links |
members.read |
| POST · DELETE | /members/{user_id}/roles/{role_id} |
members.write |
| POST | /members/{user_id}/xp · /balance |
members.write |
| POST · PATCH | /messages · /messages/{message_id} |
messages.write |
| GET | /actions/{action_id} |
(the key that created it) |
| GET · POST | /cases |
moderation.read · moderation.write |
| GET · POST | /giveaways |
giveaways.read · giveaways.write |
| GET | /events · /events/stream |
events.read |
| CRUD | /bridges · /webhooks |
bridges |
Server
Server
GET / — scope guild.read
Name, icon, member count, plan and active modules, plus a few weekly figures (abridged response below).
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API"
{
"id": "987654321098765432",
"name": "My server",
"icon_url": "https://cdn.discordapp.com/icons/…",
"member_count": 1280,
"online_count": 214,
"tier": "pro",
"plan": "pro",
"modules": ["antiraid", "levels", "tickets", "welcome"],
"bot_present": true,
"week": { "messages": 4210, "joins": 63, "leaves": 21, "commands": 530 },
"cases_open": 2,
"tickets_open": 1,
"last_backup": 1791360000
}
Channels
GET /channels — scope guild.read — paginated (limit, cursor)
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API/channels?limit=2"
{
"items": [
{ "id": "800000000000000001", "name": "general", "type": "text", "category_id": "800000000000000100", "position": 0 },
{ "id": "800000000000000004", "name": "Voice", "type": "voice", "category_id": null, "position": 1 }
],
"next_cursor": "djE6Mg"
}
type is text, voice, category, announcement, stage, forum, media or other. This route requires Robert to be present on the server (otherwise 409 bot_missing).
Roles
GET /roles — scope guild.read — paginated, highest to lowest
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API/roles?limit=2"
{
"items": [
{ "id": "700000000000000001", "name": "Moderation", "color": 5592575, "position": 12, "managed": false, "hoist": true, "mentionable": false },
{ "id": "700000000000000002", "name": "Member", "color": 0, "position": 1, "managed": false, "hoist": false, "mentionable": false }
],
"next_cursor": null
}
color is the Discord color as an integer (5592575 = #5555FF); managed flags a role managed by an integration.
Statistics
GET /analytics?days=30 — scope guild.read
days: 7 at least, 30 by default, capped by the plan (see Limits). Same format as the dashboard.
{
"days": 30,
"max_days": 90,
"series": [{ "day": "2026-09-30", "members": 1280, "joins": 3, "leaves": 1, "messages": 612, "voice_minutes": 340, "commands": 41 }],
"heatmap": [{ "dow": 5, "hour": 21, "messages": 188 }],
"top_members": [{ "user_id": "123456789012345678", "name": "Lina", "messages": 3120, "voice_minutes": 540 }],
"totals": { "joins": 63, "leaves": 21, "messages": 18420, "voice_minutes": 9120, "commands": 1530 }
}
Members
Member profile
GET /members/{user_id} — scope members.read
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API/members/123456789012345678"
{
"id": "123456789012345678",
"username": "lina",
"display_name": "Lina",
"avatar_url": "https://cdn.discordapp.com/avatars/…",
"roles": ["700000000000000002"],
"joined_at": 1760000000,
"in_server": true,
"level": 12,
"xp": 8420,
"rank": 3,
"messages": 3120,
"voice_minutes": 540,
"balance": 1250,
"bank": 0,
"reputation": 3,
"invites": 8,
"warnings_active": 0,
"links": [{ "bridge_id": "b_9f2c41d07a1b", "external_id": "069a79f4-44e9-4726-a5be-fca90e38aaf5", "external_name": "Steve", "linked_at": 1791300000 }]
}
in_server is false for someone who left the server but whose statistics Robert keeps. Unknown everywhere: 404 member_not_found.
Leaderboard
GET /leaderboard?type=xp — scope members.read
type: xp (default), messages, voice, balance (or money), invites, reputation. Returns the top 100.
{
"type": "xp",
"entries": [
{ "user_id": "123456789012345678", "name": "Lina", "avatar": "a1b2c3", "xp": 8420, "level": 12, "messages": 3120,
"voice_minutes": 540, "balance": 1250, "bank": 0, "invites": 8, "reputation": 3, "score": 8420 }
]
}
Linked accounts
GET /links — scope members.read — paginated
Maps a player (game side) to their Discord account, to show a rank or hand out rewards. Filters: external_id (Minecraft UUID…), user_id (Discord ID), bridge_id.
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API/links?external_id=069a79f4-44e9-4726-a5be-fca90e38aaf5"
{
"items": [{ "guild_id": "987654321098765432", "bridge_id": "b_9f2c41d07a1b", "user_id": "123456789012345678",
"external_id": "069a79f4-44e9-4726-a5be-fca90e38aaf5", "external_name": "Steve", "linked_at": 1791300000 }],
"next_cursor": null
}
Give or remove a role
POST or DELETE /members/{user_id}/roles/{role_id} — scope members.write — wait, Idempotency-Key
curl -s -X POST -H "Authorization: Bearer $ROBERT_KEY" \
"$API/members/123456789012345678/roles/700000000000000005?wait=true"
{ "action_id": "3f9c2a7e51b04d18a2c4e6f801d3b5a7", "status": "done", "result": {} }
Specific errors: role_not_found (404), role_not_assignable (422: @everyone role or one managed by an integration). The role must stay below Robert's in the server hierarchy, otherwise the bot fails (502 action_failed).
XP and currency
POST /members/{user_id}/xp and POST /members/{user_id}/balance — scope members.write — wait, Idempotency-Key
| Field | Type | Description |
|---|---|---|
amount |
integer | Quantity, positive or negative, non-zero. Maximum: 10,000,000 XP, 1,000 billion currency |
reason |
text | Optional, 200 characters at most (logged) |
curl -s -X POST "$API/members/123456789012345678/xp?wait=true" \
-H "Authorization: Bearer $ROBERT_KEY" -H "Content-Type: application/json" \
-d '{"amount": 100, "reason": "Quest completed"}'
{ "action_id": "…", "status": "done", "result": { "xp": 8520, "level": 12 } }
For currency, result is {"balance": 1350}.
Messages
Send a message
POST /messages — scope messages.write — wait, Idempotency-Key
| Field | Type | Description |
|---|---|---|
channel_id |
string | Required. Text or announcement channel |
content |
text | 2,000 characters at most |
embed |
object | See below. content or embed is required |
username, avatar_url |
text, URL | Optional: the message is then sent through a channel webhook, under that name (80 characters at most) and avatar |
Embed: title (256), description (4,096), color ("#0055A4" or integer), footer, author, image, thumbnail, url and up to 25 fields (name, value, inline). Discord's shapes (footer.text, author.name, image.url) are accepted. 6,000 characters in total.
Mentions never notify anyone (@everyone, roles and members are neutralized).
curl -s -X POST "$API/messages?wait=true" \
-H "Authorization: Bearer $ROBERT_KEY" -H "Content-Type: application/json" \
-d '{
"channel_id": "800000000000000002",
"embed": {
"title": "Weekly leaderboard",
"description": "1. **Lina** — 8,420 XP\n2. **Hugo** — 7,910 XP",
"color": "#EF4135",
"fields": [{ "name": "Next reset", "value": "Sunday", "inline": true }]
}
}'
{ "action_id": "…", "status": "done", "result": { "message_id": "900000000000000123", "channel_id": "800000000000000002" } }
Edit a message
PATCH /messages/{message_id} — scope messages.write
Same body as sending (channel_id included). Only messages sent by the API can be edited; otherwise 404 message_not_found.
curl -s -X PATCH "$API/messages/900000000000000123?wait=true" \
-H "Authorization: Bearer $ROBERT_KEY" -H "Content-Type: application/json" \
-d '{"channel_id": "800000000000000002", "content": "Corrected text"}'
Action result
GET /actions/{action_id}
See Writes and the action queue. Response: action_id, kind, status (pending, done or failed), created_at, done_at, result.
Moderation
Sanctions
GET /cases — scope moderation.read
Filters: user (ID), action, q (search in nickname, reason, moderator), page (50 per page).
{
"cases": [{ "guild_id": "987654321098765432", "number": 42, "user_id": "123456789012345678", "user_name": "Lina",
"moderator_id": "111111111111111111", "moderator_name": "Hugo", "action": "warn", "reason": "Spam",
"duration": null, "created_at": 1791300000, "expires_at": null, "active": 1, "source": "api" }],
"total": 1, "page": 0, "counts": { "warn": 1 }
}
POST /cases — scope moderation.write — wait, Idempotency-Key
| Field | Description |
|---|---|
user_id |
Required. The sanctioned member (never the server owner: cannot_target_owner) |
action |
Required. warn, timeout, kick or ban |
reason |
Required. 500 characters at most |
duration |
Seconds. Required for timeout (1 to 2,419,200, i.e. 28 days); optional for ban; forbidden for warn and kick |
curl -s -X POST "$API/cases?wait=true" \
-H "Authorization: Bearer $ROBERT_KEY" -H "Content-Type: application/json" \
-d '{"user_id": "123456789012345678", "action": "timeout", "reason": "Spam", "duration": 600}'
{ "action_id": "…", "status": "done", "result": { "case": 43 } }
The sanction is entered in the server's record, in the name of the key's owner, and triggers the case.create event.
Giveaways
GET /giveaways — scope giveaways.read: the latest 100, {"giveaways": […]} (prize, channel_id, winners, ends_at, status, entries, winner_ids, requirements).
POST /giveaways — scope giveaways.write — Idempotency-Key
| Field | Description |
|---|---|
prize |
Required. 200 characters at most |
channel_id |
Required. Channel to post in |
duration_seconds |
Required. 60 to 5,184,000 (60 days) |
winners |
1 to 50 (1 by default) |
role_id, min_level, min_invites, min_account_days |
Optional entry requirements |
curl -s -X POST "$API/giveaways" \
-H "Authorization: Bearer $ROBERT_KEY" -H "Content-Type: application/json" \
-d '{"prize": "1 month of Nitro", "channel_id": "800000000000000002", "duration_seconds": 86400, "winners": 2, "min_level": 5}'
{ "id": "a1b2c3d4e5f60718", "action_id": "…", "status": "pending" }
Response 201. The number of simultaneous giveaways depends on the plan (limit_reached beyond it).
Events
GET /events and GET /events/stream — scope events.read. Details in the Events page.
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API/events?cursor=latest&types=member.join&wait=25"
Bridges
Scope bridges. The full guide is in Bridges.
| Method | Path | Description |
|---|---|---|
| GET | /bridges |
List (paginated) |
| POST | /bridges |
Creates a bridge. The rbb_… token is returned only in this response |
| GET · PATCH · DELETE | /bridges/{bridge_id} |
Read, update, delete (204) |
| POST | /bridges/{bridge_id}/token |
Regenerates the token: the old one stops working |
curl -s -X POST "$API/bridges" \
-H "Authorization: Bearer $ROBERT_KEY" -H "Content-Type: application/json" \
-d '{
"name": "Survival",
"type": "minecraft",
"chat_channel_id": "800000000000000002",
"status_channel_id": "800000000000000003",
"settings": { "display": "webhook", "events": { "join": true, "leave": true, "death": true, "advancement": false } }
}'
{
"id": "b_9f2c41d07a1b",
"name": "Survival",
"type": "minecraft",
"enabled": true,
"chat_channel_id": "800000000000000002",
"status_channel_id": "800000000000000003",
"token_prefix": "rbb_4Fk2",
"online": false,
"settings": { "discord_to_game": true, "game_to_discord": true, "display": "webhook" },
"token": "rbb_4Fk2…",
"warning": "Copy this token now: it will never be shown again."
}
The type is minecraft, fivem, gmod or generic. A channel can only be linked to one bridge (channel_in_use). All settings are described in Bridges.
Outgoing webhooks
Scope bridges. The full guide is in Outgoing webhooks.
| Method | Path | Description |
|---|---|---|
| GET | /webhooks |
List (paginated) |
| POST | /webhooks |
Creates a webhook. The secret is returned only in this response |
| GET · PATCH · DELETE | /webhooks/{webhook_id} |
Read, update (regenerate_secret: true for a new secret), delete |
| GET | /webhooks/{webhook_id}/deliveries |
Log of the last 100 deliveries |
| POST | /webhooks/{webhook_id}/test |
Sends a ping event right away and returns the result |
curl -s -X POST "$API/webhooks" \
-H "Authorization: Bearer $ROBERT_KEY" -H "Content-Type: application/json" \
-d '{"name": "My site", "url": "https://example.com/hooks/robert", "types": ["member.join", "case.create"]}'
{
"id": "wh_5c1d9e7a30b2f4",
"guild_id": "987654321098765432",
"name": "My site",
"url": "https://example.com/hooks/robert",
"types": ["member.join", "case.create"],
"enabled": true,
"failures": 0,
"secret": "whsec_9a3c…"
}
Spotted a mistake? Got a question? Let us know on the support server.