HTTP API
The key-based public API for reading your server's data, and the API used by the dashboard, with authentication, errors, rate limits and endpoints.
On this page
Common principles Error formatRate limits Public API with a key Creating a keyAuthenticationEndpointsDaily quotaOpen endpoints Dashboard API Session and sign-inCSRF tokenAccess levels for a serverAccountServers and configurationDiscord server managementBackups and long-running jobsServer dataSubscriptionSanction appealsRobert exposes an HTTP API that speaks JSON. It falls into three families:
| Family | Authentication | Who it is for |
|---|---|---|
| Public API | API key, Authorization: Bearer rbt_… |
Your website, your launcher, your tools: read-only, Premium plan and above |
| Dashboard API | Discord session (cookie) + CSRF token | The dashboard web application |
| Bot API | Token, Authorization: Bot … |
The Robert bot process only |
This page is written from the API's code: it describes what actually exists.
Common principles
- Base address:
https://robert-bot.com/api/v1/ - Format: JSON in UTF-8. A request body must be sent with
Content-Type: application/json, otherwise the API answers415. - Discord IDs: always strings (
"987654321098765432"), never numbers. - Dates: Unix timestamps in seconds, except for statistics days (
"2026-09-30"). - Maximum size of a request: 1 MB (25 MB when importing a backup). Beyond that:
413. - Responses:
200with a JSON object, or204with no content.
Error format
Every error has the same shape:
{
"error": "plan_required",
"message": "Ce module nécessite la formule premium.",
"details": { "required": "premium" }
}
error is a stable code to test in your program, message a human-readable text (in French), and details an optional extra. For a validation error (422, code invalid), details maps each faulty field to its message:
{
"error": "invalid",
"message": "Certains réglages sont invalides.",
"details": { "spam_max": "Maximum : 50.", "log_channel": "Ce salon n'existe plus sur le serveur." }
}
| Status | Common error codes |
Meaning |
|---|---|---|
400 |
bad_request, bad_state, bad_signature |
Malformed request, invalid JSON, invalid ID |
401 |
login_required, reauth, api_key_required, bad_api_key, revoked_api_key, bad_bot_token |
Authentication missing, expired or invalid |
402 |
plan_required, limit_reached |
Plan too low, or the plan's limit has been reached |
403 |
no_access, readonly, bad_csrf, bad_origin, missing_permission, hierarchy, bot_hierarchy, permission_escalation, key_guild_mismatch, banned |
Access denied |
404 |
not_found |
Resource not found |
405 |
method_not_allowed |
HTTP method not supported at this address |
409 |
bot_missing, job_running, no_slot, active_subscription |
Conflict with the current state |
413 |
payload_too_large |
Request too large |
415 |
unsupported_media_type |
The body is not JSON |
422 |
invalid, confirm_required, terms_required |
Data rejected by validation |
429 |
rate_limited, quota_exceeded, cooldown |
Too many requests |
500 |
server_error |
Internal error |
502 |
upstream_error, discord_…, stripe_error |
Discord or Stripe answered with an error |
503 |
unavailable, bot_not_configured, billing_not_configured, discord_not_configured |
Service not configured or unavailable |
Rate limits
Each IP address has one “token bucket” per category of route:
| Category | Requests per minute | Burst | Routes concerned |
|---|---|---|---|
read |
300 | 120 | Dashboard reads (GET) |
write |
90 | 40 | Writes (POST, PUT, PATCH, DELETE) |
auth |
20 | 10 | Sign-in and OAuth callback |
api |
120 | 60 | The key-based public API |
contact |
4 | 4 | The contact form |
The burst is the number of requests you can send in one go; the bucket then refills at the rate shown. When it is empty, the API answers 429 with the rate_limited code and a Retry-After header (in seconds).
Public API with a key
The public API gives read-only access to the data of a server covered by a Premium, Pro or Network plan.
Creating a key
- In the dashboard, open Account → API & keys.
- Click New key, give it a name (“Website — leaderboard widget”) and, preferably, restrict it to one server.
- Copy the key displayed: it starts with
rbt_and is shown only once. Robert keeps nothing but a fingerprint of it.
You can revoke a key at any time from the same page: the programs using it lose access immediately.
A key is a secret
Never publish it in a code repository, a web page or an application distributed to your members. Call the API from your own server, not from your visitors' browsers. If in doubt, revoke the key and create a new one.
Authentication
Send the key in the Authorization header. No cookie or CSRF token is needed.
curl -H "Authorization: Bearer rbt_YOUR_KEY" \
"https://robert-bot.com/api/v1/public-api/guilds/987654321098765432/leaderboard?type=xp"
On every request, the API checks, in this order:
| Check | If it fails |
|---|---|
| The header is present and the key is valid | 401 api_key_required or bad_api_key |
| The key has not been revoked | 401 revoked_api_key |
| The key is not restricted to another server | 403 key_guild_mismatch |
| The key's owner still has access to the server's dashboard | 403 no_access |
| The server is covered by a Premium plan or above | 402 plan_required |
| The key's daily quota has not been exceeded | 429 quota_exceeded |
Endpoints
Every address starts with https://robert-bot.com/api/v1/public-api/guilds/{guild_id}.
| Method and path | Description | Parameters |
|---|---|---|
GET /public-api/guilds/{guild_id} |
Server information and key figures: name, icon, member count, plan, messages and joins over the last 7 days, active cases, open tickets | — |
GET /public-api/guilds/{guild_id}/leaderboard |
The top 100 of the leaderboard | type: xp (default), messages, voice, money, invites, reputation |
GET /public-api/guilds/{guild_id}/analytics |
Daily series, peak-hours map, most active members, totals | days: 7 at least, 30 by default, capped by the plan |
GET /public-api/guilds/{guild_id}/cases |
The sanctions record, 50 per page | user, action, q, page |
GET /public-api/guilds/{guild_id}/giveaways |
The 100 latest giveaways | — |
Responses have exactly the same format as the equivalent dashboard endpoints. Example for the leaderboard:
{
"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
}
]
}
Daily quota
Each key has a quota of requests per day, set by the plan of the server being queried:
| Plan | Requests per day |
|---|---|
| Premium | 5,000 |
| Pro | 20,000 |
| Network | 100,000 |
The counter resets at midnight UTC. Every response tells you where you stand:
| Header | Content |
|---|---|
X-RateLimit-Limit |
The key's daily quota |
X-RateLimit-Remaining |
The number of requests left today |
X-RateLimit-Reset |
The Unix timestamp of the next reset |
Once the quota is reached, the API answers 429 with the quota_exceeded code, a Retry-After header and the detail {"limit": …, "reset": …}. The per-minute rate limit (the api category above) applies on top of that.
Cache the responses
A leaderboard or statistics do not need to be reloaded on every visit to your page: keep the response for a few minutes on your side and your quota will last all day.
Open endpoints
A few addresses can be reached without a key or a session:
| Method and path | Description |
|---|---|
GET /health |
API state: version, mode, uptime |
GET /catalog?lang=en |
The full catalogue: modules, commands, plans, limits, permissions, variables (lang: fr or en) |
GET /public/stats |
Number of servers and members, modules and commands |
GET /public/status |
Component states and incidents, used by the Status page |
GET /public/leaderboard/{guild_id} |
A server's XP leaderboard, only if the Levels module's “Public leaderboard on the web” option is on; otherwise 404 |
POST /public/contact |
Submits the contact form (email, message of at least 10 characters) |
Dashboard API
This is the API used by the dashboard web application. It is described here for transparency and for contributors; for your own integrations, prefer the public API, which is designed for that.
Session and sign-in
Authentication relies on Discord sign-in (OAuth2, identify and guilds scopes):
GET /auth/login?next=…redirects to Discord.- Discord sends the user back to
GET /auth/callback, which creates the session and sets therobert_sessioncookie (HttpOnly,Secure,SameSite=Lax, valid for 30 days). GET /mereturns the signed-in user, their subscriptions and the session's CSRF token.POST /auth/logoutcloses the session.
{
"user": { "id": "123456789012345678", "username": "lina", "global_name": "Lina", "avatar_url": "https://cdn.discordapp.com/…", "admin": false, "settings": {} },
"csrf": "kZ3…",
"mode": "live",
"subscriptions": []
}
Without a valid session, a protected route answers 401 with the login_required code. If the Discord access has expired, the code is reauth: the user has to sign in again.
CSRF token
Every request that changes data (POST, PUT, PATCH, DELETE) must carry the X-CSRF-Token header with the csrf value returned by GET /me. Without it, the API answers 403 with the bad_csrf code. If the request has an Origin header, it must match Robert's site, otherwise the answer is 403 bad_origin.
const api = "https://robert-bot.com/api/v1/";
const me = await fetch(api + "me", { credentials: "include" }).then((r) => r.json());
await fetch(api + "guilds/987654321098765432/modules/welcome", {
method: "PUT",
credentials: "include",
headers: { "Content-Type": "application/json", "X-CSRF-Token": me.csrf },
body: JSON.stringify({ enabled: true, settings: { join_channel: "800000000000000002" } }),
});
Access levels for a server
Every /guilds/{guild_id}/… route checks the signed-in person's access level, returned in the access field of GET /guilds/{guild_id}:
access |
Who | Write access |
|---|---|---|
owner |
Server owner | Yes |
manager |
Manage Server or Administrator permission | Yes |
team |
Member holding a dashboard team role | Yes |
readonly |
Member holding a read-only role | No: 403 readonly |
Without any of these, the answer is 403 no_access. The /manage/… routes additionally check the person's Discord permission and the role hierarchy (missing_permission, hierarchy, bot_hierarchy, permission_escalation codes). See Team and access.
Account
| Method and path | Description |
|---|---|
GET /me |
Signed-in user, CSRF token, subscriptions |
GET /account |
Profile, active sessions, API keys, subscriptions |
PUT /account/settings |
Preferences: lang (fr, en), theme (system, light, dark), emails, density |
GET /account/export |
Export of your data as JSON |
DELETE /account |
Deletes the account; body {"confirm": "SUPPRIMER"} |
POST /account/sessions/revoke |
Closes every other session |
POST /account/api-keys |
Creates an API key; body {"name": "…", "guild_id": "…"} (guild_id optional). The full key is only returned in this response |
DELETE /account/api-keys/{key_id} |
Revokes a key |
Servers and configuration
| Method and path | Description |
|---|---|
GET /guilds |
Servers the user can manage (?refresh=1 to force a refresh) and the invite link |
GET /guilds/{guild_id} |
Information, the week's figures, access level |
GET /guilds/{guild_id}/config |
Plan, limits, general settings and the configuration of every module |
PUT /guilds/{guild_id}/modules/{module_id} |
Enables or configures a module; body {"enabled": true, "settings": {…}, "commands_enabled": true}. commands_enabled (modules not enabled by default only) chooses whether the module's slash commands are registered on Discord (100 per server); if they don't fit, the module is enabled without them (commands_disabled_by_limit, commands_message, commands_message_en in the response), and turning its commands back on is refused with 422 too_many_commands |
POST /guilds/{guild_id}/modules/{module_id}/reset |
Resets a module to its default values |
PUT /guilds/{guild_id}/general |
General settings |
GET /guilds/{guild_id}/history |
The last 100 settings versions (?module=…) |
POST /guilds/{guild_id}/history/{history_id}/restore |
Goes back to the state before that change |
GET /guilds/{guild_id}/resources |
The server's channels, roles and emojis, for the pickers |
GET /guilds/{guild_id}/audit |
The last 200 dashboard actions |
Settings sent are validated against the catalogue: types, bounds, allowed options and plan limits. Unknown keys are ignored, missing keys keep their current value. Enabling a module reserved for a higher plan returns 402 plan_required.
Discord server management
All these routes require Robert to be on the server (409 bot_missing otherwise) and the person to hold the matching Discord permission.
| Method and path | Description |
|---|---|
GET /guilds/{guild_id}/manage/roles |
Roles, member counts, editable flag |
POST /guilds/{guild_id}/manage/roles |
Creates a role (name, color, hoist, mentionable, permissions) |
PATCH · DELETE /guilds/{guild_id}/manage/roles/{role_id} |
Edits or deletes a role |
PUT /guilds/{guild_id}/manage/roles-order |
Reorders; body {"order": ["highest id", "…"]} |
POST /guilds/{guild_id}/manage/roles/{role_id}/bulk |
Bulk role change (Premium); action: add or remove, target: all, humans, bots. Returns {"job": "…"} |
GET · POST /guilds/{guild_id}/manage/channels |
Lists or creates a channel (type: text, voice, category, announcement, stage, forum) |
PATCH · DELETE /guilds/{guild_id}/manage/channels/{channel_id} |
Edits (including permission_overwrites, sync_parent) or deletes |
POST /guilds/{guild_id}/manage/channels/{channel_id}/clone |
Clones a channel with its permissions |
PUT /guilds/{guild_id}/manage/channels-order |
Reorders; body {"positions": [{"id": "…", "position": 0}]} |
GET /guilds/{guild_id}/manage/members |
100 members per page (after), search q, role filter |
GET · PATCH /guilds/{guild_id}/manage/members/{user_id} |
A member's profile; edits roles, nick, timeout_until, with reason |
POST /guilds/{guild_id}/manage/members/{user_id}/kick |
Kicks (reason) |
POST /guilds/{guild_id}/manage/members/{user_id}/ban |
Bans (reason, delete_seconds up to 604800) |
GET /guilds/{guild_id}/manage/bans · DELETE …/bans/{user_id} |
Lists bans; lifts a ban |
GET · POST /guilds/{guild_id}/manage/emojis · DELETE …/emojis/{emoji_id} |
Emojis (image as a data: URI, 256 KB at most) |
GET /guilds/{guild_id}/manage/invites · POST …/invites · DELETE …/invites/{code} |
Invites |
GET /guilds/{guild_id}/manage/webhooks · DELETE …/webhooks/{webhook_id} |
Webhooks |
GET · PATCH /guilds/{guild_id}/manage/settings |
The server's native settings |
GET /guilds/{guild_id}/manage/audit-log |
Discord audit log (limit, before) |
GET /guilds/{guild_id}/manage/events · GET …/manage/automod |
Scheduled events; native AutoMod rules |
Backups and long-running jobs
| Method and path | Description |
|---|---|
GET /guilds/{guild_id}/backups |
Backups, the plan's limit, recent jobs |
POST /guilds/{guild_id}/backups |
Starts a backup (name, include, messages_per_channel, exclude_channels). Returns {"job": "…"} |
GET /guilds/{guild_id}/backups/{backup_id} |
Summarised contents of a backup |
GET /guilds/{guild_id}/backups/{backup_id}/diff |
Preview of the differences (mode: merge or replace; from for a clone) |
POST /guilds/{guild_id}/backups/{backup_id}/restore |
Starts a restore; requires being a server administrator and "confirm": "RESTAURER" |
PATCH · DELETE /guilds/{guild_id}/backups/{backup_id} |
Renames or deletes |
GET /guilds/{guild_id}/backups/{backup_id}/download |
Downloads the JSON file (without member data) |
POST /guilds/{guild_id}/backups/import |
Imports a Robert backup file |
GET /guilds/{guild_id}/jobs/{job_id} |
Tracks a job |
Backups, restores and bulk role changes are background jobs. The route returns a job ID, to be polled until status is done or failed:
{
"id": "3f9c2a7e51b04d18",
"kind": "backup_restore",
"status": "running",
"progress": 42.0,
"message": "Salon « général »",
"result": null,
"log": []
}
Example of a restore in merge mode:
{
"mode": "merge",
"roles": true,
"channels": true,
"emojis": true,
"robert": true,
"confirm": "RESTAURER"
}
Only one restore or bulk role operation can run at a time on a server (409 job_running).
Server data
| Method and path | Description |
|---|---|
GET /guilds/{guild_id}/cases |
The record (user, action, q, page) |
POST /guilds/{guild_id}/cases |
Adds a note or a warning (action: note or warn, user_id, reason) |
PATCH /guilds/{guild_id}/cases/{number} |
Corrects the reason (reason) or lifts the sanction ("revoke": true) |
GET /guilds/{guild_id}/logs |
100 events per page (type, category, user, channel, q, before), within the plan's retention |
GET /guilds/{guild_id}/leaderboard |
Leaderboard (type) |
GET /guilds/{guild_id}/analytics |
Analytics (days) |
GET /guilds/{guild_id}/tickets · GET …/tickets/{ticket_id} |
Tickets (status: open, closed); a ticket's transcript |
GET · POST /guilds/{guild_id}/giveaways |
Lists; creates a giveaway (prize, channel_id, duration_seconds from 60 to 5,184,000, winners) |
POST /guilds/{guild_id}/giveaways/{giveaway_id}/{action} |
end, reroll or cancel |
GET /guilds/{guild_id}/forms/responses · POST …/responses/{response_id} |
Form responses; decision (decision: accepted or rejected, note) |
GET /guilds/{guild_id}/appeals · POST …/appeals/{appeal_id} |
Sanction appeals; decision |
GET · POST /guilds/{guild_id}/actions |
Actions handed to the bot; creates one (kind, payload) |
An action is a request passed on to the bot, for example sending a message composed in the dashboard. The accepted kind values are: send_message, edit_message, publish_panel, giveaway_start, giveaway_end, giveaway_reroll, ticket_panel, form_panel, rules_panel, verification_panel, role_panel and sync_commands. The action goes from pending to done or failed once the bot has handled it: see Bot integration.
Subscription
| Method and path | Description |
|---|---|
GET /billing |
Subscriptions, covered servers, the plan catalogue |
POST /billing/checkout |
Opens a payment; body plan, cycle (month, year), accept_terms, waive_withdrawal. Returns the url of the payment page |
POST /billing/portal |
Address of the Stripe billing portal |
GET /billing/invoices |
The 24 latest invoices |
POST /billing/subscriptions/{sub_id}/cancel · …/resume |
Schedules or undoes cancellation at the end of the period |
POST /billing/subscriptions/{sub_id}/slots |
Covers a server; body {"guild_id": "…"} |
DELETE /billing/subscriptions/{sub_id}/slots/{guild_id} |
Frees a server |
How it works from the user's side is described in Account and billing; the payment webhook in Stripe webhook.
Sanction appeals
| Method and path | Description |
|---|---|
GET /appeals/mine |
The signed-in user's appealable sanctions |
POST /appeals |
Files an appeal (guild_id, case_number, answers); a cooldown between two appeals applies (429 cooldown) |
The /admin/… routes are reserved for the Robert team and are not documented here.
Spotted a mistake? Got a question? Let us know on the support server.