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

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

# Send Conversation Transcript

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

Emails the conversation transcript (incoming and outgoing messages) to an address, or previews it.

With `meta: true` it only returns a preview (message count and first
message) without sending anything. Rate-limited to 30 transcript requests per
hour per account.

| Setting | Value |
| --- | --- |
| **Method** | `POST` |
| **Path** | `/api/v1/accounts/{account_id}/conversations/{conversation_id}/transcript` |
| **Authorization** | User token. New rules: **Inbox send Transcript** for the inbox. |

**Permissions:**

- User token: the caller must also be able to 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. |

**Body parameters (JSON)**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `period.type_id` | string | Yes | Which messages: `all`, `today`, `h1` / `h3` / `h5` / `h24` (last 1/3/5/24 hours), `new` (since the last transcript), `custom` (from `period.from`), `last_ai_summary` (only the last AI-summary note). |
| `period.from` | integer | Conditional | Unix timestamp, with `type_id: custom`. |
| `email` | string | Conditional | Recipient. Required unless `to_assignee` is `true` or `meta` is `true`. |
| `to_assignee` | boolean | No | Send to the conversation's assignee instead of `email`. |
| `meta` | boolean | No | Return a preview only. |

**Example: preview**

```bash
curl -X POST 'https://online.99digital.co.il/api/v1/accounts/12/conversations/1501/transcript' \
  -H 'api_access_token: <YOUR_API_ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "period": { "type_id": "h24" }, "meta": true }'
```

Response (`200 OK`):

```json
{
  "count": 4,
  "first": {
    "content": "Hello, I have a question about my order.",
    "created_at": 1794471000
  }
}
```

**Example: send by email**

```bash
curl -X POST 'https://online.99digital.co.il/api/v1/accounts/12/conversations/1501/transcript' \
  -H 'api_access_token: <YOUR_API_ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "period": { "type_id": "all" }, "email": "dana.cohen@example.com" }'
```

Response: `200 OK` with an empty body. The email is sent in the background.

**Error responses**

| Status | When | Body |
| --- | --- | --- |
| `422` | `email` is missing, and neither `to_assignee` nor `meta` is `true`. | `{"error": "email param missing"}` |
| `429` | More than 30 transcript requests in an hour for the account (rate limit). See [Rate limits](https://docs.99digital.co.il/online-api/getting-started#rate-limits). | |

## 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`. |

## Request body

Content type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | object | Yes | Which messages the transcript holds. |
| `period.type_id` | string | Yes | Which messages of the conversation to include. One of: `all` — Every message of the conversation; `today` — Today's messages; `h1` — The last hour; `h3` — The last 3 hours; `h5` — The last 5 hours; `h24` — The last 24 hours; `new` — The messages since the last transcript; `custom` — The messages from `period.from` on; `last_ai_summary` — Only the last AI-summary note. Example: `all`. |
| `period.from` | integer | No | The start of the period (Unix time, seconds). Required when `type_id` is `custom`. Example: `1794470400`. |
| `email` | string | No | The recipient. Required unless `to_assignee` or `meta` is `true`. Example: `dana.cohen@example.com`. |
| `to_assignee` | boolean | No | Send the transcript to the conversation's assignee instead of `email`. |
| `meta` | boolean | No | Return a preview only, without sending anything. |

### Example: Send by email

The whole conversation, to an email address.

```json
{
  "period": {
    "type_id": "all"
  },
  "email": "dana.cohen@example.com"
}
```

### Example: Since a time

The messages from a given time on.

```json
{
  "period": {
    "type_id": "custom",
    "from": 1794470400
  },
  "email": "dana.cohen@example.com"
}
```

### Example: To the assignee

Today's messages, to the conversation's assignee.

```json
{
  "period": {
    "type_id": "today"
  },
  "to_assignee": true
}
```

### Example: Preview

Preview the last 24 hours without sending anything.

```json
{
  "period": {
    "type_id": "h24"
  },
  "meta": true
}
```

## Responses

### 200 — The transcript is being emailed, and the response has an empty body. With `meta: true`, nothing is sent and the response is the preview below.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `count` | integer | The number of messages the transcript would hold. |
| `first` | object | The first message of the transcript. |
| `first.content` | string | The text. |
| `first.created_at` | integer | When the message was created (Unix time, seconds). |

#### Example: Preview

The response to `meta: true`.

```json
{
  "count": 4,
  "first": {
    "content": "Hello, I have a question about my order.",
    "created_at": 1794471000
  }
}
```

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

### 422 — `email` is missing, and neither `to_assignee` nor `meta` is `true`.

Content type: `application/json`

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

#### Example

```json
{
  "error": "email param missing"
}
```

### 429 — The account sent more than 30 transcript requests in the last hour.
