
## Register an activity

`POST /v1/bizproc-activities`

Registers a new activity for the Bitrix24 business process designer. Fields are passed flat at the JSON root — without a `fields` wrapper. Can only be called with an authorization key together with the `Authorization: Bearer` header.

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `code` | string | Yes | Unique activity code. Allowed characters: `a-z`, `A-Z`, `0-9`, `.`, `-`, `_`. Serves as the identifier in the update and delete paths |
| `name` | string \| object | Yes | Activity name. A string or a localized object like `{"en": "...", "de": "..."}` |
| `handler` | string | Yes | Activity handler URL. The domain matches the application domain |
| `description` | string \| object | No | Activity description. A string or a localized object |
| `authUserId` | number | No | ID of the user whose token is passed to the application when the activity is called. List: `GET /v1/users` |
| `useSubscription` | string | No | Whether to wait for the application's response before continuing the process: `Y` or `N` |
| `properties` | object | No | Activity input parameters — fields that are filled in when configuring the activity in the designer |
| `returnProperties` | object | No | Activity output parameters — values the activity returns to the process |
| `documentType` | array | No | Document type the activity applies to — module, object, type. Values: [Document types](/docs/entities/bizproc-activities#document-types) |
| `filter` | object | No | Limits which documents the activity is available for. Without the field, the activity is available for all documents.<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 | No | Whether to open the activity settings in a slider panel: `Y` or `N` |
| `placementHandler` | string | No | 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 POST "https://vibecode.bitrix24.com/v1/bizproc-activities" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "notify_manager",
    "name": { "en": "Notify manager", "de": "Manager benachrichtigen" },
    "handler": "https://your-app.example.com/bizproc/notify"
  }'
```

### JavaScript — OAuth application

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

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.id` | string | Addressable identifier. Uses the `code` returned by Bitrix24 when present; otherwise equals the submitted `code`. Used as `:code` for PATCH and DELETE |

## Response example

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

## Error response example

403 — the request was sent with an API key:

```json
{
  "success": false,
  "error": {
    "code": "OAUTH_REQUIRED",
    "message": "bizproc-activities require an OAuth app key (vibe_app_*) with an Authorization: Bearer session — a personal vibe_api_* key lacks the per-user OAuth context Bitrix24 needs for these methods. Create an OAuth app (POST /v1/apps) and retry with its key. On this 403 switch keys — do NOT delete or recreate the app (that discards anything already registered under it, e.g. a bizproc robot you just registered)."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 403 | `OAUTH_REQUIRED` | The request was sent with an API key. Only an authorization key can register activities |
| 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 | `SCOPE_DENIED` | The key lacks the `bizproc` scope |
| 400 | `MISSING_REQUIRED_FIELDS` | A required field is missing — `code`, `name`, or `handler` |
| 400 | `SERVER_APP_MISMATCH` | `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. Register the handler with the key of the app the server is linked to |
| 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 is not registered — retry the request |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the registration — the reason is in `error.message` |

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

## Known specifics

**A handler on a Black Hole subdomain gets reliable delivery.** The platform takes over delivery of the calls and stores the address of its own receiver in Bitrix24 instead of the one you passed. Such a handler can only be registered with a single request, and the delivery itself is switched on per Bitrix24 account — [Activity and automation rule callback delivery](/docs/infra/bizproc-callbacks).

## See also

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