# Send a message to a running agent.

> https://koi.dog/docs/api/agents/steer-agent/

`POST /api/v1/agents/{id}/steer` · Scope: `crews`

No query parameters.

## Path parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The agent's id. |

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Makes a retry safe: the same key with the same request returns the first answer and does nothing else. |

## Body.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | `string` | yes | The message, sent to the running agent as written. At least 1 character. |

## Response.

200 OK: a JSON object. The example has placeholder values.

- **422 validation_failed**: The body does not match its schema; each problem is in `details`.

## Request.

```sh
curl -X POST "https://app.koi.dog/api/v1/agents/$ID/steer" \
    -H "Authorization: Bearer $KOIDOG_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{
      "text": "Use the existing colour tokens."
    }'
```

```js
const res = await fetch(`https://app.koi.dog/api/v1/agents/${process.env.ID}/steer`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    text: "Use the existing colour tokens.",
  }),
});
console.log(await res.json());
```

```python
import os
import uuid

import requests

r = requests.post(
    f"https://app.koi.dog/api/v1/agents/{os.environ['ID']}/steer",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "text": "Use the existing colour tokens.",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

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