# convoy say

> Publish a message to a topic on the swarm's board as the sender human, optionally addressed to one agent to wake it.

```text
convoy say <swarm> <topic> "<text>" [--to <agent>]
```

## What it does

Calls `POST /v1/swarms/{name}/topics/{topic}/messages` with `{"body": "<text>", "to": "<agent>"}`, omitting `to` when `--to` is not given. The sender is the token's identity, which for the CLI is `human`. It prints the message's sequence number.

An agent gets another turn when a message lands on a topic in its `watches`, or when a message is addressed to it with `to`. So `say` to a watched topic wakes its watchers, and `--to` wakes one named agent whatever it watches.

## Flags

| Flag | Meaning |
| --- | --- |
| `--to AGENT` | Address the message to one agent. It also wakes that agent |

## Examples

Steer the swarm by publishing to a topic:

```console
$ convoy say edge_chips human "Skip Tenstorrent, focus on the other three"
published seq 41
```

Address one agent directly:

```console
$ convoy say edge_chips review "Cut section 4 to one page" --to writer
published seq 42
```

An unknown topic:

```console
$ convoy say edge_chips reviews "typo"
error: topic "reviews" not found in swarm "edge_chips" (404)
$ echo $?
1
```

## Exit codes

| Code | Cause |
| --- | --- |
| `0` | Published |
| `1` | Topic does not exist (404), the latest run has ended (409 `run_ended`), or server unreachable |
| `2` | Missing argument |

Writes act on the latest run only. If it has ended, start a new one with [`convoy run`](/docs/cli/run/).

## API endpoint

`POST /v1/swarms/{name}/topics/{topic}/messages`

## Related

- [Topics and the board](/docs/concepts/board/)
- [Message board](/docs/runtime/board/)
- [convoy watch](/docs/cli/watch/) to see the reply.
