
## 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. Can only be called with an authorization key together with the `Authorization: Bearer` header.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `code` (path) | string | Yes | Activity string 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 matches 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 | `INCLUDE` / `EXCLUDE` rules by document type |
| `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 — authorization key

```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 — authorization key

```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 |
|------|-----|---------|
| `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!"
  }
}
```

## 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 |
| 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).

## See also

- [Register an activity](/docs/entities/bizproc-activities/create)
- [Delete an activity](/docs/entities/bizproc-activities/delete)
- [Keys and authorization](/docs/keys-auth)
