
## Update an activity

`PATCH /v1/bizproc-activities/:code`

Updates a previously registered business process activity. Pass only the fields you change, flat at the JSON root — without a `fields` wrapper. The method works only with an authorization key together with the `Authorization: Bearer` header.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `code` (path) | string | Yes | Activity code |

## Request fields (body)

| Field | Type | Description |
|------|-----|---------|
| `name` | string \| object | Activity name. A string or a localized object like `{"en": "...", "de": "..."}` |
| `handler` | string | Activity handler URL. The domain must match the application domain |
| `description` | string \| object | Activity description. A string or a localized object |
| `authUserId` | number | ID of the user whose token is passed to the application when the activity is called. List: `GET /v1/users` |
| `useSubscription` | string | Whether to wait for the application's response before continuing the process: `Y` or `N` |
| `properties` | object | Activity input parameters |
| `returnProperties` | object | Activity output parameters |
| `documentType` | array | Document type: `[module, object, type]` |
| `filter` | object | Limits which documents the activity is available for. An empty object `{}` removes the restriction.<br>`INCLUDE` lists the conditions under which the activity is available, `EXCLUDE` those under which it is not. A condition is a document type prefix, for example `["crm", "CCrmDocumentDeal"]`, or a Bitrix24 edition: `"b24"` for cloud, `"box"` for on-premise.<br>Example: `{"INCLUDE": [["crm", "CCrmDocumentDeal"], ["crm", "CCrmDocumentLead"]]}`.<br>Write the keys in uppercase: with lowercase keys the field is accepted but restricts nothing. A value that is not an object returns `422 BITRIX_ERROR` |
| `usePlacement` | string | Whether to open the activity settings in a slider panel: `Y` or `N` |
| `placementHandler` | string | URL of the settings slider panel. Required when `usePlacement: "Y"` |

## Examples

The session token is issued by OAuth authorization, is valid for 24 hours, and cannot be renewed — [Passing the key](/docs/keys-auth#passing-the-key).

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/bizproc-activities/notify_manager" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": { "en": "Notify department manager", "de": "Abteilungsleiter benachrichtigen" }
  }'
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bizproc-activities/notify_manager', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: { en: 'Notify department manager', de: 'Abteilungsleiter benachrichtigen' },
  }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.id` | string | The code of the updated activity — matches `code` from the path |

## Response example

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

## Error response example

422 — no activity with the given code was found:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Activity or Robot not found!",
    "b24Code": "ERROR_ACTIVITY_NOT_FOUND"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 401 | `TOKEN_MISSING` | The authorization key was sent without the `Authorization: Bearer` header |
| 401 | `WRONG_AUTH_SCHEME` | The authorization key was sent in the `Authorization: Bearer` header. The key goes in `X-Api-Key`, while `Authorization: Bearer` carries the session token |
| 401 | `INVALID_SESSION` | The session token has expired or is invalid — authorize again |
| 403 | `OAUTH_REQUIRED` | The request was sent with an API key. Only an authorization key can update activities |
| 403 | `SCOPE_DENIED` | The key lacks the `bizproc` scope |
| 400 | `SERVER_APP_MISMATCH` | The new `handler` points to a Black Hole subdomain that has no server of this app behind it — the subdomain does not exist, or the server belongs to another app |
| 409 | `BIZPROC_MODULE_NOT_ENABLED` | Business Processes are not available on the account: the module is not included in the plan, or it is switched off in account settings. Ask an account administrator to enable Business Processes — until then the method answers the same way for any number of retries |
| 503 | `BIZPROC_CALLBACK_RESOLVE_FAILED` | The platform could not match the handler to a server. The activity was not updated — retry the request |
| 422 | `BITRIX_ERROR` | Bitrix24 did not find an activity with the given code or rejected the update — the reason is in `error.message` |

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

## Known specifics

**Moving the handler to a Black Hole subdomain switches the activity to reliable delivery.** Moving back to an address on your own domain restores direct calls without retries, and a request without the `handler` field leaves the binding unchanged. A switch to a subdomain must be sent as a single request — [Activity and automation rule callback delivery](/docs/infra/bizproc-callbacks).

## See also

- [Register an activity](/docs/entities/bizproc-activities/create)
- [Delete an activity](/docs/entities/bizproc-activities/delete)
- [Activity and automation rule callback delivery](/docs/infra/bizproc-callbacks)
- [Keys and authorization](/docs/keys-auth)
