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

Canonical page: https://docs.99digital.co.il/online-api/conversations/bulk-update-conversations

# Bulk Update Conversations

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

Updates many conversations at once: status, priority, assignee, team, snooze time, and adding or removing labels.

The update runs in the background, so the response is immediate. The request
is rejected as a whole (`403`) if any conversation is not visible to the
caller, or if the caller lacks the inbox permission for a field being
changed (the same permissions as the single-conversation endpoints); then
no conversation is changed.

| Setting | Value |
| --- | --- |
| **Method** | `POST` |
| **Path** | `/api/v1/accounts/{account_id}/bulk_actions` |
| **Authorization** | User token. Per-field inbox permissions as in [Toggle Conversation Status](https://docs.99digital.co.il/online-api/conversations/toggle-conversation-status), [Toggle Conversation Priority](https://docs.99digital.co.il/online-api/conversations/toggle-conversation-priority), [Assign Conversation](https://docs.99digital.co.il/online-api/conversations/assign-conversation) and [Set Conversation Labels](https://docs.99digital.co.il/online-api/conversations/set-conversation-labels). |

**Permissions:**

- User token: the caller must be able to see every conversation in `ids` —
  see [Who can see a conversation](https://docs.99digital.co.il/online-api/conversations/conversation-basics#who-can-see-a-conversation).
  New rules system, for each field you change, in every conversation's
  inbox:
  - `fields.status`: **Inbox resolve**, **Inbox move to pending**, **Inbox
    reopen** or **Inbox manual/bot switch**, by the status.
  - `fields.priority`: **Inbox priority of conversations**.
  - `fields.assignee_id`: **Inbox can assign**. `fields.team_id`:
    **Inbox assign to group**.
  - `labels`: **Inbox assign labels**.
- Agent-bot token: not allowed.

**Path parameters**

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

**Body parameters (JSON)**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | Yes | Must be `Conversation`. Anything else returns `422 {"success": false}`. |
| `ids` | integer[] | Yes | Conversation display IDs. |
| `fields.status` | string | No | New status: `open` (Bot), `pending` (Manual), `snoozed`, `resolved`. |
| `fields.priority` | string | No | New priority: `low`, `medium`, `high`, `urgent`. |
| `fields.assignee_id` | integer | No | Agent to assign (must be assignable in every affected inbox). |
| `fields.team_id` | integer | No | Team to assign. |
| `fields.snoozed_until` | string | No | Snooze end time. |
| `labels.add` | string[] | No | Labels to add. |
| `labels.remove` | string[] | No | Labels to remove. |

**Example request**

```bash
curl -X POST 'https://online.99digital.co.il/api/v1/accounts/12/bulk_actions' \
  -H 'api_access_token: <YOUR_API_ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "Conversation",
    "ids": [1501],
    "fields": { "status": "pending", "priority": "high" },
    "labels": { "add": ["billing"], "remove": ["follow_up"] }
  }'
```

**Example response**: `200 OK` with an empty body. A few seconds later
conversation `1501` had status `pending`, priority `high` and labels
`["vip", "billing"]`.

**Error responses**

| Status | When | Body |
| --- | --- | --- |
| `403` | A conversation is not visible to the caller, or the caller lacks the inbox permission for a field. The whole request is rejected. | |
| `422` | `type` is not `Conversation`. | `{"success": false}` |

## Remarks

- `labels.add` and `labels.remove` change single labels without sending the
  full list, unlike
  [Set Conversation Labels](https://docs.99digital.co.il/online-api/conversations/set-conversation-labels),
  which replaces it. This works for a single conversation too.
- To mark conversations as read or unread, use
  [Bulk Mark as Read](https://docs.99digital.co.il/online-api/conversations/bulk-mark-as-read) and
  [Bulk Mark as Unread](https://docs.99digital.co.il/online-api/conversations/bulk-mark-as-unread).

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

## Request body

Content type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | Yes | The kind of records to update. Must be `Conversation`; any other value returns `422` with `{"success": false}`. One of: `Conversation`. |
| `ids` | array of integer | Yes | The conversations' display IDs. See [Conversation Basics](https://docs.99digital.co.il/online-api/conversations/conversation-basics). |
| `fields` | object | No | The new values. Send only the fields to change. |
| `fields.status` | string | No | The new status. The dashboard calls `open` **Bot** and `pending` **Manual**. One of: `open` — Bot — handled by the bot or automation; `pending` — Manual — handled by a human agent; `snoozed` — Snoozed until `fields.snoozed_until`, then reopened; `resolved` — Resolved. |
| `fields.priority` | string | No | The new priority. One of: `low` — The lowest priority; `medium` — Medium priority; `high` — High priority; `urgent` — The highest priority. |
| `fields.assignee_id` | integer | No | The agent to assign. The agent must be assignable in the inbox of every conversation. |
| `fields.team_id` | integer | No | The team to assign. |
| `fields.snoozed_until` | string | No | With `status` `snoozed`: when the snoozed conversations reopen. |
| `labels` | object | No | Labels to add or remove, by title. |
| `labels.add` | array of string | No | The labels to add. |
| `labels.remove` | array of string | No | The labels to remove. |

### Example: Resolve

Resolve two conversations.

```json
{
  "type": "Conversation",
  "ids": [
    1501,
    1502
  ],
  "fields": {
    "status": "resolved"
  }
}
```

### Example: Status, priority and labels

Hand over to a human, raise the priority, and change labels.

```json
{
  "type": "Conversation",
  "ids": [
    1501,
    1502
  ],
  "fields": {
    "status": "pending",
    "priority": "high"
  },
  "labels": {
    "add": [
      "vip"
    ],
    "remove": [
      "follow_up"
    ]
  }
}
```

### Example: Assign

Assign an agent and a team.

```json
{
  "type": "Conversation",
  "ids": [
    1501,
    1502
  ],
  "fields": {
    "assignee_id": 52,
    "team_id": 7
  }
}
```

## Responses

### 200 — The update was accepted and runs in the background, with an empty body.

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

### 422 — `type` is not `Conversation`.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `success` | boolean | Always `false` in this response. |

#### Example

```json
{
  "success": false
}
```
