> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Inbound message anatomy

An incoming message is a `Message`. The same shape applies whether it came from Slack, the web chat, or any other adapter.

#### Node

**`Message`**

| Field             | Type              | Required | Notes                                                                              |
| ----------------- | ----------------- | -------- | ---------------------------------------------------------------------------------- |
| `id`              | string            | yes      | UUID assigned by the sidecar.                                                      |
| `timestamp`       | `Timestamp`       | yes      | When the platform received the message.                                            |
| `platform`        | string            | yes      | `"slack"`, `"web"`, `"discord"`, etc.                                              |
| `platformContext` | `PlatformContext` | yes      | Platform-native IDs and event metadata.                                            |
| `user`            | `User`            | yes      | Sender identity.                                                                   |
| `content`         | string            | yes      | Cleaned text. Adapters strip the bot's @-mention before forwarding.                |
| `attachments`     | `Attachment[]`    | no       | Files, images, video, audio, link previews.                                        |
| `conversationId`  | string            | yes      | Stable correlation ID across the message lifecycle. Always echo back on responses. |

**`Timestamp`** (google.protobuf.Timestamp)

| Field     | Type   | Notes                                                                   |
| --------- | ------ | ----------------------------------------------------------------------- |
| `seconds` | string | Seconds since UNIX epoch. Encoded as a string (can exceed JS safe int). |
| `nanos`   | number | Nanoseconds within the second.                                          |

**`User`**

| Field       | Type                        | Required | Notes                                             |
| ----------- | --------------------------- | -------- | ------------------------------------------------- |
| `id`        | string                      | yes      | Platform-specific user ID.                        |
| `username`  | string                      | no       | Display name or handle.                           |
| `avatarUrl` | string                      | no       | Avatar URL.                                       |
| `email`     | string                      | no       | Email if available.                               |
| `userData`  | `{ [key: string]: string }` | no       | Platform-specific extras (workspace, role, etc.). |

**`Attachment`**

| Field         | Type   | Required | Notes                                                                                                                            |
| ------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `type`        | string | yes      | One of the enum values below.                                                                                                    |
| `url`         | string | no       | Download URL when the source provides one. Filesystem-backed web uploads leave this empty.                                       |
| `filename`    | string | no       | Original filename.                                                                                                               |
| `sizeBytes`   | number | no       | File size in bytes.                                                                                                              |
| `mimeType`    | string | no       | MIME type.                                                                                                                       |
| `title`       | string | no       | Display title (rich attachments).                                                                                                |
| `description` | string | no       | Display description.                                                                                                             |
| `width`       | number | no       | For images/videos.                                                                                                               |
| `height`      | number | no       | For images/videos.                                                                                                               |
| `storageKey`  | string | no       | Opaque Files API key for a web-chat upload. Resolve it through `AGENT_FILES_DIR`; never construct an input path from `filename`. |

`Attachment.type` values: `TYPE_UNSPECIFIED`, `IMAGE`, `FILE`, `VIDEO`, `AUDIO`, `LINK`.

**`PlatformContext`**

| Field          | Type                        | Required | Notes                                                                                          |
| -------------- | --------------------------- | -------- | ---------------------------------------------------------------------------------------------- |
| `messageId`    | string                      | yes      | Original platform message ID.                                                                  |
| `channelId`    | string                      | yes      | Channel/room/chat ID.                                                                          |
| `threadId`     | string                      | no       | Agent's reply target. Also set on top-level messages whose response should open a new thread.  |
| `threadRootId` | string                      | no       | Parent thread root timestamp. Set only when this message is a reply inside an existing thread. |
| `channelName`  | string                      | no       | Display channel name.                                                                          |
| `workspaceId`  | string                      | no       | Slack workspace, Discord guild, etc.                                                           |
| `botUserId`    | string                      | no       | The bot's own user ID in the source platform.                                                  |
| `userId`       | string                      | no       | Raw platform-native sender ID before any cross-platform identity resolution.                   |
| `eventKind`    | string                      | yes      | See `PlatformContextEventKind` below.                                                          |
| `platformData` | `{ [key: string]: string }` | no       | Platform-specific extras (Slack `ts`, Discord snowflake, Teams activity ID).                   |

**`PlatformContextEventKind`**

| Value                                 | When the adapter emits it                          |
| ------------------------------------- | -------------------------------------------------- |
| `EVENT_KIND_UNSPECIFIED`              | Fallback. Should not appear in production traffic. |
| `EVENT_KIND_DM`                       | 1:1 / private chat (Slack DM, web chat session).   |
| `EVENT_KIND_APP_MENTION`              | Bot was @-mentioned in a channel or thread.        |
| `EVENT_KIND_THREAD_REPLY`             | Reply inside an existing thread, no @-mention.     |
| `EVENT_KIND_OBSERVED`                 | Observe-channel forward (listen-only).             |
| `EVENT_KIND_REACTION`                 | Reaction added/removed.                            |
| `EVENT_KIND_BUTTON_CLICK`             | Interactive button click on a `CardAttachment`.    |
| `EVENT_KIND_SLASH_COMMAND`            | Slash command (Slack/Discord).                     |
| `EVENT_KIND_ASSISTANT_THREAD_STARTED` | Slack assistant thread opened.                     |

#### Python

**`Message`**

