
## Write to the workflow log

`POST /v1/workflows/activity-log`

Adds a message to the execution log of a workflow without changing its state. The activity remains suspended. Use it to record intermediate steps of a custom activity.

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `eventToken` | string | ★ | One-time token of the suspended workflow. 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) |
| `logMessage` | string | ★ | Log entry text. Shown in the workflow execution log in Bitrix24 |

## Examples

### curl — personal key

```bash
curl -X POST https://vibecode.bitrix24.com/v1/workflows/activity-log \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"eventToken":"xxx.yyy.zzz","logMessage":"Step 1 complete, awaiting confirmation"}'
```

### curl — OAuth application

```bash
curl -X POST https://vibecode.bitrix24.com/v1/workflows/activity-log \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"eventToken":"xxx.yyy.zzz","logMessage":"Step 1 complete, awaiting confirmation"}'
```

### JavaScript — personal key

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/workflows/activity-log', {
  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',
    logMessage: 'Step 1 complete, awaiting confirmation',
  }),
})
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` on a successful log write |
| `data` | null | Always `null` — the endpoint returns no data |

## Response example

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

## Error response example

400 — required parameters not provided:

```json
{
  "success": false,
  "error": {
    "code": "MISSING_PARAMS",
    "message": "Required: eventToken (string), logMessage (string)"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `MISSING_PARAMS` | `eventToken` or `logMessage` not provided |
| 401 | `MISSING_API_KEY` | `X-Api-Key` header not provided |
| 401 | `INVALID_API_KEY` | Invalid or expired API key |
| 401 | `TOKEN_MISSING` | The key has no connected Bitrix24 tokens |
| 401 | `TOKEN_EXPIRED` | The OAuth user session has expired — reauthorize 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` | Bitrix24-side error |
| 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

- **Multiple entries before the final event.** A single `eventToken` allows multiple `/activity-log` calls — each adds a separate log entry. For long-running operations this lets you reflect progress step by step before calling [`/v1/workflows/event`](/docs/automation/workflows/event) and completing the activity.

## See also

- [Send an event to a workflow](/docs/automation/workflows/event)
- [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)
