
## Update activity

`PATCH /v1/activity-configurable/:id`

Overwrites a configurable activity. `fields` and `layout` are passed in full — the method replaces the activity rather than updating individual fields. Unset values are reset.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Activity ID. Returned in `data.activity.id` on [creation](/docs/entities/activities/configurable/create). List: [`GET /v1/activities`](/docs/entities/activities/list) |

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `fields` | object | yes | Activity fields |
| `fields.typeId` | string | no | Activity type. Defaults to `CONFIGURABLE` |
| `fields.completed` | boolean | no | Activity is closed. Accepts `true`/`false`, `1`/`0`, `Y`/`N` |
| `fields.deadline` | string | no | Due date, ISO 8601. Incompatible with `fields.isIncomingChannel` |
| `fields.pingOffsets` | number[] | no | Offsets in minutes relative to `fields.deadline` at which reminders are generated |
| `fields.isIncomingChannel` | boolean | no | Activity created from an incoming channel. Accepts `true`/`false`, `1`/`0`, `Y`/`N` |
| `fields.responsibleId` | number | no | ID of the responsible employee. List: [`GET /v1/users`](/docs/entities/users/list) |
| `fields.badgeCode` | string | no | Activity badge code on the Kanban board |
| `fields.originatorId` | string | no | ID of the external data source |
| `fields.originId` | string | no | ID of the record in the external source |
| `layout` | object | yes | Activity appearance |
| `layout.icon.code` | string | yes | Activity icon code |
| `layout.header.title` | string | yes | Activity title |
| `layout.body.logo.code` | string | yes | Logo code in the body. Without `logo`, the request fails with `422 BITRIX_ERROR` |
| `layout.body.blocks` | object | no | Named body blocks |
| `layout.footer.buttons` | object | no | Buttons in the bottom section of the activity |

A block in `layout.body.blocks` has a `type` and `properties`. Main block types:

- `text` — value
- `link` — link with an action
- `lineOfBlocks` — a row of nested blocks
- `withTitle` — block with a caption

The action of links and buttons is defined by the `type` field:

- `redirect` — navigation to the URL from the `uri` field
- `openRestApp` — opening the application with the parameters from `actionParams`
- `restEvent` — an event to the application by `id`, for menu items

## Examples

Examples are given only for an OAuth application: a personal key does not work here. OAuth application requirements — [Configurable activities](/docs/entities/activities/configurable).

### curl — OAuth application

```bash
curl -X PATCH https://vibecode.bitrix24.com/v1/activity-configurable/8053 \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": { "typeId": "CONFIGURABLE", "completed": true, "responsibleId": 5 },
    "layout": {
      "icon": { "code": "call-completed" },
      "header": { "title": "Call handled" },
      "body": { "logo": { "code": "call-incoming" }, "blocks": {} },
      "footer": { "buttons": {} }
    }
  }'
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activity-configurable/8053', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fields: { typeId: 'CONFIGURABLE', completed: true, responsibleId: 5 },
    layout: {
      icon: { code: 'call-completed' },
      header: { title: 'Call handled' },
      body: { logo: { code: 'call-incoming' }, blocks: {} },
      footer: { buttons: {} },
    },
  }),
})

const { data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | The result — the activity in the `activity` field |
| `data.activity.id` | number | ID of the updated activity |

## Response example

```json
{
  "success": true,
  "data": { "activity": { "id": 8053 } }
}
```

## Error response example

404 — activity not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Item not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `VALIDATION_ERROR` | `id` in the path is not a number, or `fields` or `layout` is missing |
| 404 | `ENTITY_NOT_FOUND` | An activity with the given `id` does not exist |
| 422 | `BITRIX_ERROR` | The request uses a personal `vibe_api_*` key. The `b24Code` field of the response carries `ERROR_WRONG_CONTEXT` |
| 422 | `BITRIX_ERROR` | The activity was created by another application. The `b24Code` field of the response carries `ERROR_WRONG_APPLICATION` |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request: `layout.body.logo` is missing, or `layout` is empty |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — see [access rights](/docs/access-rights) |
| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | The authorization key was passed without a session token in the `Authorization: Bearer` header |

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

## See also

- [Create activity](/docs/entities/activities/configurable/create)
- [Get activity](/docs/entities/activities/configurable/get)
- [Configurable activities](/docs/entities/activities/configurable)