| Field              | Type                        | Required | Notes                                                                              |
| ------------------ | --------------------------- | -------- | ---------------------------------------------------------------------------------- |
| `id`               | string                      | yes      | UUID assigned by the sidecar.                                                      |
| `timestamp`        | `google.protobuf.Timestamp` | yes      | When the platform received the message.                                            |
| `platform`         | string                      | yes      | `"slack"`, `"web"`, `"discord"`, etc.                                              |
| `platform_context` | `PlatformContext`           | yes      | Platform-native IDs and event metadata.                                            |
| `user`             | `User`                      | yes      | Sender identity.                                                                   |
| `content`          | string                      | yes      | Cleaned text. Adapters strip the bot's @-mention before forwarding.                |
| `attachments`      | `repeated Attachment`       | no       | Files, images, video, audio, link previews.                                        |
| `conversation_id`  | string                      | yes      | Stable correlation ID across the message lifecycle. Always echo back on responses. |

**`User`**

| Field        | Type                  | Required | Notes                                             |
| ------------ | --------------------- | -------- | ------------------------------------------------- |
| `id`         | string                | yes      | Platform-specific user ID.                        |
| `username`   | string                | no       | Display name or handle.                           |
| `avatar_url` | string                | no       | Avatar URL.                                       |
| `email`      | string                | no       | Email if available.                               |
| `user_data`  | `map<string, string>` | no       | Platform-specific extras (workspace, role, etc.). |

**`Attachment`**

| Field         | Type   | Required | Notes                                                                                                                            |
| ------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `type`        | enum   | yes      | See `Attachment.Type` below.                                                                                                     |
| `url`         | string | no       | Download URL when the source provides one. Filesystem-backed web uploads leave this empty.                                       |
| `filename`    | string | no       | Original filename.                                                                                                               |
| `size_bytes`  | int64  | no       | File size in bytes.                                                                                                              |
| `mime_type`   | string | no       | MIME type.                                                                                                                       |
| `title`       | string | no       | Display title (rich attachments).                                                                                                |
| `description` | string | no       | Display description.                                                                                                             |
| `width`       | int32  | no       | For images/videos.                                                                                                               |
| `height`      | int32  | no       | For images/videos.                                                                                                               |
| `storage_key` | string | no       | Opaque Files API key for a web-chat upload. Resolve it through `AGENT_FILES_DIR`; never construct an input path from `filename`. |

**`Attachment.Type`**: `TYPE_UNSPECIFIED` (0), `IMAGE` (1), `FILE` (2), `VIDEO` (3), `AUDIO` (4), `LINK` (5). Access via `Attachment.IMAGE` etc.

**`PlatformContext`**

| Field            | Type                  | Required | Notes                                                                                          |
| ---------------- | --------------------- | -------- | ---------------------------------------------------------------------------------------------- |
| `message_id`     | string                | yes      | Original platform message ID.                                                                  |
| `channel_id`     | string                | yes      | Channel/room/chat ID.                                                                          |
| `thread_id`      | string                | no       | Agent's reply target. Also set on top-level messages whose response should open a new thread.  |
| `thread_root_id` | string                | no       | Parent thread root timestamp. Set only when this message is a reply inside an existing thread. |
| `channel_name`   | string                | no       | Display channel name.                                                                          |
| `workspace_id`   | string                | no       | Slack workspace, Discord guild, etc.                                                           |
| `bot_user_id`    | string                | no       | The bot's own user ID in the source platform.                                                  |
| `user_id`        | string                | no       | Raw platform-native sender ID before any cross-platform identity resolution.                   |
| `event_kind`     | enum                  | yes      | See `PlatformContext.EventKind` below.                                                         |
| `platform_data`  | `map<string, string>` | no       | Platform-specific extras (Slack `ts`, Discord snowflake, Teams activity ID).                   |

**`PlatformContext.EventKind`** (access via `PlatformContext.EVENT_KIND_DM` etc.)

| Value                                     | When the adapter emits it                          |
| ----------------------------------------- | -------------------------------------------------- |
| `EVENT_KIND_UNSPECIFIED` (0)              | Fallback. Should not appear in production traffic. |
| `EVENT_KIND_DM` (1)                       | 1:1 / private chat (Slack DM, web chat session).   |
| `EVENT_KIND_APP_MENTION` (2)              | Bot was @-mentioned in a channel or thread.        |
| `EVENT_KIND_THREAD_REPLY` (3)             | Reply inside an existing thread, no @-mention.     |
| `EVENT_KIND_OBSERVED` (4)                 | Observe-channel forward (listen-only).             |
| `EVENT_KIND_REACTION` (5)                 | Reaction added/removed.                            |
| `EVENT_KIND_BUTTON_CLICK` (6)             | Interactive button click on a `CardAttachment`.    |
| `EVENT_KIND_SLASH_COMMAND` (7)            | Slash command (Slack/Discord).                     |
| `EVENT_KIND_ASSISTANT_THREAD_STARTED` (8) | Slack assistant thread opened.                     |

For web-chat file input and agent-produced downloads, see [Files in chat](/messaging-sdk/files-in-chat).

## Next steps

* [Sending a response](/messaging-sdk/responses): reply to what arrived
* [Receiving platform feedback](/messaging-sdk/feedback): reactions, edits, and stream control