--- title: "Introduction to Slash Commands" slug: "introduction-to-slash-commands" updated: 2026-10-05T16:40:06Z published: 2026-10-05T16:40:06Z canonical: "developer.rocket.chat/introduction-to-slash-commands" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Introduction to Slash Commands Slash commands are shortcuts that run an action in a room, such as `/invite` or `/topic`. The Commands API lets an integration discover which commands a workspace offers and execute them programmatically, exactly as if a user had typed them into the message box. ## The command object Command endpoints return command objects. A trimmed example from [List Slash Commands](https://developer.rocket.chat/apidocs/list-slash-commands): ```json {  "commands": [    {      "command": "topic",      "params": "Slash_Topic_Params",      "description": "Slash_Topic_Description",      "clientOnly": false    },    {      "command": "invite",      "clientOnly": false    }  ],  "offset": 0,  "count": 22,  "total": 22,  "success": true } ``` Fields you use most often: - `command`: The command name, without the leading slash. Pass it as `command` when executing. - `params`: The parameters the command accepts, when it takes any. - `clientOnly`: Whether the command runs only in the client. Client-only commands cannot be executed through the API. ## Common workflows **Run a slash command from an integration** 1. [List the slash commands](https://developer.rocket.chat/apidocs/list-slash-commands) to see what is available, or [get one command's details](https://developer.rocket.chat/apidocs/get-slash-commands). 2. [Execute the command](https://developer.rocket.chat/apidocs/execute-a-slash-command) with the target `roomId` and any parameters. **Work with command previews** 1. [Get the command's preview data](https://developer.rocket.chat/apidocs/get-commands-preview-data) for the typed parameters - for example, GIF suggestions for `/giphy`. 2. [Execute the chosen preview item](https://developer.rocket.chat/apidocs/execute-commands-preview-item) to post it to the room. ## Conventions - Commands execute in a room: pass the `roomId` where the command should run, and the result appears in that room as it would for a typing user. - The available commands vary by workspace. Installed apps and integrations register their own commands, so list them rather than hard-coding names. - [List Slash Commands](https://developer.rocket.chat/apidocs/list-slash-commands) supports `count`, `offset`, and `sort` [query parameters](https://developer.rocket.chat/apidocs/query-parameters).