---
title: "Registers a global slash command for a Discord bot."
method: POST
path: "/registerGlobalSlashCommand"
---

# Registers a global slash command for a Discord bot.

`POST /registerGlobalSlashCommand`

This function creates a new slash command that can be used in any guild where the bot is present. It takes a single object parameter defining the command's properties and returns a Promise that resolves to the registered command object.

## Request body

- object
  - `body` object — Body of the registerGlobalSlashCommand sls call
    - `arguments` unknown[], required
      - unknown
    - `auth` object — Authentication object
      - `strategy` 'apikey' — Authentication strategy
      - `variables` unknown[] — Variables for the authentication strategy
        - unknown
    - `packageName` string — @microfox/discord

## Response `200`

Successfully registered the global slash command

- object — The registered command object
  - `id` string — The unique identifier of the registered command
  - `application_id` string — The ID of the application the command belongs to
  - `name` string — The name of the registered command
  - `description` string — The description of the registered command

## Other responses

- `400` — Bad Request - Invalid command properties provided
- `401` — Unauthorized - Invalid bot token or lacking required permissions
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error

---

[API](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api.md) · [All operations](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/microfox-ai/microfox-discord-sdk-api/versions/7cb5b64ae924/schema)
