---
title: "Discord Slash Command Generator: JSON for the API | VulCode"
description: "Build a Discord slash command: set the name, options and types, preview it and copy the JSON to register it with the API. Free, in your browser."
url: "https://vulcode.com/en/tools/discord-slash-command-builder"
lang: "en"
---

[Home](https://vulcode.com/en) [Resources](https://vulcode.com/en/resources) [Tools](https://vulcode.com/en/tools)

# Discord slash command generator

Build a Discord slash command: set the name, options and types, preview it and copy the JSON to register it with the API. Free, in your browser.

[Free quote](https://vulcode.com/en/quote) [Full pricing](https://vulcode.com/en/services/pricing)

Name (3 / 32)

Discord takes /ban: lower case letters, digits, - and _ only.

Scope

One server Global

Description (36 / 100)

Discord rejects a description longer than 100 characters.

Options 1 / 25

- Option 1 name
  Option 1 type
  Option 1 description
  Required
  Remove

Add an option

In the JSON required options go before optional ones, as Discord requires.

## Preview in Discord

/ban user Bans a user from the server for good

Enter the command name.

- Where to send it
  `POST /applications/{application.id}/guilds/{guild.id}/commands`
  Copy

## Request body

Copy the JSON

```
{
  "name": "ban",
  "description": "Bans a user from the server for good",
  "type": 1,
  "options": [
    {
      "name": "user",
      "description": "Who to ban",
      "type": 6,
      "required": true
    }
  ]
}
```

Enter the command name and description.

## How to use it in three steps

Step by step, with this page's example.

- Give the command a name and description.

- Add options with types and requirements.

- Copy the JSON and register the command with the API.

What you enter

Name "Ticket", an optional option details and a required option topic, both text

What you get

```
{
  "name": "ticket",
  "description": "Open a ticket",
  "type": 1,
  "options": [
    {
      "name": "topic",
      "description": "What it is about",
      "type": 3,
      "required": true
    },
    {
      "name": "details",
      "description": "More about the ticket",
      "type": 3,
      "required": false
    }
  ]
}
```

## Questions

- **What is a Discord slash command?**: It is a command starting with / that a bot registers with the Discord API along with a description and options, so Discord suggests it to users.
- **How do I register a slash command with the Discord API?**: Send the JSON from the tool with a POST request to the application commands endpoint: /applications/{application.id}/commands for a global command or /applications/{application.id}/guilds/{guild.id}/commands for one server.
- **What does type 3 mean?**: It is the STRING option type. Discord numbers types: 3 is text, 4 an integer, 6 a user, 7 a channel, 8 a role.
- **How is a global command different from a server command?**: A command registered for one server is available right away; a global one works on every server with the bot and needs a moment for Discord to propagate it.
- **How many slash commands can a bot have?**: Up to 100 global slash commands per application, plus up to 100 commands for each server.

## Related tools

The tool does one job. If the same thing should happen automatically in your bot, server or system, we build it.

- ### [Bot invite link](https://vulcode.com/en/tools/discord-bot-invite-link)
  Build an OAuth2 URL with scopes and permissions, ready to share.

- ### [Discord permissions calculator](https://vulcode.com/en/tools/discord-permissions-calculator)
  Click permissions and get the bitfield for a role or a bot invite.

- ### [JSON formatter and validator](https://vulcode.com/en/tools/json-formatter)
  Paste JSON and get it formatted, or the exact place of the error.

- ### [Discord bots](https://vulcode.com/en/services/discord-bots)
  When the same thing should happen automatically in your bot, server or system.

## Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.

[Free quote](https://vulcode.com/en/quote) [Free consultation](https://vulcode.com/en/consultation)

- [hello@vulcode.com](mailto:hello@vulcode.com)

- [+48 576 043 920](tel:+48576043920)

- [discord.gg/vulcode](https://discord.gg/vulcode)
