Get Task Template by ID tasks.template.get

If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.

Scope: task

Who can execute the method: a user with permission to view the template

The method tasks.template.get returns the task template data by its ID.

Method Parameters

Required parameters are marked with *

Name
type

Description

templateId*
integer

The ID of the task template.

The task template ID can be obtained when creating a new template

params
object

Additional selection parameters (detailed description)

Parameter params

Name
type

Description

select
array

An array of fields to return.

By default, ['*', 'UF_*'] is used — select all fields and custom fields

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{
          "templateId": 139
        }' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/tasks.template.get
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{
          "templateId": 139,
          "auth": "**put_access_token_here**"
        }' \
        https://**put_your_bitrix24_address**/rest/tasks.template.get
        
// This snippet is an ES module: top-level await requires type="module" or a bundler.
        // $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
        import { Text } from '@bitrix24/b24jssdk'
        import type { B24Frame } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        // Shape of the payload returned in result (match the "response handling" section of the page)
        type TaskTemplateResult = {
          ID: string
          TITLE: string
          DESCRIPTION: string
          RESPONSIBLE_ID: string
          CREATED_BY: string
          REPLICATE: string
          STATUS: string
        }
        
        try {
          const response = await $b24.actions.v2.call.make<TaskTemplateResult>({
            method: 'tasks.template.get',
            params: {
              templateId: 139,
            },
            requestId: Text.getUuidRfc4122()
          })
        
          // The payload is available only on a successful response
          if (!response.isSuccess) {
            console.error(response.getErrorMessages().join('; '))
          } else {
            const result = response.getData()!.result
            console.info(result.ID, result.TITLE, result.RESPONSIBLE_ID)
          }
        } catch (error) {
          // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
          console.error(error)
        }
        
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
        <script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
        <script>
          async function getTaskTemplate() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              const response = await $b24.actions.v2.call.make({
                method: 'tasks.template.get',
                params: {
                  templateId: 139,
                },
                requestId: B24Js.Text.getUuidRfc4122()
              })
        
              // The payload is available only on a successful response
              if (!response.isSuccess) {
                console.error(response.getErrorMessages().join('; '))
                return
              }
        
              const result = response.getData().result
              console.info(result.ID, result.TITLE, result.RESPONSIBLE_ID)
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', getTaskTemplate)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.tasks.template.get(template_id=139).response
            result = bitrix_response.result
            print(result)
        except BitrixAPIError as error:
            print(
                "Bitrix API error",
                f"error: {error.error}",
                f"error_description: {error.error_description}",
                sep="\n",
            )
        except BitrixSDKException as error:
            print(f"Bitrix SDK error: {error.message}")
        except Exception as error:
            print(f"Unexpected error: {error}")
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'tasks.template.get',
                    [
                        'templateId' => 139
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            print_r($result);
        
        } catch (Throwable $e) {
            echo 'Error retrieving template: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'tasks.template.get',
            {
                templateId: 139
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'tasks.template.get',
            [
                'templateId' => 139
            ]
        );
        
        print_r($result);
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "tasks.template.get", b24.Params{
        	"templateId": 139,
        }, b24.WithIdempotent())
        if err != nil {
        	return fmt.Errorf("tasks.template.get: %w", err)
        }
        
        var item struct {
        	ID                  b24.ID `json:"ID"`
        	Title               string `json:"TITLE"`
        	Description         string `json:"DESCRIPTION"`
        	DescriptionInBbcode string `json:"DESCRIPTION_IN_BBCODE"`
        	Priority            string `json:"PRIORITY"`
        	Status              string `json:"STATUS"`
        }
        if err := json.Unmarshal(res.Result, &item); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        fmt.Println(item.ID, item.Title)
        

Response Handling

HTTP Status: 200

