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

Update a task template

PATCH /v1/task-templates/:templateId

Changes task template fields. Pass only the fields to change in fields, with their Bitrix24 names, without renaming.

Parameters

Parameter Type Required Description
ParametertemplateId (path) Typenumber Requiredyes DescriptionTemplate ID, a positive integer. List: GET /v1/task-templates

Request fields (body)

Field Type Required Description
Fieldfields Typeobject Requiredyes DescriptionTemplate fields to change. Passed to Bitrix24 unchanged
Fieldfields.TITLE Typestring Requiredno DescriptionTitle of the template and of the future task
Fieldfields.DESCRIPTION Typestring Requiredno DescriptionTask description
Fieldfields.PRIORITY Typenumber Requiredno DescriptionPriority: 0 — low, 1 — normal, 2 — high
Fieldparams Typeobject Requiredno DescriptionAdditional Bitrix24 parameters. Passed unchanged

The body must not contain keys other than fields and params. Fields absent from fields are not changed.

Examples

curl — personal key

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/task-templates/75" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "TITLE": "Monthly status report",
      "DESCRIPTION": "Summarize the results of the month",
      "PRIORITY": 2
    }
  }'

curl — OAuth application

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/task-templates/75" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "TITLE": "Monthly status report",
      "DESCRIPTION": "Summarize the results of the month",
      "PRIORITY": 2
    }
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/task-templates/75', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fields: {
      TITLE: 'Monthly status report',
      DESCRIPTION: 'Summarize the results of the month',
      PRIORITY: 2,
    },
  }),
})

const { success, data } = await res.json()
if (data !== true) {
  console.log('Template not found')
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/task-templates/75', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fields: {
      TITLE: 'Monthly status report',
      DESCRIPTION: 'Summarize the results of the month',
      PRIORITY: 2,
    },
  }),
})

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue if the request was accepted
Fielddata Typeboolean Descriptiontrue — the template was updated. false — there is no template with this templateId; the response still comes with status 200, not 404

Response example

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

Error response example

400 — the body has no fields object:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Expected fields and only fields, params"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptiontemplateId is not a positive integer. Message templateId must be a positive integer
HTTP400 CodeINVALID_PARAMS DescriptionThe body is not a JSON object, has no fields object, contains keys other than fields and params, or params is not an object
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no Bitrix24 tokens
HTTP403 CodeSCOPE_DENIED DescriptionThe key does not have the task scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in read-only mode. error.details.switchUrl holds the address of the section where the mode is changed
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the call. The text is in error.message
HTTP429 CodeRATE_LIMITED DescriptionRequest rate exceeded. The effective cap is in the x-ratelimit-limit header

Full list of common API errors — Errors.

Known specifics

An empty fields also returns true. A request with "fields": {} changes nothing and returns "data": true.

See also