For AI agents: markdown of this page — /docs-content-en/entities/tasks/pin.md documentation index — /llms.txt
Pin a task
POST /v1/tasks/:taskId/pin
Pins a task to the top of the personal task list of the user the key acts on behalf of. The action is available to a participant with view access to the task — edit rights on the task are not required, unlike PATCH /v1/tasks/:id.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
ParametertaskId |
Inpath | Typeinteger | Requiredyes | DescriptionTask ID. List: GET /v1/tasks |
The request body is empty.
Examples
curl — personal key
curl -X POST -H "X-Api-Key: YOUR_API_KEY" \
https://vibecode.bitrix24.com/v1/tasks/289/pin
curl — OAuth application
curl -X POST -H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
https://vibecode.bitrix24.com/v1/tasks/289/pin
JavaScript — personal key
const res = await fetch(
`https://vibecode.bitrix24.com/v1/tasks/${taskId}/pin`,
{ method: 'POST', headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
)
const body = await res.json()
console.log(body.data.pinned) // true
JavaScript — OAuth application
const res = await fetch(
`https://vibecode.bitrix24.com/v1/tasks/${taskId}/pin`,
{
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
}
)
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on successful pin |
Fielddata.taskId |
Typeinteger | DescriptionTask ID |
Fielddata.pinned |
Typeboolean | Descriptiontrue — the task is pinned |
Response example
{
"success": true,
"data": {
"taskId": 289,
"pinned": true
}
}
Error response example
404 — task not found or not accessible:
{
"success": false,
"error": {
"code": "TASK_NOT_FOUND",
"message": "Task 99999999 not found or not accessible."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptiontaskId in the path is not a positive integer |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header was not provided |
| HTTP401 | CodeINVALID_API_KEY |
DescriptionThe key is not recognized — no such key exists on the platform |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no linked authorization tokens |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key is missing the task scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is read-only — the action changes data and is blocked |
| HTTP404 | CodeTASK_NOT_FOUND |
DescriptionNo task with the given taskId exists or it is not accessible to the user |
Full list of common API errors — Errors.
Known specifics
- The response is a short confirmation, not a task card. Read the full task fields via
GET /v1/tasks/:id.