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

# Message attachments

> Understand attachment metadata in ticket history and message webhooks.

YoLead exposes attachment metadata for newly processed Telegram, email, Facebook, and Instagram messages. For email, this includes Inbox messages and external messages discovered through Sent-folder synchronization. Attachment descriptors can appear in:

* `messages[].attachments` from [`GET /v1/tickets/{ticketId}/history`](/api-reference/tickets/get-ticket-history);
* `data.message.attachments` in [`ticket.created`](/webhooks/events#ticketcreated) and [`message.incoming`](/webhooks/events#messageincoming) webhooks.

Each attachment has this shape:

```json theme={null}
{
  "id": "64b000000000000000000002",
  "kind": "image",
  "fileName": "photo.jpg",
  "mimeType": "image/jpeg",
  "size": 4096,
  "width": 1280,
  "height": 720,
  "duration": 4
}
```

| Field      | Type      | Required | Description                                                                                         |
| ---------- | --------- | -------- | --------------------------------------------------------------------------------------------------- |
| `id`       | `string`  | Yes      | YoLead attachment identifier.                                                                       |
| `kind`     | `string`  | Yes      | `image`, `animation`, `audio`, `voice`, `video`, `video_note`, `document`, `sticker`, or `unknown`. |
| `fileName` | `string`  | No       | Original filename when the source channel supplies one.                                             |
| `mimeType` | `string`  | No       | MIME type when known.                                                                               |
| `size`     | `integer` | No       | File size in bytes when known.                                                                      |
| `width`    | `integer` | No       | Media width in pixels when known.                                                                   |
| `height`   | `integer` | No       | Media height in pixels when known.                                                                  |
| `duration` | `integer` | No       | Audio, animation, or video duration in seconds when known.                                          |

Only `id` and `kind` are guaranteed. Integrations must tolerate missing optional metadata and attachment kinds added in future versions.

Provider identifiers, temporary provider URLs, credentials, storage paths, and storage state are never included in the descriptor.

## Telegram albums

Telegram sends each album item as a separate message. Ticket history can include the same optional `mediaGroupId` on those messages so an integration can group them. Each Telegram message contains at most one attachment descriptor.

`mediaGroupId` is currently part of Public API ticket history messages; it is not included in message webhook objects.

## Availability and history

Attachment metadata is available only for messages processed after attachment support was enabled. Existing messages and history imported from a source channel are not backfilled, so older messages can have an empty `attachments` array even when the original provider message contained a file.

The Public API exposes attachment metadata but does not currently provide an API-key-authenticated endpoint for downloading attachment bytes. YoLead's authenticated application and embedded iframe can display or download files when they are still available. Do not construct a download URL from the attachment `id`.
