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

Canonical page: https://docs.99digital.co.il/online-api/messages/get-forward-quotes

# Get Forward Quotes

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

Returns the public incoming and outgoing messages before a given message, for building a quoted history when forwarding (mainly email).

Only the messages **before** the given message are returned, oldest first.
Private notes and activity messages are left out. Very long histories are cut
down to the most recent messages; send `limit` to get only the last few.

| Setting | Value |
| --- | --- |
| **Method** | `GET` |
| **Path** | `/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}/forward_quotes` |
| **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. |
| `message_id` | integer | Yes | Message ID. The messages before this one are returned. |

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer | No | Return only the last N messages. |

**Example request**

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

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

```json
{
  "payload": [
    {
      "sender": {
        "email": null,
        "name": "Jane Agent",
        "from_original": "Jane Agent <>"
      },
      "created_at": 1794470423,
      "private": false,
      "content": "How can we help?",
      "html_content": null,
      "forwarded": null
    },
    {
      "sender": {
        "email": null,
        "name": "Jane Agent",
        "from_original": "Jane Agent <>"
      },
      "created_at": 1794470424,
      "private": false,
      "content": "It will arrive tomorrow.",
      "html_content": null,
      "forwarded": null
    }
  ]
}
```

**Error responses**: `404 {"error": "Message not found"}`.

## 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`. |
| `message_id` | path | integer | Yes | The numeric ID of the message. Example: `40112`. |
| `limit` | query | integer | No | Return only the last N messages. Example: `2`. |

## Responses

### 200 — The messages before the given message.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `payload` | array of object | The messages, oldest first. |
| `payload[].sender` | object | Who sent the message. |
| `payload[].sender.email` | string \| null | The sender's email address, or `null`. |
| `payload[].sender.name` | string | The sender's name. |
| `payload[].sender.from_original` | string | The sender as an email `From` value — the name, then the email address in angle brackets. |
| `payload[].created_at` | integer | When the message was created (Unix time, seconds). |
| `payload[].private` | boolean | Whether the message is a private note. |
| `payload[].content` | string \| null | The message text. |
| `payload[].html_content` | string \| null | The message's HTML (email messages), or `null`. |
| `payload[].forwarded` | any | The message's forwarding data, or `null`. |

#### Example

```json
{
  "payload": [
    {
      "sender": {
        "email": null,
        "name": "Jane Agent",
        "from_original": "Jane Agent <>"
      },
      "created_at": 1794470423,
      "private": false,
      "content": "How can we help?",
      "html_content": null,
      "forwarded": null
    },
    {
      "sender": {
        "email": null,
        "name": "Jane Agent",
        "from_original": "Jane Agent <>"
      },
      "created_at": 1794470424,
      "private": false,
      "content": "It will arrive tomorrow.",
      "html_content": null,
      "forwarded": null
    }
  ]
}
```

### 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 conversation or the message does not exist.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | The error message: `Message not found` for the message, or `Resource could not be found` for the conversation. |

#### Example: Message not found

The message does not exist in this conversation.

```json
{
  "error": "Message not found"
}
```

#### Example: Conversation not found

The conversation does not exist in this account.

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