---
title: "Execute a command"
method: POST
path: "/api/v4/commands/execute"
tags: ["commands"]
---

# Execute a command

`POST /api/v4/commands/execute`

Execute a command on a team.
##### Permissions
Must have `use_slash_commands` permission for the team the command is in.

## Request body

- object
  - `channel_id` string, required — Channel Id where the command will execute
  - `command` string, required — The slash command to execute, including parameters. Eg, `'/echo bounces around the room'`

## Response `200`

Command execution successful

- 38cb7293CommandResponse
  - `ResponseType` string — The response type either in_channel or ephemeral
  - `Text` string
  - `Username` string
  - `IconURL` string
  - `GotoLocation` string
  - `Attachments` 38cb7293SlackAttachment[]
    - `Id` string
    - `Fallback` string
    - `Color` string
    - `Pretext` string
    - `AuthorName` string
    - `AuthorLink` string
    - `AuthorIcon` string
    - `Title` string
    - `TitleLink` string
    - `Text` string
    - `Fields` 38cb7293SlackAttachmentField[]
      - `Title` string
      - `Value` string — The value of the attachment, set as string but capable with golang interface
      - `Short` boolean
    - `ImageURL` string
    - `ThumbURL` string
    - `Footer` string
    - `FooterIcon` string
    - `Timestamp` string — The timestamp of the slack attachment, either type of string or integer

## Other responses

- `400` — Invalid or missing parameters in URL or request body
- `401` — No access token provided
- `403` — Do not have appropriate permissions
- `501` — Feature is disabled

---

[API](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools.md) · [All operations](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infomaniak/api-reference-developer-tools/revisions/667aae28fec6/schema)
