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

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

# List Conversation Files

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

Returns the attachments of all messages in the conversation, newest first.

The list is paginated with a cursor: up to `limit` files per request (200 by
default). For the next page, send the lowest `id` you received as `before`.

| Setting | Value |
| --- | --- |
| **Method** | `GET` |
| **Path** | `/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/files` |
| **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. |

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer | No | Page size, 1–200. Default 200. |
| `before` | integer | No | Return attachments with an ID lower than this one (next page). |

**Example request**

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

**Example response** (`200 OK`)

```json
[
  {
    "id": 3201,
    "message_id": 40117,
    "account_id": 12,
    "file_type": "image",
    "data_url": "https://online.99digital.co.il/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzIwMX19--b7c1/invoice.png",
    "thumb_url": "https://online.99digital.co.il/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzIwMX19--b7c1/invoice.png"
  }
]
```

## 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`. |
| `limit` | query | integer | No | The number of files to return, from 1 to 200. The default is 200. Default: `200`. Minimum: 1. Maximum: 200. Example: `10`. |
| `before` | query | integer | No | Return files with an ID lower than this one — the lowest `id` of the previous page — to get the next page. |

## Responses

### 200 — The conversation's files, newest first. Each file has `id`, `message_id`, `account_id`, `file_type`, `data_url` and `thumb_url`.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `[].id` | integer | The numeric ID of the file (attachment). |
| `[].message_id` | integer | The numeric ID of the message the file belongs to. |
| `[].account_id` | integer | The numeric ID of the account. |
| `[].file_type` | string | The type of file: `image`, `video`, `audio`, `file`, `location`, `contact`, `share`, `story_mention`, `fallback`, …. |
| `[].filename` | string | The name of the file. |
| `[].extension` | string \| null | The file extension, when known. |
| `[].data_url` | string | The URL of the file. |
| `[].thumb_url` | string | The URL of the file's thumbnail (for images). |
| `[].file_size` | integer | The file size, in bytes. |

#### Example

```json
[
  {
    "id": 3201,
    "message_id": 40117,
    "account_id": 12,
    "file_type": "image",
    "data_url": "https://online.99digital.co.il/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzIwMX19--b7c1/invoice.png",
    "thumb_url": "https://online.99digital.co.il/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzIwMX19--b7c1/invoice.png"
  }
]
```

### 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"
}
```
