## Select the current CRM layout

`PUT /v1/crm/card-layouts/:entityType/current`

Select the current CRM card layout for the calling employee or a specified user.

> **These methods are rolling out — introduced in `crm 26.1700.0`.** Cloud availability also depends on Bitrix24 enabling this capability. Until it is enabled for your Bitrix24 account, the API returns `422 METHOD_NOT_YET_AVAILABLE` with `error.release`.

Requires `crm` scope. Writes require `READWRITE`.

## Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `entityType` (path) | string | yes | — | Type from the [section index](/docs/entities/crm-card-layouts). |

## Request body fields

| Field | Type | Required | Description |
|---|---|---|---|
| `categoryId` | integer | yes | Category from [`GET /v1/categories`](/docs/entities/categories), `0` is accepted. |
| `userId` | integer | no | Employee from the [user list](/docs/entities/users). Omit to use the caller. |
| `layoutId` | string | yes | ID from the [list](/docs/entities/crm-card-layouts/list), [common](/docs/entities/crm-card-layouts/getcommonlayoutid) or [personal](/docs/entities/crm-card-layouts/getpersonallayoutid) layout. |

## Examples

### curl — personal key

```bash
curl -X PUT "https://vibecode.bitrix24.com/v1/crm/card-layouts/deal/current" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"categoryId": 0, "layoutId": "C0:common"}'
```

### curl — OAuth application

```bash
curl -X PUT "https://vibecode.bitrix24.com/v1/crm/card-layouts/deal/current" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"categoryId": 0, "layoutId": "C0:common"}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm/card-layouts/deal/current', {
  method: 'PUT',
  headers: {"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
  body: JSON.stringify({"categoryId": 0, "layoutId": "C0:common"}),
});
console.log(await res.json());
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm/card-layouts/deal/current', {
  method: 'PUT',
  headers: {"X-Api-Key": "YOUR_APP_KEY", "Authorization": "Bearer USER_SESSION_TOKEN", "Content-Type": "application/json"},
  body: JSON.stringify({"categoryId": 0, "layoutId": "C0:common"}),
});
console.log(await res.json());
```

## Response fields

| Field | Type | Description |
|---|---|---|
| `success` | boolean | `true` |
| `data.result` | boolean | `true` |

## Response example

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

## Error response example

`400` — category omitted:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELDS",
    "message": "categoryId is required"
  }
}
```

## Errors

| HTTP | Code | Description |
|---|---|---|
| 400 | `MISSING_REQUIRED_FIELDS` | Category or required body fields missing. |
| 400 | `INVALID_PARAMS` | Unsupported entity selector or malformed parameters. |
| 400 | `UNKNOWN_FILTER_FIELD` | Unknown query parameter. |
| 401 | `MISSING_API_KEY` | API key missing. |
| 401 | `TOKEN_MISSING` | Bitrix24 credentials missing. |
| 403 | `SCOPE_DENIED` | The key lacks `crm` scope. |
| 404 | `ENTITY_NOT_FOUND` | Bitrix24 reported a missing layout. |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key blocks writes to Bitrix24. |
| 422 | `METHOD_NOT_YET_AVAILABLE` | Capability disabled or method unavailable. `error.release` names the release. |
| 422 | `BITRIX_ERROR` | Bitrix24 refusal. Original code in `error.b24Code`, text in `error.message`. |
| 502 | `BITRIX_UNAVAILABLE` | No valid response from Bitrix24. After a write error, reread before retrying. |

Common errors: [Errors](/docs/errors).

## See also

- [Named CRM card layouts](/docs/entities/crm-card-layouts)
