
## Complete an activity

`POST /v1/activities/:id/complete`

Marks a CRM activity as completed: a call, meeting, task or email. Call it when the work on the activity is done.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Activity ID, a positive integer. List: [`GET /v1/activities`](/docs/entities/activities/list) |

No request body is sent. Send the request without a body and without the `Content-Type` header, or pass an empty object `{}` with the `Content-Type: application/json` header.

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/activities/3894/complete" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/activities/3894/complete" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activities/3894/complete', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Activity completed:', data.completed)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activities/3894/complete', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` on a successful request |
| `data` | object | The activity, read back after completion. All fields: [Activity fields](/docs/entities/activities/fields) |
| `data.completed` | boolean | `true` — the activity is completed |
| `data.status` | number | Activity status: `2` — completed |

## Response example

The main fields are shown. Full list: [Activity fields](/docs/entities/activities/fields).

```json
{
  "success": true,
  "data": {
    "id": 3894,
    "ownerTypeId": 3,
    "ownerId": 17,
    "subject": "Call the client",
    "completed": true,
    "status": 2,
    "startTime": "2026-10-23T12:00:00.000Z",
    "endTime": "2026-10-23T12:15:00.000Z",
    "deadline": "2026-10-23T12:00:00.000Z",
    "updatedAt": "2026-10-19T11:48:07.000Z"
  }
}
```

## Error response example

404 — no activity with this ID:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Activity does not exist"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | No activity with this `id` |
| 400 | `INVALID_PARAMS` | `id` is not a positive integer. Message: `id must be a positive integer` |
| 400 | `INVALID_PARAMS` | A field was passed in the body. Message: `Unsupported action field` |
| 400 | `FST_ERR_CTP_EMPTY_JSON_BODY` | The `Content-Type: application/json` header was sent with an empty body. Send `{}` or remove the header |
| 422 | `BITRIX_ERROR` | Bitrix24 refused to complete the activity. The refusal text is in `message` |
| 403 | `BITRIX_ACCESS_DENIED` | The key's user has no permission for this activity in Bitrix24 |
| 502 | `BITRIX_ERROR` | The activity has no valid binding to a CRM entity. Message: `Activity has no valid CRM owner` |
| 502 | `BITRIX_ERROR` | The completion was sent, but the activity could not be read back. Message: `Activity could not be read back`. Check the activity state with [`GET /v1/activities/:id`](/docs/entities/activities/get) |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — see [access rights](/docs/access-rights) |
| 403 | `SCOPE_DENIED` | The API key does not have the `crm` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## Known specifics

**Completing again returns no error.** Calling the method on an already completed activity returns `200` and returns the activity unchanged: `completed` stays `true`, `updatedAt` does not change. There is no need to check the activity state before the call.

## See also

- [Postpone an activity](/docs/entities/activities/postpone)
- [Change an activity deadline](/docs/entities/activities/deadline)
- [Get an activity](/docs/entities/activities/get)
- [Activity fields](/docs/entities/activities/fields)