{
            "result": {
                "ID": "139",
                "TITLE": "Preparation of Weekly Project Status",
                "DESCRIPTION": "Task template for preparing and agreeing on the weekly project status with the team and manager",
                "DESCRIPTION_IN_BBCODE": "Y",
                "PRIORITY": "2",
                "STATUS": "1",
                "STAGE_ID": "0",
                "RESPONSIBLE_ID": "102",
                "DEADLINE_AFTER": null,
                "START_DATE_PLAN_AFTER": "32400",
                "END_DATE_PLAN_AFTER": "97200",
                "REPLICATE": "Y",
                "CREATED_BY": "101",
                "XML_ID": null,
                "ALLOW_CHANGE_DEADLINE": "Y",
                "ALLOW_TIME_TRACKING": "Y",
                "TASK_CONTROL": "N",
                "ADD_IN_REPORT": "N",
                "GROUP_ID": "0",
                "PARENT_ID": "8131",
                "MULTITASK": "N",
                "SITE_ID": "s1",
                "ACCOMPLICES": "a:0:{}",
                "AUDITORS": "a:0:{}",
                "RESPONSIBLES": "a:1:{i:0;s:3:\"102\";}",
                "FILES": null,
                "TAGS": null,
                "DEPENDS_ON": null,
                "MATCH_WORK_TIME": "Y",
                "TASK_ID": null,
                "TPARAM_TYPE": "0",
                "TPARAM_REPLICATION_COUNT": "0",
                "REPLICATE_PARAMS": "a:19:{s:6:\"PERIOD\";s:6:\"weekly\";s:12:\"WORKDAY_ONLY\";s:1:\"N\";s:9:\"WEEK_DAYS\";a:1:{i:0;i:2;}s:4:\"TIME\";s:5:\"11:00\";s:15:\"TIMEZONE_OFFSET\";i:0;s:11:\"REPEAT_TILL\";s:7:\"endless\";s:10:\"START_DATE\";s:19:\"16.03.2026 00:00:00\";s:9:\"EVERY_DAY\";i:1;s:10:\"EVERY_WEEK\";i:1;s:15:\"MONTHLY_DAY_NUM\";i:1;s:19:\"MONTHLY_MONTH_NUM_1\";i:1;s:19:\"MONTHLY_MONTH_NUM_2\";i:1;s:14:\"YEARLY_DAY_NUM\";i:1;s:8:\"END_DATE\";N;s:12:\"MONTHLY_TYPE\";i:1;s:11:\"YEARLY_TYPE\";i:1;s:14:\"DEADLINE_AFTER\";i:0;s:15:\"DEADLINE_OFFSET\";i:0;s:19:\"NEXT_EXECUTION_TIME\";s:19:\"17.03.2026 11:00:00\";}",
                "BASE_TEMPLATE_ID": "0",
                "TEMPLATE_CHILDREN_COUNT": "0",
                "CREATED_BY_NAME": "John",
                "CREATED_BY_LAST_NAME": "Doe",
                "CREATED_BY_SECOND_NAME": "Michael",
                "CREATED_BY_LOGIN": "john.doe@example.com",
                "CREATED_BY_WORK_POSITION": "Employee",
                "CREATED_BY_PHOTO": "10001",
                "RESPONSIBLE_NAME": "Peter",
                "RESPONSIBLE_LAST_NAME": "Smith",
                "RESPONSIBLE_SECOND_NAME": "John",
                "RESPONSIBLE_LOGIN": "peter.smith@example.com",
                "RESPONSIBLE_WORK_POSITION": "Employee",
                "RESPONSIBLE_PHOTO": "10002",
                "SCENARIO": "default",
                "UF_CRM_TASK": [
                    "L_1179",
                    "D_1833"
                ],
                "UF_TASK_WEBDAV_FILES": [
                    1117
                ]
            },
            "time": {
                "start": 1773219184,
                "finish": 1773219184.579376,
                "duration": 0.5793759822845459,
                "processing": 0,
                "date_start": "2026-03-11T11:53:04+01:00",
                "date_finish": "2026-03-11T11:53:04+01:00",
                "operating_reset_at": 1773219784,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
object

Task template data (detailed description).

Returns false:

  • if templateId is passed empty
  • if a template with the specified templateId does not exist
  • if the user does not have permission to view the template

time
time

Information about the request execution time

Object result

Name
type

Description

ID
integer

The ID of the task template

TITLE
string

The name of the template

DESCRIPTION
string

The description of the template

DESCRIPTION_IN_BBCODE
string

Indicator that the description is stored in BBCode format

PRIORITY
integer

The priority of the task

STATUS
integer

The status of the template

STAGE_ID
integer

The stage ID

RESPONSIBLE_ID
integer

The ID of the responsible person

DEADLINE_AFTER
datetime

Deadline offset relative to the creation date of the task template

START_DATE_PLAN_AFTER
string

Planned start date offset in seconds

END_DATE_PLAN_AFTER
string

Planned end date offset in seconds

REPLICATE
string

Indicator of a recurring task

CREATED_BY
integer

The ID of the Creator

XML_ID
string

External ID of the template

ALLOW_CHANGE_DEADLINE
string

Indicator that the executor can change the deadline

ALLOW_TIME_TRACKING
string

Indicator for time tracking for tasks based on the template

TASK_CONTROL
string

Indicator of the need to accept the work

ADD_IN_REPORT
string

Indicator for including the task in the performance report

GROUP_ID
integer

The project ID

PARENT_ID
integer

The ID of the parent template

MULTITASK
string

Indicator of a multi-task

SITE_ID
string

The site ID

ACCOMPLICES
string

Serialized list of Participants

AUDITORS
string

Serialized list of auditors

RESPONSIBLES
string

Serialized list of responsible persons

FILES
array

List of template files

TAGS
array

List of template tags

DEPENDS_ON
array

List of template dependencies

MATCH_WORK_TIME
string

Indicator for considering working time when calculating deadlines

TASK_ID
integer

The ID of the related task

TPARAM_TYPE
integer

Type of additional template parameters

TPARAM_REPLICATION_COUNT
integer

The number of tasks already created by the repetition rule

REPLICATE_PARAMS
string

Serialized repetition parameters

BASE_TEMPLATE_ID
integer

The ID of the base template

TEMPLATE_CHILDREN_COUNT
integer

The number of child templates

CREATED_BY_NAME
string

The name of the Creator

CREATED_BY_LAST_NAME
string

The last name of the Creator

CREATED_BY_SECOND_NAME
string

The middle name of the Creator

CREATED_BY_LOGIN
string

The login of the Creator

CREATED_BY_WORK_POSITION
string

The position of the Creator

CREATED_BY_PHOTO
integer

The ID of the Creator's photo

RESPONSIBLE_NAME
string

The name of the responsible person

RESPONSIBLE_LAST_NAME
string

The last name of the responsible person

RESPONSIBLE_SECOND_NAME
string

The middle name of the responsible person

RESPONSIBLE_LOGIN
string

The login of the responsible person

RESPONSIBLE_WORK_POSITION
string

The position of the responsible person

RESPONSIBLE_PHOTO
integer

The ID of the responsible person's photo

SCENARIO
string

The scenario for creating the template

UF_CRM_TASK
array

Links to CRM objects

UF_TASK_WEBDAV_FILES
array

IDs of Drive files linked to the template

Error Handling

HTTP Status: 400

{
            "error": "100",
            "error_description": "Could not find value for parameter {templateId}"
        }
        

Name
type

Description

error
string

String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only error_description shows the reason

error_description
string

Error message for the developer. Do not show it to the end user without processing

Possible Error Codes

Status

Code

Description

Value

400

100

Could not find value for parameter

Required parameter templateId is missing

Statuses and System Error Codes

HTTP Status: 4xx, 5xx

The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

429

OPERATION_TIME_LIMIT
Method is blocked due to operation time limit

The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit

401

NO_AUTH_FOUND
Wrong authorization data

The request contains no authorization data: neither an access token nor a webhook code was passed

401

INVALID_REQUEST
Https required

Methods are called over the HTTPS protocol only

401

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support

401

ACCESS_DENIED
REST is available only on commercial plans

The REST API is available only on commercial plans. A webhook receives a different error message — REST is available only by subscription

401

INVALID_CREDENTIALS
Invalid request credentials

No active webhook with the specified user identifier and secret code was found

404

ERROR_METHOD_NOT_FOUND
Method not found!

No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope

401

insufficient_scope
The request requires higher privileges than provided by the webhook token

The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with provided by the access token

401

expired_token
The access token provided has expired

The access token has expired

401

user_access_error
The user does not have access to the application

The application is installed, but the Bitrix24 administrator has granted access to it only to specific users

403

PORTAL_DELETED
Portal was deleted

The public part of the site is closed. To open it on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site

Continue Learning