> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avazal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Messages and conversations

> Read Slack channels, DMs and email threads, post, reply, draft, schedule, react and organise, through one set of operations.

A conversation is a Slack channel or DM, or an email thread. A message is a chat message or an email. The same operations work on both, and `source` (`slack` or `gmail`) says which one an item came from. Reading needs `messages:read`, changes need `messages:write`, and sending needs `messages:send`.

## Find a conversation

Start with your connected accounts: Slack workspaces (`chws_…`) and mailboxes (`macc_…`).

```bash theme={null}
avazal accounts.list
avazal conversations.list --account chws_…
avazal conversations.list --source gmail --tab needs_reply
```

`conversations.list` returns channels and DMs, most recently active first, with `unread` and `mentions` counts. For email it returns threads, newest first, narrowed by `tab` (`needs_reply`, `updates`, `other` or `all`) or `folder: "drafts"`. Every item has an `id` that all other operations take, and a `url` that opens it in Avazal.

Set `membership: "all"` with a `query` to browse public Slack channels you have not joined. To find a conversation or message by content, use [`search.query`](https://docs.avazal.com/concepts/links). If you have a link, [`search.resolve`](https://docs.avazal.com/concepts/links) returns the id.

`conversations.get` returns the conversation with its newest messages and `hasOlder`. For an email thread it also returns the reply `draft` Avazal prepared, if any.

## Read messages

```bash theme={null}
avazal messages.list --conversation chcv_…
avazal messages.get '{"id": "chcv_…@1733050000.123456"}'
```

A chat message id is the conversation id, `@`, and the Slack timestamp. Every message has a `url` and a `markdown` field with mentions written as `@name`; Slack's structured content is under `provider`. `messages.get` returns the message and, when it starts or replies in a thread, `thread.root` and every reply, oldest first.

`messages.list` takes one filter to choose what to list:

| Filter | Lists |
| - | - |
| `conversation` | A conversation's messages, newest first (an email thread oldest first) |
| `thread` | A chat thread's root, then its replies |
| `state: "draft"` or `"scheduled"` | Unsent messages. Add `source` to pick Slack or email |
| `mine: true` | Messages you sent |
| `pinned: true` | A conversation's pinned messages |
| `saved` | Messages you saved for later, by `in_progress`, `archived` or `completed` |
| `following: true` | Threads you follow |
| `activity` | Your activity feed: `all`, `mentions`, `threads` and more |
| `query` | Search, with `from`, `after`, `before`, `has` (`link`, `file`, `reaction` or `pin`) and `sort` (`relevant` or `newest`) |

## Post and reply

```bash theme={null}
curl -X POST https://api.avazal.com/v1/messages.create \
  -H "Authorization: Bearer $AVAZAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"conversation": "chcv_…", "thread": "chcv_…@1733050000.123456", "text": "On it, I will have the numbers by 3pm."}'
```

* Send `text` for plain text or `content` for rich text blocks. One of the two is required, except when asking Avazal to write an email reply.
* Set `thread` to the root message's id to reply in a thread. Add `broadcast: true` to also show the reply in the channel.
* `sendAt` schedules the message instead of sending it now.
* `draft: true` saves it for a person to review and sends nothing. A draft needs `messages:write`; sending needs `messages:send`. Sending is [outward](https://docs.avazal.com/authentication.md#risk): it reaches Slack or email straight away.

`messages.update` edits a message or draft you wrote (`text` or `content`, and for email `recipients`, `subject` and `attachments`). `messages.delete` deletes a message you posted for everyone, discards a draft, or cancels a scheduled send. `messages.send` sends a draft or scheduled message now.

## React

`reactions.create` adds your emoji to a chat message and `reactions.delete` removes it. The `target` is the message id and `emoji` is the Slack name without colons. `emoji.list` returns a workspace's custom emoji.

```bash theme={null}
avazal reactions.create '{"target": "chcv_…@1733050000.123456", "emoji": "eyes"}'
```

Both need `messages:write` and are `outward`, because everyone in the conversation sees them.

## Your own message state

`messages.update` also changes state only you see, so these are `inApp`:

* `pinned` pins or unpins a message for the conversation.
* `read: true` reads up to this message; `read: false` marks it unread from here.
* `saved` saves it for later, as `{"state": "in_progress", "remindAt": "2026-12-02T09:00:00Z"}`, or `null` to remove it.
* `done` clears or restores an activity item.

```bash theme={null}
avazal messages.update '{"id": "chcv_…@1733050000.123456", "saved": {"remindAt": "2026-12-02T09:00:00Z"}}'
```

`notifications.create` reminds you, or notifies a person in the conversation, about a message. It needs `automations:write`.

## Manage conversations

`conversations.create` makes a Slack channel (`name`, and `private`) or opens a DM or group DM (`members`, Slack member ids from [`people.list`](https://docs.avazal.com/guides/people)). `conversations.update` changes a conversation: `name`, `topic`, `purpose`, `archived`, `joined`, `open: false` to hide a DM, `addMembers`, `removeMembers` and `read`. For an email thread it takes only `archived` and `read`, and the change syncs to the mailbox. `people.list` with `conversation` lists a channel's members.

`links.list`, `links.create`, `links.update` and `links.delete` manage a channel's bookmarks, with `from` set to the conversation id.

## Email

Email threads are conversations with `mthr_…` ids; their messages have `mmsg_…` ids.

**1. Get a reply draft**

Call `messages.create` with `conversation` set to the thread and no body. Avazal writes the draft in the background; read the thread with `conversations.get` until `draft` is ready.

**2. Send it**

Edit it with `messages.update` if you like, then send it with `messages.send`, passing the draft's `mdrf_…` id and `conversation`. Set `sendAt` to schedule it.

To write a new email, pass `account` (a mailbox), `to`, `subject` and `text` to `messages.create`, with `draft: true` to save it as an `mcmp_…` draft. Pass `from` to send from one of the mailbox's send-as addresses, listed under `provider.sendAs` in `accounts.list`. Pass `forward` with a message id to forward it, quoted with its attachments.

`messages.send` also sends an `mcmp_…` draft, and sends a scheduled `mout_…` email immediately. Cancelling a scheduled email with `messages.delete` puts it back as a draft. Until an email leaves, `messages.update` with `sendAt` reschedules it.

The MCP prompts `triage_inbox` and `draft_reply` walk the inbox and prepare replies, and only send once you approve.

## Files and attachments

`files.list` lists files shared in a workspace or conversation, `files.get` reads one, and for a received email attachment returns its bytes. Pass `<email id>#<index>` as the id, counting attachments from 0.

`files.create` uploads a file for an email, as base64 `data` with a `filename` and `contentType`, and returns an `att_…` id. One message can carry at most 25 MB. `files.delete` removes an upload you no longer need.

## Answer @mentions

An agent with an identity can wait for people to call it by @handle with `inbox.next`, and reply with `messages.create`. See [Identities and runs](https://docs.avazal.com/guides/identities.md#answer-mentions).

## In MCP

Each operation on this page is an action of one MCP tool. The [tool catalogue](https://docs.avazal.com/mcp-tools.md) lists every tool with its fields.

| Operation | MCP tool |
| - | - |
| `accounts.list` | `whoami (type accounts)` |
| `conversations.list` | `search (type conversation)` |
| `search.query` | `search (type everything)` |
| `search.resolve` | `read (type link)` |
| `conversations.get` | `read (type conversation)` |
| `messages.list` | `search (type message)` |
| `messages.get` | `read (type message)` |
| `messages.create` | `send (action send)` |
| `messages.update` | `message (action update)` |
| `messages.delete` | `message (action delete)` |
| `messages.send` | `send (action send_draft)` |
| `reactions.create` | `message (action react)` |
| `reactions.delete` | `message (action unreact)` |
| `emoji.list` | `search (type emoji)` |
| `notifications.create` | `follow_up (action remind)` |
| `conversations.create` | `conversation (action create)` |
| `people.list` | `search (type person)` |
| `conversations.update` | `conversation (action update)` |
| `links.list` | `read (type links)` |
| `links.create` | `link (action create)` |
| `links.update` | `link (action update)` |
| `links.delete` | `link (action delete)` |
| `files.list` | `search (type file)` |
| `files.get` | `read (type file)` |
| `files.create` | `upload (action create)` |
| `files.delete` | `upload (action delete)` |
| `inbox.next` | `inbox (type prompts)` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.