[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Factivities\u002Fdeadline":3,"docs-tabs-entities\u002Factivities\u002Fdeadline":6},{"content":4,"lastmod":5},"\n## Change an activity deadline\n\n`POST \u002Fv1\u002Factivities\u002F:id\u002Fdeadline`\n\nSets 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.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Activity ID, a positive integer. List: [`GET \u002Fv1\u002Factivities`](\u002Fdocs\u002Fentities\u002Factivities\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `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 |\n\nThe body accepts no other fields.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3894\u002Fdeadline\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"deadline\": \"2026-10-22T14:00:00+02:00\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3894\u002Fdeadline\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"deadline\": \"2026-10-22T14:00:00+02:00\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3894\u002Fdeadline', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ deadline: '2026-10-22T14:00:00+02:00' }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('New deadline:', data.deadline)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3894\u002Fdeadline', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ deadline: '2026-10-22T14:00:00+02:00' }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on a successful request |\n| `data` | object | The activity, read back after the deadline change. All fields: [Activity fields](\u002Fdocs\u002Fentities\u002Factivities\u002Ffields) |\n| `data.deadline` | datetime | The new deadline |\n| `data.startTime` | datetime | Activity start after the change |\n| `data.endTime` | datetime | Activity end after the change |\n\n## Response example\n\nThe main fields are shown. Full list: [Activity fields](\u002Fdocs\u002Fentities\u002Factivities\u002Ffields).\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 3894,\n    \"ownerTypeId\": 3,\n    \"ownerId\": 17,\n    \"subject\": \"Call the client\",\n    \"completed\": false,\n    \"status\": 1,\n    \"startTime\": \"2026-10-22T12:00:00.000Z\",\n    \"endTime\": \"2026-10-22T12:15:00.000Z\",\n    \"deadline\": \"2026-10-22T12:00:00.000Z\",\n    \"updatedAt\": \"2026-10-19T11:47:45.000Z\"\n  }\n}\n```\n\n## Error response example\n\n400 — `deadline` is missing or is not an ISO 8601 date and time:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"deadline must be an ISO-8601 datetime\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 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` |\n| 400 | `INVALID_PARAMS` | The body contains a field other than `deadline`. Message: `Unsupported action field` |\n| 400 | `INVALID_PARAMS` | `id` is not a positive integer. Message: `id must be a positive integer` |\n| 404 | `ENTITY_NOT_FOUND` | No activity with this `id` |\n| 422 | `ACTIVITY_DEADLINE_UNCHANGED` | Bitrix24 confirmed the change, but the activity deadline does not match the `deadline` that was passed |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused to change the deadline. The refusal text is in `message` |\n| 403 | `BITRIX_ACCESS_DENIED` | The key's user has no permission for this activity in Bitrix24 |\n| 502 | `BITRIX_ERROR` | The activity has no valid binding to a CRM entity. Message: `Activity has no valid CRM owner` |\n| 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 \u002Fv1\u002Factivities\u002F:id`](\u002Fdocs\u002Fentities\u002Factivities\u002Fget) |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — see [access rights](\u002Fdocs\u002Faccess-rights) |\n| 403 | `SCOPE_DENIED` | The API key does not have the `crm` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n\nFull list of common API errors: [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**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.\n\n**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.\n\n**The deadline of a completed activity can be changed too.** Calling the method on a completed activity returns `200`, and `completed` stays `true`.\n\n## See also\n\n- [Postpone an activity](\u002Fdocs\u002Fentities\u002Factivities\u002Fpostpone)\n- [Complete an activity](\u002Fdocs\u002Fentities\u002Factivities\u002Fcomplete)\n- [Update activity](\u002Fdocs\u002Fentities\u002Factivities\u002Fupdate)\n- [Get an activity](\u002Fdocs\u002Fentities\u002Factivities\u002Fget)\n- [Activity fields](\u002Fdocs\u002Fentities\u002Factivities\u002Ffields)\n","2026-10-19",{},1795000257121]