AstralAPI Docs
Resources

Application Commands

Register and manage slash commands, user commands, and message commands for your bot

Application Commands are the primary way for users to interact with your bot through Astral's interface. They appear in the command picker when a user types / in a text channel.

Command Types

TypeValueDescription
CHAT_INPUT1Slash command that appears when typing /
USER2Appears in the user context menu (right-click)
MESSAGE3Appears in the message context menu (right-click)

Command Object

FieldTypeDescription
idsnowflakeUnique ID of the command
application_idsnowflakeID of the parent application
guild_id?snowflakeGuild ID if guild-scoped, null for global
namestring1–32 character name (lowercase, no spaces for CHAT_INPUT)
descriptionstring1–100 character description (empty for USER/MESSAGE)
typeintegerOne of the command types above
options?arrayParameters for the command (max 25)
default_member_permissions?stringPermissions required to use the command
dm_permission?booleanWhether the command is available in DMs (default true)
versionintegerAuto-incrementing version counter

Command Options

Options define the parameters your slash command accepts.

FieldTypeDescription
typeintegerType of option (see below)
namestring1–32 character name
descriptionstring1–100 character description
required?booleanWhether this option must be provided
choices?arrayPre-defined choices (max 25)
options?arrayNested options for subcommands/groups
min_value?numberMinimum value (for INTEGER/NUMBER)
max_value?numberMaximum value (for INTEGER/NUMBER)
min_length?integerMinimum string length (0–6000)
max_length?integerMaximum string length (1–6000)

Option Types

TypeValueDescription
SUB_COMMAND1A subcommand
SUB_COMMAND_GROUP2A group of subcommands
STRING3Text input
INTEGER4Whole number (min/max supported)
BOOLEAN5True or false
USER6User mention
CHANNEL7Channel mention
ROLE8Role mention
MENTIONABLE9User or role mention
NUMBER10Decimal number (min/max supported)

Endpoints

Global Commands

Global commands are available in every guild your bot is in. They can take up to 1 hour to propagate.

List Global Commands

GET /applications/{application.id}/commands

Returns all global commands for the application.

Create Global Command

POST /applications/{application.id}/commands

Creates a new global command. Returns the created command object.

JSON Body:

FieldTypeRequiredDescription
namestringyesCommand name
descriptionstringnoCommand description
typeintegernoCommand type (default: 1)
optionsarraynoCommand options
default_member_permissionsstringnoRequired permissions
dm_permissionbooleannoAvailable in DMs

Example:

{
  "name": "ping",
  "description": "Check if the bot is alive",
  "type": 1,
  "options": []
}

Get Global Command

GET /applications/{application.id}/commands/{command.id}

Update Global Command

PATCH /applications/{application.id}/commands/{command.id}

Updates a global command. Only the fields you send are updated.

Delete Global Command

DELETE /applications/{application.id}/commands/{command.id}

Bulk Overwrite Global Commands

PUT /applications/{application.id}/commands

Replaces all global commands at once. Send an array of command objects. Commands not included will be deleted.

Bulk overwrite is destructive

Any existing commands not in the array will be permanently deleted. Use this for initial registration or full syncs, not incremental updates.

Guild Commands

Guild commands are available instantly and only in the specified guild.

MethodRouteDescription
GET/applications/\{app.id\}/guilds/\{guild.id\}/commandsList guild commands
POST/applications/\{app.id\}/guilds/\{guild.id\}/commandsCreate guild command
GET/applications/\{app.id\}/guilds/\{guild.id\}/commands/{cmd.id}Get guild command
PATCH/applications/\{app.id\}/guilds/\{guild.id\}/commands/{cmd.id}Update guild command
DELETE/applications/\{app.id\}/guilds/\{guild.id\}/commands/{cmd.id}Delete guild command
PUT/applications/\{app.id\}/guilds/\{guild.id\}/commandsBulk overwrite guild commands

All request/response bodies are identical to global command endpoints.

Rate Limits

ActionLimit
List commands5 per 5 seconds per application
Create command5 per 10 seconds per application
Update command5 per 10 seconds per application
Delete command5 per 10 seconds per application
Bulk overwrite2 per 30 seconds per application

Best Practices

  1. Use guild commands during development. They update instantly, while global commands can take up to an hour.
  2. Register commands once at startup, not on every bot restart. Use bulk overwrite (PUT) to sync your command definitions.
  3. Keep names lowercase and descriptive. Slash command names must be lowercase and can contain hyphens.
  4. Validate on your side too. The API validates command schemas, but catching errors early in your bot code saves API calls.
  5. Use default_member_permissions to restrict sensitive commands (e.g., ban, kick) to administrators without extra permission checks in your code.

On this page

Astral API Docs | Application Commands