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

Start task timer

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

Runs tasks.task.startTimer once. Requires the task scope (or tasks alias), a write-enabled key, and the Bitrix24 user's permission for the action.

Parameters

Parameter In Type Required Description
taskId path integer yes Positive task ID from task list.
params body object no Optional Bitrix24 parameters, passed through unchanged.

To stop the previous timer, send {"params":{"STOP_PREVIOUS":"Y"}}. The route does not set STOP_PREVIOUS by default.

Examples

curl — personal key

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

curl — OAuth application

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

JavaScript — personal key

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

JavaScript — OAuth application

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

Response

Field Type Description
success boolean true on success.
data any Unmodified Bitrix24 method result: a task object, null, or another method-specific value.

The example below shows one possible response form; it does not guarantee null.

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

Error response example

An invalid task ID in the path returns 400:

JSON
{"success":false,"error":{"code":"INVALID_PARAMS","message":"taskId must be a positive integer"}}

Errors

HTTP Code Condition
400 INVALID_PARAMS Invalid taskId or body field.
401 MISSING_API_KEY API key is missing.
401 INVALID_API_KEY API key is unknown.
401 TOKEN_MISSING No usable Bitrix24 token.
403 SCOPE_DENIED Key lacks the task or tasks scope.
403 WRITE_BLOCKED_READONLY_KEY The key cannot write.
403 BITRIX_ACCESS_DENIED Bitrix24 denied access.
422 BITRIX_ERROR Bitrix24 rejected the action.

Other shared API errors may apply. Branch on error.code; see the full error reference.

See also