<!-- Generated from the canonical 99 Digital API documentation. Do not edit this file. -->

Canonical page: https://docs.99digital.co.il/online-api/conversations/list-conversation-attachments

# List Conversation Attachments

`GET https://online.99digital.co.il/api/v1/accounts/{account_id}/conversations/{conversation_id}/attachments`

Returns all files sent in the conversation, from both the contact and agents.

Each item is one file, with the message it belongs to and who sent it. The
whole list is returned at once.

| Setting | Value |
| --- | --- |
| **Method** | `GET` |
| **Path** | `/api/v1/accounts/{account_id}/conversations/{conversation_id}/attachments` |
| **Authorization** | User token. |

**Permissions:**

- User token: any agent who can see the conversation — see
  [Who can see a conversation](https://docs.99digital.co.il/online-api/conversations/conversation-basics#who-can-see-a-conversation).
- Agent-bot token: not allowed.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `account_id` | integer | Yes | Account ID. |
| `conversation_id` | integer | Yes | Conversation display ID. |

**Example request**

```bash
curl -X GET 'https://online.99digital.co.il/api/v1/accounts/12/conversations/1501/attachments' \
  -H 'api_access_token: <YOUR_API_ACCESS_TOKEN>'
```

**Example response** (`200 OK`). A conversation without files returns
`{"payload": []}`.

```json
{
  "payload": [
    {
      "message_id": 40111,
      "thumb_url": "https://online.99digital.co.il/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzIwMX19--b7c1/invoice.png",
      "data_url": "https://online.99digital.co.il/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzIwMX19--b7c1/invoice.png",
      "file_size": 48213,
      "file_type": "image",
      "extension": null,
      "created_at": 1794471100,
      "sender": { "id": 51, "name": "Jane Agent", "type": "user" }
    }
  ]
}
```

## Remarks

- For a paginated list of the files, with their attachment IDs, use
  [List Conversation Files](https://docs.99digital.co.il/online-api/messages/list-conversation-files).

## Authentication

`api_access_token` in the header — Your access token. A user token is in the dashboard under **Profile settings → Access Token**, and grants exactly what that agent's role allows. An agent-bot token may call only the endpoints marked for agent bots. See [Getting Started](https://docs.99digital.co.il/online-api/getting-started#authentication).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `account_id` | path | integer | Yes | The numeric ID of your account: the number after `/app/accounts/` in the dashboard URL. Example: `12`. |
| `conversation_id` | path | integer | Yes | The numeric ID of the conversation: its display ID, which is the `id` in conversation responses and the number in the dashboard URL. Example: `1501`. |

## Responses

### 200 — The files of the conversation.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `payload` | array of object | The files. Empty when the conversation has no files. |
| `payload[].message_id` | integer | The message the file belongs to. |
| `payload[].thumb_url` | string | The URL of a thumbnail, for images. |
| `payload[].data_url` | string | The URL of the file. |
| `payload[].file_size` | integer | The size in bytes. |
| `payload[].file_type` | string | The kind of file: `image`, `audio`, `video`, `file`, `location`, `fallback`, …. |
| `payload[].extension` | string \| null | The file extension, when known. |
| `payload[].created_at` | integer | When the message was sent (Unix time, seconds). |
| `payload[].sender` | object | An object containing the sender's data: who sent a message — the contact (`type` `contact`), an agent (`user`) or an agent bot (`agent_bot`). Its fields follow the kind of sender — a contact has `phone_number` and `identifier`, an agent has `available_name` and `availability_status`. Activity messages have no sender. |
| `payload[].sender.id` | integer | The sender's ID — the ID of the contact, agent or agent bot. |
| `payload[].sender.name` | string | The sender's name. |
| `payload[].sender.type` | string | The sender type. One of: `contact` — The contact; `user` — An agent; `agent_bot` — An agent bot. |
| `payload[].sender.available_name` | string | An agent's display name. |
| `payload[].sender.email` | string \| null | The sender's email address. |
| `payload[].sender.phone_number` | string \| null | The sender's phone number (a contact's). |
| `payload[].sender.identifier` | string \| null | A unique identifier for the contact in your external system (contacts only). |
| `payload[].sender.avatar_url` | string | An agent's avatar image URL. |
| `payload[].sender.logo_user_url` | string \| null | An agent's logo URL, or `null`. |
| `payload[].sender.thumbnail` | string | The sender's avatar URL, or an empty string. |
| `payload[].sender.availability_status` | string | An agent's live presence (`online`, `busy` or `offline`). |
| `payload[].sender.blocked` | boolean | Whether a contact is blocked. |
| `payload[].sender.additional_attributes` | object | An object containing the additional attributes related to the sender (a contact). |
| `payload[].sender.custom_attributes` | object | An object containing the custom attributes related to the sender (a contact). |

#### Example

```json
{
  "payload": [
    {
      "message_id": 40111,
      "thumb_url": "https://online.99digital.co.il/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzIwMX19--b7c1/invoice.png",
      "data_url": "https://online.99digital.co.il/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzIwMX19--b7c1/invoice.png",
      "file_size": 48213,
      "file_type": "image",
      "extension": null,
      "created_at": 1794471100,
      "sender": {
        "id": 51,
        "name": "Jane Agent",
        "type": "user"
      }
    }
  ]
}
```

### 401 — The access token is missing or wrong, or its user does not belong to this account.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | The error message. |

#### Example: Invalid token

The api_access_token header is missing or wrong.

```json
{
  "error": "Invalid Access Token"
}
```

#### Example: Another account

A valid token, for a user who is not in this account.

```json
{
  "error": "You are not authorized to access this account"
}
```

### 403 — The token's role does not have the permission this endpoint needs, or the endpoint is not open to agent-bot tokens. See [Authorization](https://docs.99digital.co.il/online-api/getting-started#authorization).

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | The error message. |

#### Example: No permission

The role lacks the permission.

```json
{
  "error": "You are not authorized to do this action"
}
```

#### Example: Agent bot

An agent-bot token on an endpoint that is not open to bots.

```json
{
  "error": "Access to this endpoint is not authorized for bots"
}
```

### 404 — The resource does not exist in this account.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | The error message. |

#### Example

```json
{
  "error": "Resource could not be found"
}
```
