
## Send an event to a process

`POST /v1/workflows/event`

Passes output values to a paused workflow and resumes its execution. After the call, the process continues with those values in the activity's output parameters.

## Request fields (body)

| Field | Type | Req. | Description |
|------|-----|:-----:|---------|
| `eventToken` | string | ★ | One-time token of the paused process. Bitrix24 sends it to the `handler` of the registered activity — see [`/v1/bizproc-activities`](/docs/entities/bizproc-activities) or [`/v1/bizproc-robots`](/docs/entities/bizproc-robots) |
| `returnValues` | object | no | Output parameter values of the activity. Defaults to `{}` |
| `logMessage` | string | no | Message for the process execution log |

## Examples

### curl — personal key

```bash
curl -X POST https://vibecode.bitrix24.com/v1/workflows/event \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"eventToken":"xxx.yyy.zzz","returnValues":{"result":"approved"}}'
```

### curl — OAuth application

```bash
curl -X POST https://vibecode.bitrix24.com/v1/workflows/event \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"eventToken":"xxx.yyy.zzz","returnValues":{"result":"approved"}}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/workflows/event', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    eventToken: 'xxx.yyy.zzz',
    returnValues: { result: 'approved' },
  }),
})
const data = await res.json()
console.log(data.success) // true
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/workflows/event', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    eventToken: 'xxx.yyy.zzz',
    returnValues: { result: 'approved' },
  }),
})
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` when the event is delivered successfully |
| `data` | boolean | `true` — the event was accepted and process execution resumed |

## Response example

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

## Error response example

403 — invalid token:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ACCESS_DENIED",
    "message": "Access denied!"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `MISSING_PARAMS` | Required parameter `eventToken` not provided |
| 401 | `MISSING_API_KEY` | Header `X-Api-Key` not provided |
| 401 | `INVALID_API_KEY` | Invalid or expired API key |
| 401 | `TOKEN_MISSING` | The key has no connected Bitrix24 tokens |
| 401 | `TOKEN_EXPIRED` | OAuth user session expired — re-authorize via `/v1/oauth/authorize` |
| 403 | `SCOPE_DENIED` | The key is missing the `bizproc` scope |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 rejected the request — the token is invalid, expired, or already used |
| 422 | `BITRIX_ERROR` | Error on the Bitrix24 side |
| 429 | `RATE_LIMITED` | Request rate limit exceeded. Retry in 1–2 seconds |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable |

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

## Known specifics

- **`eventToken` is one-time.** Each pause of a workflow generates a new token. The token becomes invalid immediately after the `/event` call.
- **Difference from `/v1/workflows/activity-log`.** Both endpoints accept `eventToken`, but `/event` completes the activity and resumes the process with the passed `returnValues`, while `/activity-log` only writes a message to the log without changing the process state. Use `/activity-log` to record intermediate steps; use `/event` for the final response.

## See also

- [Write to the workflow log](/docs/automation/workflows/activity-log)
- [List of running workflows](/docs/automation/workflows/list)
- [Start a workflow](/docs/automation/workflows/start)
- [Workflows](/docs/automation/workflows)
- [Business process activities](/docs/entities/bizproc-activities)
