Overview
Bot endpoints manage custom Discord applications connected to RestoreCord. API-key auth can list, create, read, update, and delete owned bot records when the key has the required bot permissions.
API-key responses do not expose bot tokens or client secrets. Treat all token and secret updates as credential rotation events.
List Bots
Returns custom bots owned by the authenticated account, ordered newest first.
API key permission: READ_BOTS
/api/v3/botsList bots
Return owned custom bot metadata.
Response
{
"success": true,
"bots": [
{
"id": 42,
"username": "RestoreBot#0000",
"clientId": "123456789012345678",
"customDomain": "verify.example.com",
"domainStatus": "ACTIVE",
"isPresetDomain": false,
"activity": "your server",
"activityType": 10,
"createdAt": "2026-06-07T10:00:00.000Z"
}
],
"total": 1
}- Field
bots[].id- Type
- number
- Notes
- Internal RestoreCord bot id.
- Field
bots[].username- Type
- string
- Notes
- Stored Discord bot username.
- Field
bots[].clientId- Type
- string
- Notes
- Discord application id.
- Field
bots[].customDomain- Type
- string | null
- Notes
- Custom verification domain when configured.
- Field
bots[].domainStatus- Type
- string | null
- Notes
- Domain status such as
PENDINGorACTIVE.
- Field
bots[].isPresetDomain- Type
- boolean
- Notes
- Whether the domain is a RestoreCord preset domain.
- Field
bots[].activity- Type
- string | null
- Notes
- Configured bot presence text.
- Field
bots[].activityType- Type
- number | null
- Notes
- Discord activity type.
- Field
total- Type
- number
- Notes
- Number of returned bots.
Create Bot
Adds a Discord bot by validating the bot token against Discord, checking duplicate credentials, applying required application flags, registering the Discord deauthorization webhook, and starting the bot service asynchronously.
API key permission: WRITE_BOTS
/api/v3/botsCreate bot
Register a Discord application bot with RestoreCord.
botTokenRequired- Location
- body
- Type
- string
botSecretRequired- Location
- body
- Type
- string
- Plan
- Free
- Bot limit
- 1
- Plan
- Premium
- Bot limit
- 5
- Plan
- Business / Enterprise
- Bot limit
- 50
Request
{
"botToken": "DISCORD_BOT_TOKEN",
"botSecret": "DISCORD_CLIENT_SECRET"
}Response
{
"success": true,
"message": "Bot created successfully.",
"bot": {
"id": 42,
"name": "RestoreBot#0000",
"clientId": "123456789012345678"
}
}Get Bot
Returns one owned bot by Discord client id. API-key auth receives the public bot response; session auth can receive the full owner response.
API key permission: READ_BOTS
/api/v3/bots/{botId}Get bot
Return one owned bot record.
botIdRequired- Location
- path
- Type
- string
Response
{
"success": true,
"bot": {
"id": 42,
"username": "RestoreBot#0000",
"clientId": "123456789012345678",
"customDomain": "verify.example.com",
"domainStatus": "ACTIVE",
"isPresetDomain": false,
"activity": "your server",
"activityType": 10,
"createdAt": "2026-06-07T10:00:00.000Z",
"botToken": "DISCORD_BOT_TOKEN",
"botSecret": "DISCORD_CLIENT_SECRET"
},
"isOwner": true
}Use server-scoped bot helpers for sub-user flows. The direct bot record endpoint is owner-only.
Update Bot
Updates bot credentials and presence settings. If the bot token changes, RestoreCord verifies the token with Discord, updates the stored public key, restarts the bot service, and clears bot caches.
API key permission: WRITE_BOTS
/api/v3/bots/{botId}Update bot
Update credentials or presence for one owned bot.
botIdRequired- Location
- path
- Type
- string
botSecretOptional- Location
- body
- Type
- string
botTokenOptional- Location
- body
- Type
- string
activityOptional- Location
- body
- Type
- string | null
activityTypeOptional- Location
- body
- Type
- number | null
clientId and botId are not request body fields. botId is only the required URL path value in /api/v3/bots/{botId}.
Response
{
"success": true,
"message": "Bot successfully updated.",
"bot": {
"id": 42,
"username": "RestoreBot#0000",
"clientId": "123456789012345678",
"customDomain": "verify.example.com",
"domainStatus": "ACTIVE",
"activity": "your server",
"activityType": 10
}
}- Activity value
0- Common Discord meaning
- Playing
- Activity value
1- Common Discord meaning
- Streaming
- Activity value
2- Common Discord meaning
- Listening
- Activity value
3- Common Discord meaning
- Watching
- Activity value
5- Common Discord meaning
- Competing
- Activity value
10- Common Discord meaning
- Custom/status behavior used as the default in source.
Delete Bot
Deletes an owned custom bot only when no RestoreCord servers still use it.
API key permission: WRITE_BOTS
/api/v3/bots/{botId}Delete bot
Delete one owned bot if it is not attached to any RestoreCord servers.
botIdRequired- Location
- path
- Type
- string
Response
{
"success": true,
"message": "Bot successfully deleted."
}If the bot is still used by servers, the route returns 409 RESOURCE_IN_USE with the server list that must be deleted or moved first.
Runtime Controls
Bot lifecycle desired state is written through Convex-backed runtime controls. The routes are owner-authenticated and require WRITE_BOTS for API keys.
- Endpoint
POST /api/v3/bots/{botId}/runtime/start- Purpose
- Queue a bot start command.
- Endpoint
POST /api/v3/bots/{botId}/runtime/stop- Purpose
- Queue a bot stop command.
- Endpoint
POST /api/v3/bots/{botId}/runtime/restart- Purpose
- Queue stop then start commands for the runtime.
/api/v3/bots/{botId}/runtime/restartRestart bot
Queue a restart through the Convex runtime control plane.
botIdRequired- Location
- path
- Type
- string
{
"success": true,
"message": "Bot restart queued",
"stopCommandId": "stop:123456789012345678:1781690000000",
"startCommandId": "start:123456789012345678:1781690000001"
}Guild Helpers
Guild helpers use the bot token to list or leave Discord servers. Owners can list all guilds; sub-users with pull-member access receive only accessible guilds.
/api/v3/bots/{botId}/guildsList bot guilds
Return Discord guilds the bot is in, sorted by approximate member count.
botIdRequired- Location
- path
- Type
- string
List Guilds Response
{
"success": true,
"guilds": [
{
"id": "111111111111111111",
"name": "Community",
"icon": null,
"owner": false,
"permissions": "278032280691",
"memberCount": 1200
}
],
"total": 1,
"cached": false
}/api/v3/bots/{botId}/guildsLeave guilds
Owner-only helper that asks the bot to leave up to 50 guilds.
botIdRequired- Location
- path
- Type
- string
guildIdsRequired- Location
- body
- Type
- string[]
Leave Guilds Response
{
"success": true,
"message": "Successfully left 1 of 1 guilds",
"summary": {
"total": 1,
"successful": 1,
"failed": 0
},
"results": [
{
"guildId": "111111111111111111",
"success": true,
"message": "Successfully left guild"
}
]
}- Guild lists are cached briefly.
- Leave operations run one guild at a time with spacing between Discord requests.
- A partial failure returns per-guild result rows.
Status and Errors
- Status/code
200- When it appears
- Successful list, get, update, or guild response.
- Status/code
201- When it appears
- Bot created.
- Status/code
400 MISSING_FIELD- When it appears
- Required bot token, secret, or guild list missing.
- Status/code
400 INVALID_INPUT/VALIDATION_ERROR- When it appears
- Invalid token format, read-only client id in an update body, invalid activity, or guild id.
- Status/code
400 INVALID_CREDENTIALS- When it appears
- Discord rejects the bot token or the token does not match the client id.
- Status/code
403 FORBIDDEN- When it appears
- Missing API-key permission or plan limit reached.
- Status/code
404 NOT_FOUND- When it appears
- Bot or guild resource is not accessible.
- Status/code
409 DUPLICATE_RESOURCE- When it appears
- Bot token, client secret, or client id is already registered.
- Status/code
409 RESOURCE_IN_USE- When it appears
- Bot deletion blocked because RestoreCord servers still use it.
- Status/code
429/503 RATE_LIMITED- When it appears
- RestoreCord or Discord rate limiting.
- Status/code
502 EXTERNAL_SERVICE_ERROR- When it appears
- Discord API failure.