
## Configure communication tools

`PATCH /v1/humanresources/nodes/:id/communications`

Configures the link between a communication tool and an organizational structure node by its identifier. The tool type is set by the `communicationType` field.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `id` (path) | number | yes | Node identifier. List: `GET /v1/humanresources/nodes?type=DEPARTMENT` |

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|----------|
| `communicationType` | string | yes | Communication tool type. Allowed values: `CHAT`, `CHANNEL`, `COLLAB` |
| `ids` | number[] | no | Identifiers of existing tools to link to the node |
| `removeIds` | number[] | no | Identifiers of linked tools to unlink from the node |
| `createDefault` | boolean | no | Create and link a new tool of the selected type. Defaults to `false` |
| `withChildren` | boolean | no | Apply the change to child nodes as well. Defaults to `false` |

## Examples

### curl — personal key

```bash
curl -X PATCH -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"communicationType": "CHAT"}' \
  https://vibecode.bitrix24.com/v1/humanresources/nodes/23/communications
```

### curl — OAuth application

```bash
curl -X PATCH -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"communicationType": "CHAT"}' \
  https://vibecode.bitrix24.com/v1/humanresources/nodes/23/communications
```

### JavaScript — personal key

```javascript
const res = await fetch(
  'https://vibecode.bitrix24.com/v1/humanresources/nodes/23/communications',
  {
    method: 'PATCH',
    headers: {
      'X-Api-Key': 'YOUR_API_KEY',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ communicationType: 'CHAT' }),
  }
)
const body = await res.json()
console.log(body.success)
```

### JavaScript — OAuth application

```javascript
const res = await fetch(
  'https://vibecode.bitrix24.com/v1/humanresources/nodes/23/communications',
  {
    method: 'PATCH',
    headers: {
      'X-Api-Key': 'YOUR_APP_KEY',
      'Authorization': 'Bearer USER_SESSION_TOKEN',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ communicationType: 'CHAT' }),
  }
)
const body = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | Always `true` when the request is processed successfully |
| `data.success` | boolean | Flag indicating the setting was applied on the Bitrix24 side |

## Response example

```json
{
  "success": true,
  "data": {
    "success": true
  }
}
```

## Error response example

400 — the required `communicationType` field was not provided:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Request object validation failed",
    "validation": [
      {
        "field": "MISSING_COMMUNICATIONTYPE",
        "message": "Parameter \"communicationType\" is required."
      }
    ]
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | The `communicationType` field was not provided — `error.validation` returns `MISSING_COMMUNICATIONTYPE` |
| 400 | `INVALID_PARAMS` | An invalid `communicationType` value was provided — `error.validation` returns `INVALID_COMMUNICATIONTYPE` with the list of allowed values |
| 400 | `INVALID_PARAMS` | The node identifier in the path is not a positive integer |
| 403 | `SCOPE_DENIED` | The key is missing the `humanresources` scope |
| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |

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

## Known specifics

**Linking, unlinking, and creation are combined in one request.** `ids`, `removeIds`, and `createDefault` can be passed together — a single call can link some tools, unlink others, and create a new one. `withChildren` propagates the change to child nodes.

## See also

- [Node communication channels](/docs/humanresources/node-operations/communications-get)
- [Move node](/docs/humanresources/node-operations/move)
- [Node operations](/docs/humanresources/node-operations)
