
## Update activity

`PATCH /v1/activities/:id`

Updates fields of an existing activity. Pass only the fields you want to change. Full list in the [field reference](/docs/entities/activities/fields).

## Frequently updated fields

| Parameter | Type | Description |
|----------|-----|---------|
| `completed` | boolean | Mark as completed |
| `subject` | string | Subject |
| `deadline` | datetime | Deadline |
| `responsibleId` | number | Responsible person. List: `GET /v1/users` |
| `priority` | number | Priority: `1` — low, `2` — medium, `3` — high |
| `description` | string | Description |

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/activities/3894" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "completed": true,
    "subject": "Project meeting (completed)"
  }'
```

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/activities/3894" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "completed": true,
    "subject": "Project meeting (completed)"
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activities/3894', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    completed: true,
    subject: 'Project meeting (completed)',
  }),
})

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activities/3894', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    completed: true,
    subject: 'Project meeting (completed)',
  }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `data` | object | Updated activity object with all fields — see [Fields](/docs/entities/activities/fields) |

The updated activity object — see [Activity fields](/docs/entities/activities/fields).


## Response example

```json
{
  "success": true,
  "data": {
    "id": 100,
    "subject": "Updated subject",
    "completed": true,
    "responsibleId": 1,
    "createdAt": "2026-04-15T12:00:00.000Z",
    "updatedAt": "2026-04-15T13:00:00.000Z"
  }
}
```

## Error response example

404 — activity not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Item not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | Activity not found |
| 403 | `ACCESS_DENIED` | No access |
| 400 | `INVALID_REQUEST` | Invalid fields |
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## See also

- [Get activity](/docs/entities/activities/get) — current values
- [Activity fields](/docs/entities/activities/fields) — all available fields
- [Batch](/docs/batch) — bulk update
- [Limits and optimization](/docs/optimization) — rate limits
