Get Task Template by ID tasks.template.get

Scope: task

Who can execute the method: 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
        
try
        {
            const response = await $b24.callMethod(
                'tasks.template.get',
                {
                    templateId: 139
                }
            );
        
            const result = response.getData().result;
            console.log(result);
        }
        catch (error)
        {
            console.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);
        

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": "Smith",
                "CREATED_BY_LOGIN": "john.doe@example.com",
                "CREATED_BY_WORK_POSITION": "Employee",
                "CREATED_BY_PHOTO": "10001",
                "RESPONSIBLE_NAME": "Peter",
                "RESPONSIBLE_LAST_NAME": "Peters",
                "RESPONSIBLE_SECOND_NAME": "Petrovich",
                "RESPONSIBLE_LOGIN": "peter.peters@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 title 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 ID of the stage

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 responsible person can change the deadline

ALLOW_TIME_TRACKING
string

Indicator of time tracking for tasks based on the template

TASK_CONTROL
string

Indicator of the need to accept the work

ADD_IN_REPORT
string

Indicator of including the task in the performance report

GROUP_ID
integer

The ID of the project

PARENT_ID
integer

The ID of the parent template

MULTITASK
string

Indicator of a multi-task

SITE_ID
string

The ID of the site

ACCOMPLICES
string

Serialized list of Participants

AUDITORS
string

Serialized list of auditors

RESPONSIBLES
string

Serialized list of responsibles

FILES
array

List of template files

TAGS
array

List of template tags

DEPENDS_ON
array

List of template dependencies

MATCH_WORK_TIME
string

Indicator of considering working time when calculating deadlines

TASK_ID
integer

The ID of the related task

TPARAM_TYPE
integer

Type of additional parameters for the template

TPARAM_REPLICATION_COUNT
integer

Number of tasks already created based on the replication rule

REPLICATE_PARAMS
string

Serialized replication parameters

BASE_TEMPLATE_ID
integer

The ID of the base template

TEMPLATE_CHILDREN_COUNT
integer

Number of child templates

CREATED_BY_NAME
string

Creator's first name

CREATED_BY_LAST_NAME
string

Creator's last name

CREATED_BY_SECOND_NAME
string

Creator's middle name

CREATED_BY_LOGIN
string

Creator's login

CREATED_BY_WORK_POSITION
string

Creator's position

CREATED_BY_PHOTO
integer

Creator's photo ID

RESPONSIBLE_NAME
string

Responsible person's first name

RESPONSIBLE_LAST_NAME
string

Responsible person's last name

RESPONSIBLE_SECOND_NAME
string

Responsible person's middle name

RESPONSIBLE_LOGIN
string

Responsible person's login

RESPONSIBLE_WORK_POSITION
string

Responsible person's position

RESPONSIBLE_PHOTO
integer

Responsible person's photo ID

SCENARIO
string

Template creation scenario

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 may consist of digits, Latin letters, and underscores

error_description
error_description

Textual description of the error. The description is not intended to be shown to the end user in its raw form

Possible Error Codes

Status

Code

Description

Value

400

100

Could not find value for parameter

Required parameter templateId not provided

Statuses and System Error Codes

HTTP Status: 20x, 40x, 50x

The errors described below may occur when calling any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

405

ERROR_BATCH_METHOD_NOT_ALLOWED
Method is not allowed for batch usage

The current method is not allowed to be called using batch

400

ERROR_BATCH_LENGTH_EXCEEDED
Max batch length exceeded

The maximum length of parameters passed to the batch method has been exceeded

401

NO_AUTH_FOUND
Wrong authorization data

Invalid access token or webhook code

400

INVALID_REQUEST
Https required

The methods must be called using the HTTPS protocol

503

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support

403

ACCESS_DENIED
REST API is available only on commercial plans

The REST API is available only on commercial plans

403

INVALID_CREDENTIALS
Invalid request credentials

The user whose access token or webhook was used to call the method lacks permissions

404

ERROR_MANIFEST_IS_NOT_AVAILABLE
Manifest is not available

The manifest is not available

403

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

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

401

expired_token
The access token provided has expired

The provided access token has expired

403

user_access_error
The user does not have access to the application

The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users

500

PORTAL_DELETED
Portal was deleted

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

Continue Learning