[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Ftasks\u002Fstart-timer":3,"docs-tabs-entities\u002Ftasks\u002Fstart-timer":6},{"content":4,"lastmod":5},"## Start task timer\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fstart-timer`\n\nStarts the time-tracking timer for a task on behalf of the key's user. A task in the Pending status moves to In Progress.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `taskId` (path) | number | yes | Task ID. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `params` | object | no | Additional action parameters. Passed to Bitrix24 unchanged |\n| `params.STOP_PREVIOUS` | string | no | `Y` — before starting, stop the timer the key's user started on another task. The value `N` and an absent field behave the same: while a timer runs on another task, the call is rejected with `422` |\n\nThe request body can be empty or `{}`. Any field other than `params` is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST 'https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F289\u002Fstart-timer' \\\n  -H 'X-Api-Key: YOUR_API_KEY' \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"params\":{\"STOP_PREVIOUS\":\"Y\"}}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST 'https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F289\u002Fstart-timer' \\\n  -H 'X-Api-Key: YOUR_APP_KEY' \\\n  -H 'Authorization: Bearer USER_SESSION_TOKEN' \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"params\":{\"STOP_PREVIOUS\":\"Y\"}}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F289\u002Fstart-timer', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\"params\":{\"STOP_PREVIOUS\":\"Y\"}}),\n})\nconst result = await response.json()\nconsole.log(result.data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F289\u002Fstart-timer', {\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({\"params\":{\"STOP_PREVIOUS\":\"Y\"}}),\n})\nconst result = await response.json()\nconsole.log(result.data)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data` | object \\| null | `null` if time tracking is off for the task. The timer does not start in that case |\n| `data.task` | object | The full task object when time tracking is on. Values arrive in raw form: numbers as strings (`\"id\": \"289\"`), flags as `Y` or `N` (`\"allowTimeTracking\": \"Y\"`). [`GET \u002Fv1\u002Ftasks\u002F:id`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget) returns the same fields as numbers and `true`\u002F`false` |\n| `data.task.id` | string | Task ID |\n| `data.task.allowTimeTracking` | string | Time tracking for the task: `Y` — on |\n| `data.task.timeElapsed` | string | Time already tracked on the task, in seconds |\n| `data.task.action` | object | Which actions the key's user can take: the key is the action name (`start`, `pause`, `complete`, `defer`, `renew` and others), the value is `true` or `false` |\n\n## Response example\n\nTime tracking is on. Only the main fields of the task object are shown:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"task\": {\n      \"id\": \"289\",\n      \"title\": \"Prepare the quarterly report\",\n      \"status\": \"3\",\n      \"createdBy\": \"1\",\n      \"responsibleId\": \"1\",\n      \"allowTimeTracking\": \"Y\",\n      \"timeElapsed\": \"6\",\n      \"action\": {\n        \"start\": false,\n        \"pause\": true,\n        \"complete\": true,\n        \"defer\": false,\n        \"renew\": false\n      }\n    }\n  }\n}\n```\n\nTime tracking is off for the task:\n\n```json\n{\n  \"success\": true,\n  \"data\": null\n}\n```\n\n## Error response example\n\n422 — the key's user already has a timer running on another task, and `STOP_PREVIOUS` is not passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Another task (##287#) is now currently active. Please stop it before proceeding.\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\nThe `error.message` text comes from Bitrix24, so its wording and language depend on the Bitrix24 account language. Branch on `error.code`, not on the message text.\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` is not a positive integer: `taskId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | The request body is not a JSON object: `body must be an object` |\n| 400 | `INVALID_PARAMS` | The body contains fields other than `params`: `body contains unsupported fields` |\n| 400 | `INVALID_PARAMS` | `params` is not an object: `params must be an object` |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is missing |\n| 401 | `INVALID_API_KEY` | The key is not found |\n| 401 | `TOKEN_MISSING` | The key has no valid Bitrix24 token |\n| 403 | `SCOPE_DENIED` | The key lacks the `task` or `tasks` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |\n| 403 | `BITRIX_ACCESS_DENIED` | The key's user has no rights to the task |\n| 422 | `BITRIX_ERROR` | The key's user has a timer running on another task, and `STOP_PREVIOUS` is not `Y`: `Another task (##\u003Cid>#) is now currently active…` |\n| 422 | `BITRIX_ERROR` | No task exists with this `taskId`: `Task not found or not accessible` |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **Without time tracking the timer does not start, yet the response is successful.** If `allowTimeTracking` is off for the task, the call returns `200` with `data: null`. The task status does not change, and no entry appears in [time tracking](\u002Fdocs\u002Fentities\u002Ftasks\u002Ftime). Time tracking is turned on by the `allowTimeTracking` field when you [create](\u002Fdocs\u002Fentities\u002Ftasks\u002Fcreate) or [update](\u002Fdocs\u002Fentities\u002Ftasks\u002Fupdate) the task.\n- **A user can have only one timer running at a time.** With `STOP_PREVIOUS: \"Y\"` the timer on the other task stops, and its time is recorded in that task's time tracking.\n- **The task object in the response does not reflect the start.** Its `timerIsRunningForCurrentUser` field arrives as `N`, and for a task that was Pending, `status` is still `2` although the task has already moved to In Progress. Read the current state with [`GET \u002Fv1\u002Ftasks\u002F:id`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget).\n- **The timer stops with a separate call.** [Pausing the timer](\u002Fdocs\u002Fentities\u002Ftasks\u002Fpause-timer) records the time worked in the task's [time tracking](\u002Fdocs\u002Fentities\u002Ftasks\u002Ftime).\n\n## See also\n\n- [Pause task timer](\u002Fdocs\u002Fentities\u002Ftasks\u002Fpause-timer)\n- [Task time tracking](\u002Fdocs\u002Fentities\u002Ftasks\u002Ftime)\n- [Start task](\u002Fdocs\u002Fentities\u002Ftasks\u002Fstart)\n- [Get task](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget)\n- [Tasks](\u002Fdocs\u002Fentities\u002Ftasks)\n","2026-10-19",{},1794739437529]