
## Change an activity deadline

`POST /v1/activities/:id/deadline`

Sets a new deadline for a CRM activity to an exact date and time. Call it when you know the specific date by which the activity must be done.

## Parameters

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

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|---------|
| `deadline` | datetime | yes | The new deadline — a date and time in ISO 8601 format: `2026-10-22T14:00:00+02:00`, `2026-10-22T12:00:00Z`. Pass a time zone offset or `Z` so that the point in time is unambiguous. A date without a time is rejected |

The body accepts no other fields.

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/activities/3894/deadline" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"deadline": "2026-10-22T14:00:00+02:00"}'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/activities/3894/deadline" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"deadline": "2026-10-22T14:00:00+02:00"}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activities/3894/deadline', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ deadline: '2026-10-22T14:00:00+02:00' }),
})

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activities/3894/deadline', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ deadline: '2026-10-22T14:00:00+02:00' }),
})

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 the deadline change. All fields: [Activity fields](/docs/entities/activities/fields) |
| `data.deadline` | datetime | The new deadline |
| `data.startTime` | datetime | Activity start after the change |
| `data.endTime` | datetime | Activity end after the change |

## 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": false,
    "status": 1,
    "startTime": "2026-10-22T12:00:00.000Z",
    "endTime": "2026-10-22T12:15:00.000Z",
    "deadline": "2026-10-22T12:00:00.000Z",
    "updatedAt": "2026-10-19T11:47:45.000Z"
  }
}
```

## Error response example

400 — `deadline` is missing or is not an ISO 8601 date and time:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "deadline must be an ISO-8601 datetime"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `deadline` is missing, is not a string, or is not an ISO 8601 date and time, for example `tomorrow` or `2026-10-22`. Message: `deadline must be an ISO-8601 datetime` |
| 400 | `INVALID_PARAMS` | The body contains a field other than `deadline`. Message: `Unsupported action field` |
| 400 | `INVALID_PARAMS` | `id` is not a positive integer. Message: `id must be a positive integer` |
| 404 | `ENTITY_NOT_FOUND` | No activity with this `id` |
| 422 | `ACTIVITY_DEADLINE_UNCHANGED` | Bitrix24 confirmed the change, but the activity deadline does not match the `deadline` that was passed |
| 422 | `BITRIX_ERROR` | Bitrix24 refused to change the deadline. 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 change 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

**The activity start and end move together with the deadline.** The activity duration is kept: for a 15-minute call whose deadline equals its start, after the deadline is changed to `2026-10-22T14:00:00+02:00`, the `startTime` and `deadline` fields equal 12:00 UTC, and `endTime` equals 12:15 UTC.

**Times in the response are in UTC.** A deadline passed as `2026-10-22T14:00:00+02:00` comes back in `data.deadline` as `2026-10-22T12:00:00.000Z`. Compare points in time, not strings.

**The deadline of a completed activity can be changed too.** Calling the method on a completed activity returns `200`, and `completed` stays `true`.

## See also

- [Postpone an activity](/docs/entities/activities/postpone)
- [Complete an activity](/docs/entities/activities/complete)
- [Update activity](/docs/entities/activities/update)
- [Get an activity](/docs/entities/activities/get)
- [Activity fields](/docs/entities/activities/fields)
