Quick start
Create an API key, call Robert with curl, post your first message in a channel and discover the three building blocks of the developer platform.
On this page
The three building blocks 1. Create an API key 2. First call 3. Read data 4. Send your first message 5. What next?Robert's developer platform lets you connect your own applications to your Discord server: a website, a launcher, a game server (Minecraft, FiveM, Garry's Mod…), another bot or a plain script. It is available from the Premium plan; quotas grow with the Pro and Network plans (see API quotas by plan).
The three building blocks
| Block | What it is for | Secret used |
|---|---|---|
| REST API | Read your server (members, leaderboards, channels, sanctions) and act on it (roles, XP, currency, messages, sanctions, giveaways) | API key rbt_… |
| Real-time bridges | Connect an application to a channel: two-way chat, game events, status, console commands, account linking | Bridge token rbb_… |
| Outgoing webhooks | Robert calls your URL, signed, when something happens (member joins, sanction, ticket…) | Webhook secret |
An event stream (long-polling or Server-Sent Events) completes the picture if you would rather fetch events than be called.
Just want to link a Minecraft server?
Jump straight to the Minecraft step by step guide: the RobertLink plugin does all the work, no code required.
1. Create an API key
- Open the dashboard, pick your server, then the Developers page.
- Under API keys, click New key. Give it a name ("Website"), pick the scopes you need (see Authentication and scopes) and, preferably, restrict it to this server.
- Copy the key: it starts with
rbt_and is shown only once.
A key is a secret
Keep it in an environment variable or a secrets vault. Never put it in a public repository, a web page or a distributed application. If it leaks, revoke it from the same page: it stops working immediately.
The examples below assume:
export ROBERT_KEY="rbt_YOUR_KEY"
export GUILD="987654321098765432" # your server ID
export API="https://robert-bot.com/api/v1/public-api/guilds/$GUILD"
To copy the ID of a server, channel or member, enable developer mode in Discord (Settings → Advanced), then right-click → Copy ID.
2. First call
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API"
{
"id": "987654321098765432",
"name": "My server",
"icon_url": "https://cdn.discordapp.com/icons/…",
"member_count": 1280,
"tier": "premium",
"plan": "premium",
"modules": ["welcome", "levels", "tickets"],
"bot_present": true,
"week": { "messages": 4210, "joins": 63, "leaves": 21, "commands": 530 },
"cases_open": 2,
"tickets_open": 1
}
If you get an error, look at its error field in the Error codes page. The most common ones: bad_api_key (key copied wrongly), missing_scope (the key lacks the guild.read scope) and plan_required (the server has no paid plan).
3. Read data
# The experience leaderboard (top 100)
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API/leaderboard?type=xp"
# A member's profile: level, XP, rank, balance, active warnings
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API/members/123456789012345678"
# Channels, 50 per page
curl -s -H "Authorization: Bearer $ROBERT_KEY" "$API/channels?limit=50"
4. Send your first message
You need a key with the messages.write scope. Robert hands the order to the bot, which posts the message; with ?wait=true the API waits for the result (up to 10 seconds) and returns it directly.
curl -s -X POST "$API/messages?wait=true" \
-H "Authorization: Bearer $ROBERT_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: welcome-001" \
-d '{
"channel_id": "800000000000000002",
"content": "Hello from my application!",
"embed": {
"title": "New release",
"description": "Version 2.0 is out.",
"color": "#0055A4"
}
}'
{ "action_id": "3f9c2a7e51b04d18a2c4e6f801d3b5a7", "status": "done", "result": { "message_id": "900000000000000123", "channel_id": "800000000000000002" } }
The Idempotency-Key header is optional but recommended: if you replay the same request with the same key within 24 hours, Robert returns the same result instead of posting a second message.
5. What next?
| I want to… | Page |
|---|---|
| Understand keys, scopes, pagination and headers | Authentication and scopes |
| See every route with its example | REST API reference |
| Receive what happens on the server | Events and Outgoing webhooks |
| Connect a game to a channel | Bridges and Minecraft step by step |
| Save time with a library | JavaScript SDK |
| Load the specification into a tool | openapi.json (OpenAPI 3.1) |
Spotted a mistake? Got a question? Let us know on the support server.