## Reassignment history

> **The method ships in the `imopenlines 26.700.0` update and is not yet available on all Bitrix24 accounts.** If the update has not reached your Bitrix24 account yet, the API returns `422 METHOD_NOT_YET_AVAILABLE` — this means the method has not been released on the account yet, not that the integration is broken.

`POST /v1/openlines/sessions/transfers`

A chronological list of reassignments (transfers) for specific sessions — from whom to whom, between which Open Channels, and for what reason.

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `sessionId` | number[] | yes | Array of session identifiers, up to 50 elements. Source: [`POST /v1/openlines/sessions/search`](/docs/openlines/sessions/search). A single number is also accepted and wrapped in an array |

Duplicates in `sessionId` are counted once. A `sessionId` that does not exist, belongs to someone else, or is not accessible does not cause an error — there are simply no records for it in `transfers`.

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/sessions/transfers" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "sessionId": [809, 805] }'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/openlines/sessions/transfers" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "sessionId": [809, 805] }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/openlines/sessions/transfers', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ sessionId: [809, 805] }),
})
const { data } = await res.json()
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/openlines/sessions/transfers', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ sessionId: [809, 805] }),
})
const { data } = await res.json()
```

## Response fields

Transfers for all requested sessions come in one shared list, in chronological order by ascending `date`. To group by session, use the `data.transfers[].sessionId` field.

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on a successful response |
| `data.transfers` | array | Reassignments across all requested sessions. An empty array if there were no transfers |
| `data.transfers[].sessionId` | number | Session identifier |
| `data.transfers[].date` | string | Date and time of the reassignment, ISO 8601 |
| `data.transfers[].fromOperatorId` | number \| null | Operator the dialog left. `null` if it came from the queue. Employee — [`GET /v1/users`](/docs/entities/users) |
| `data.transfers[].toOperatorId` | number \| null | Operator the dialog went to. `null` if it went to the queue. Employee — [`GET /v1/users`](/docs/entities/users) |
| `data.transfers[].fromConfigId` | number | Source Open Channel. Open Channel description — [`GET /v1/openline-configs/:id`](/docs/openlines/config/get) |
| `data.transfers[].toConfigId` | number \| null | Target Open Channel, if the dialog was transferred to another Open Channel. Open Channel description — [`GET /v1/openline-configs/:id`](/docs/openlines/config/get) |
| `data.transfers[].reason` | string | Reason: `manual` / `auto` |
| `data.transfers[].mode` | string | Mode: `MANUAL` / `AUTO` |
| `data.transfers[].type` | string | Type: `USER` / `QUEUE` |
| `data.transfers[].initiatorId` | number \| null | Transfer initiator. Can be `null`. It can be populated even when `reason` is `auto`. Employee — [`GET /v1/users`](/docs/entities/users) |

## Response example

Session 805 returned to the queue twice, and the operator manually transferred session 809 to a colleague:

```json
{
  "success": true,
  "data": {
    "transfers": [
      { "sessionId": 805, "date": "2026-10-14T18:41:13+00:00", "fromOperatorId": 1, "toOperatorId": null, "fromConfigId": 59, "toConfigId": null, "reason": "auto", "mode": "MANUAL", "type": "QUEUE", "initiatorId": 1 },
      { "sessionId": 805, "date": "2026-10-14T18:41:14+00:00", "fromOperatorId": 1, "toOperatorId": null, "fromConfigId": 59, "toConfigId": null, "reason": "auto", "mode": "MANUAL", "type": "QUEUE", "initiatorId": 1 },
      { "sessionId": 809, "date": "2026-10-14T19:07:47+00:00", "fromOperatorId": 1, "toOperatorId": 1295, "fromConfigId": 59, "toConfigId": null, "reason": "manual", "mode": "MANUAL", "type": "USER", "initiatorId": 1 }
    ]
  }
}
```

## Error response example

`400` — more than 50 identifiers in the request:

```json
{
  "success": false,
  "error": { "code": "BATCH_LIMIT_EXCEEDED", "message": "sessionId batch must not exceed 50 unique ids (got 51)" }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_JSON_BODY` | The request body did not parse as JSON. JSON is parsed before the fields are checked, so the response says nothing about missing parameters |
| 400 | `MISSING_PARAMS` | `sessionId` is an empty array or is missing |
| 400 | `INVALID_PARAMS` | An element of `sessionId` is not a positive integer. The same code is returned when the request body is not an object |
| 400 | `BATCH_LIMIT_EXCEEDED` | More than 50 unique identifiers (duplicates are counted once) |
| 401 | `TOKEN_MISSING` | The key has no configured tokens |
| 403 | `SCOPE_DENIED` | The key has no `imopenlines` scope |
| 403 | `B24_TARIFF_RESTRICTION` | The plan does not include Open Channels statistics (`report_open_lines`) |
| 422 | `METHOD_NOT_YET_AVAILABLE` | The `imopenlines 26.700.0` update has not reached the Bitrix24 account yet. The response contains an `error.release` field set to `imopenlines 26.700.0` |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Per-session metrics](/docs/openlines/sessions/stats)
- [Session search](/docs/openlines/sessions/search)
- [Open Channel sessions](/docs/openlines/sessions)
- [Open Channels](/docs/openlines)
