For AI agents: markdown of this page — /docs-content-en/entities/tasks/pause-timer.md documentation index — /llms.txt

Pause task timer

POST /v1/tasks/:taskId/pause-timer

Stops the time-tracking timer the key's user started on a task and records the worked time in the task's time tracking.

Parameters

Parameter Type Required Description
ParametertaskId (path) Typenumber Requiredyes DescriptionTask ID. List: GET /v1/tasks

Request fields (body)

Field Type Required Description
Fieldparams Typeobject Requiredno DescriptionAdditional action parameters. Passed to Bitrix24 unchanged

The request body can be empty or {}. Any field other than params is rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

Terminal
curl -X POST 'https://vibecode.bitrix24.com/v1/tasks/289/pause-timer' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{}'

curl — OAuth application

Terminal
curl -X POST 'https://vibecode.bitrix24.com/v1/tasks/289/pause-timer' \
  -H 'X-Api-Key: YOUR_APP_KEY' \
  -H 'Authorization: Bearer USER_SESSION_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{}'

JavaScript — personal key

javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/pause-timer', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
})
const result = await response.json()
console.log(result.data)

JavaScript — OAuth application

javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/pause-timer', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
})
const result = await response.json()
console.log(result.data)

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata Typeobject | null Descriptionnull if time tracking is off for the task. The call changes nothing in that case
Fielddata.task Typeobject DescriptionThe 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 /v1/tasks/:id returns the same fields as numbers and true/false
Fielddata.task.id Typestring DescriptionTask ID
Fielddata.task.status Typestring DescriptionTask status. Pausing the timer does not change it: the task stays at 3 — In Progress
Fielddata.task.allowTimeTracking Typestring DescriptionTime tracking for the task: Y — on
Fielddata.task.action Typeobject DescriptionWhich 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

Response example

Time tracking is on. Only the main fields of the task object are shown:

JSON
{
  "success": true,
  "data": {
    "task": {
      "id": "289",
      "title": "Prepare the quarterly report",
      "status": "3",
      "createdBy": "1",
      "responsibleId": "1",
      "allowTimeTracking": "Y",
      "timeElapsed": "6",
      "action": {
        "start": false,
        "pause": true,
        "complete": true,
        "defer": false,
        "renew": false
      }
    }
  }
}

Time tracking is off for the task:

JSON
{
  "success": true,
  "data": null
}

Error response example

422 — no timer is running on the task:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Cannot stop task timer",
    "b24Code": "0"
  }
}

The 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.

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptiontaskId is not a positive integer: taskId must be a positive integer
HTTP400 CodeINVALID_PARAMS DescriptionThe request body is not a JSON object: body must be an object
HTTP400 CodeINVALID_PARAMS DescriptionThe body contains fields other than params: body contains unsupported fields
HTTP400 CodeINVALID_PARAMS Descriptionparams is not an object: params must be an object
HTTP401 CodeMISSING_API_KEY DescriptionX-Api-Key is missing
HTTP401 CodeINVALID_API_KEY DescriptionThe key is not found
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no valid Bitrix24 token
HTTP403 CodeSCOPE_DENIED DescriptionThe key lacks the task or tasks scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe key's user has no rights to the task
HTTP422 CodeBITRIX_ERROR DescriptionTime tracking is on, but no timer is running on the task: Cannot stop task timer
HTTP422 CodeBITRIX_ERROR DescriptionNo task exists with this taskId: Task not found or not accessible

The full list of common API errors — Errors.

Known specifics

  • Without time tracking the call does nothing, yet the response is successful. If allowTimeTracking is off for the task, you get 200 with data: null. Time tracking is turned on by the allowTimeTracking field when you create or update the task.
  • Pausing the timer does not pause the task. The task stays In Progress. To return it to Pending, call pause task.
  • Where to see the worked time. Each stop adds an entry to the task's time tracking: the start and end of the interval and its length in seconds.

See also