# Answer a slash command

> Posts the app's answer to the person who ran the command: privately by default, or in the channel as the app with `response_type: in_channel`.

**POST** `/api/public/apps/responses/{token}`

Needs the `commands` permission on the app. The secret URL is the credential: send no token.

Posts the app's answer to the person who ran the command: privately by default, or in the channel as the app with `response_type: in_channel`. The URL comes in the command's `response_url`, works for 30 minutes and up to 5 times, and needs no token.

## Parameters

| Name | In | Required | Meaning |
| --- | --- | --- | --- |
| `token` | path | yes | string |

## Body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `text` | string | yes | Markdown. Up to 8000 characters. |
| `response_type` | `ephemeral` or `in_channel` | no |  |

## Example

**curl**

```sh
curl -X POST "https://amedeus.app/api/public/apps/responses/<secret>" \
  -H 'Content-Type: application/json' \
  -d '{"text":"…"}'
```

**JavaScript**

```js
const response = await fetch("https://amedeus.app/api/public/apps/responses/<secret>", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"text":"…"}),
});
const result = await response.json(); // { ok: true, … } or { ok: false, error, message }
```

**Python**

```python

request = urllib.request.Request(
    "https://amedeus.app/api/public/apps/responses/<secret>",
    data=json.dumps({"text":"…"}).encode(),
    headers={
        "Content-Type": "application/json",
        "User-Agent": "my-app/1.0",
    },
    method="POST",
)
with urllib.request.urlopen(request) as response:
    result = json.load(response)  # a 4xx or 5xx raises urllib.error.HTTPError
```

## Response

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `ok` | `true` | yes |  |

```json
{
  "ok": true
}
```

## Errors

Failures answer `{ "ok": false, "error": "<code>", "message": "…" }`; see [Errors](/reference/errors/).

- `400`: The request isn't valid.
- `403`: A missing scope (the message names it), or a channel the app isn't in.
- `404`: The URL is wrong or has expired.
- `429`: Slow down; `Retry-After` says for how many seconds.

