Get Task Template List tasks.template.list

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: task

Who can execute the method: any user

The method tasks.template.list returns a list of task templates available to the user.

Method Parameters

Name
type

Description

params
object

Selection parameters (detailed description).

If params is not passed, the method returns all available templates with all fields

start
integer

Controls pagination.

The page size is always fixed at 50 records.

To get the second page of results, pass 50. To get the third page, pass 100, and so on.

The formula for calculating the start value:

start = (N - 1) * 50, where N is the number of the page you need

Parameter params

Only the following template fields can be used in select, filter, and order: ID, TITLE, DESCRIPTION, DESCRIPTION_IN_BBCODE, PRIORITY, STATUS, RESPONSIBLE_ID, TIME_ESTIMATE, REPLICATE, CREATED_BY, XML_ID, ALLOW_CHANGE_DEADLINE, ALLOW_TIME_TRACKING, TASK_CONTROL, ADD_IN_REPORT, MATCH_WORK_TIME, GROUP_ID, PARENT_ID, MULTITASK, SITE_ID, REPLICATE_PARAMS, TAGS, ACCOMPLICES, AUDITORS, RESPONSIBLES, DEPENDS_ON, DEADLINE_AFTER, START_DATE_PLAN_AFTER, END_DATE_PLAN_AFTER, TASK_ID, STAGE_ID, TPARAM_TYPE, TPARAM_REPLICATION_COUNT, REPLICATE_TYPE, ZOMBIE, FILES. The fields are described in Task Template Fields.

Name
type

Description

select
array

An array of fields to return.

User fields UF_* and the fields SE_CHECKLIST, SE_ACCESS, SE_TAG, and BASE_TEMPLATE_ID cannot be specified in select. The method returns them only if select is not passed.

The value * is not supported: the method returns error 140. To get all fields, do not pass select

filter
object

An object for filtering templates in the format {"field_1": "value", "field_2": "value"}.

You can put an operator before the field name:

  • ! — not equal
  • > — greater than
  • >= — greater than or equal
  • < — less than
  • <= — less than or equal
  • % — contains a substring

For example, {">ID": 70, "REPLICATE": "N"} selects non-recurring templates with an ID greater than 70

order
object

An object for sorting in the format {"field_1": "value", "field_2": "value"}.

Possible values:

  • ASC — ascending
  • DESC — descending

If you pass any other value, the method returns an empty list

Pass select, filter, and order only inside params. At the top level of the request, the method ignores them.

The method returns only the templates the user can view:

  • templates the user created
  • templates shared with the user in the template access settings
  • templates of employees in the user's department, if the user has the "View own department's templates" permission
  • templates of employees in other departments, if the user has the "View other departments' templates" permission

Bitrix24 administrator permissions do not extend the selection. The responsible person, participants, and observers of a template do not get access to it.

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{
          "params": {
            "select": ["ID", "TITLE", "CREATED_BY", "RESPONSIBLE_ID", "ACCOMPLICES", "AUDITORS", "REPLICATE", "GROUP_ID"],
            "filter": {
              "CREATED_BY": 1,
              "REPLICATE": "N"
            },
            "order": {
              "ID": "DESC"
            }
          },
          "start": 0
        }' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/tasks.template.list
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{
          "params": {
            "select": ["ID", "TITLE", "CREATED_BY", "RESPONSIBLE_ID", "ACCOMPLICES", "AUDITORS", "REPLICATE", "GROUP_ID"],
            "filter": {
              "CREATED_BY": 1,
              "REPLICATE": "N"
            },
            "order": {
              "ID": "DESC"
            }
          },
          "start": 0,
          "auth": "**put_access_token_here**"
        }' \
        https://**put_your_bitrix24_address**/rest/tasks.template.list
        
// 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
        
        type TaskTemplate = {
          ID: number
          TITLE: string
          CREATED_BY: string
          RESPONSIBLE_ID: string
          ACCOMPLICES: number[]
          AUDITORS: number[]
          REPLICATE: string
          GROUP_ID: string | null
        }
        
        // Shape of the payload returned in result (match the "response handling" section of the page)
        // An empty page comes as an array [], a non-empty one as an object keyed by template ID
        type TaskTemplateListResult = {
          task_templates: Record<string, TaskTemplate> | []
        }
        
        try {
          // tasks.template.list returns a single page (50 records). Pass `start` to get the next page.
          const response = await $b24.actions.v2.call.make<TaskTemplateListResult>({
            method: 'tasks.template.list',
            params: {
              params: {
                select: ['ID', 'TITLE', 'CREATED_BY', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS', 'REPLICATE', 'GROUP_ID'],
                filter: {
                  CREATED_BY: 1,
                  REPLICATE: 'N',
                },
                order: {
                  ID: 'DESC',
                },
              },
              start: 0,
            },
            requestId: Text.getUuidRfc4122()
          })
        
          // The payload is available only on a successful response
          if (!response.isSuccess) {
            console.error(response.getErrorMessages().join('; '))
          } else {
            const templates = Object.values(response.getData()!.result.task_templates)
            templates.forEach((template) => console.info(template.ID, template.TITLE))
          }
        } 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 getTaskTemplates() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              // tasks.template.list returns a single page (50 records). Pass `start` to get the next page.
              const response = await $b24.actions.v2.call.make({
                method: 'tasks.template.list',
                params: {
                  params: {
                    select: ['ID', 'TITLE', 'CREATED_BY', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS', 'REPLICATE', 'GROUP_ID'],
                    filter: {
                      CREATED_BY: 1,
                      REPLICATE: 'N',
                    },
                    order: {
                      ID: 'DESC',
                    },
                  },
                  start: 0,
                },
                requestId: B24Js.Text.getUuidRfc4122()
              })
        
              // The payload is available only on a successful response
              if (!response.isSuccess) {
                console.error(response.getErrorMessages().join('; '))
                return
              }
        
              // An empty page comes as an array [], a non-empty one as an object keyed by template ID
              const templates = Object.values(response.getData().result.task_templates)
              templates.forEach((template) => console.info(template.ID, template.TITLE))
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', getTaskTemplates)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            # b24pysdk has no wrapper for tasks.template.list, so the method
            # is called directly via bitrix_token.call_method()
            response = bitrix_token.call_method(
                api_method="tasks.template.list",
                params={
                    "params": {
                        "select": ["ID", "TITLE", "CREATED_BY", "RESPONSIBLE_ID", "ACCOMPLICES", "AUDITORS", "REPLICATE", "GROUP_ID"],
                        "filter": {
                            "CREATED_BY": 1,
                            "REPLICATE": "N",
                        },
                        "order": {
                            "ID": "DESC",
                        },
                    },
                    "start": 0,
                },
            )
            # An empty page comes as an array [], a non-empty one as an object keyed by template ID
            templates = response["result"]["task_templates"] or {}
            for template in templates.values():
                print(template["ID"], template["TITLE"])
        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.list',
                    [
                        'params' => [
                            'select' => ['ID', 'TITLE', 'CREATED_BY', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS', 'REPLICATE', 'GROUP_ID'],
                            'filter' => [
                                'CREATED_BY' => 1,
                                'REPLICATE' => 'N',
                            ],
                            'order' => [
                                'ID' => 'DESC',
                            ],
                        ],
                        'start' => 0,
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            print_r($result);
        
        } catch (Throwable $e) {
            echo 'Error retrieving the template list: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'tasks.template.list',
            {
                params: {
                    select: ['ID', 'TITLE', 'CREATED_BY', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS', 'REPLICATE', 'GROUP_ID'],
                    filter: {
                        CREATED_BY: 1,
                        REPLICATE: 'N'
                    },
                    order: {
                        ID: 'DESC'
                    }
                },
                start: 0
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error());
                }
                else
                {
                    console.log(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'tasks.template.list',
            [
                'params' => [
                    'select' => ['ID', 'TITLE', 'CREATED_BY', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS', 'REPLICATE', 'GROUP_ID'],
                    'filter' => [
                        'CREATED_BY' => 1,
                        'REPLICATE' => 'N',
                    ],
                    'order' => [
                        'ID' => 'DESC',
                    ],
                ],
                'start' => 0,
            ]
        );
        
        print_r($result);
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "tasks.template.list", b24.Params{
        	"params": b24.Params{
        		"select": []string{"ID", "TITLE", "CREATED_BY", "RESPONSIBLE_ID", "ACCOMPLICES", "AUDITORS", "REPLICATE", "GROUP_ID"},
        		"filter": b24.Params{
        			"CREATED_BY": 1,
        			"REPLICATE":  "N",
        		},
        		"order": b24.Params{
        			"ID": "DESC",
        		},
        	},
        	"start": 0,
        }, b24.WithIdempotent())
        if err != nil {
        	return fmt.Errorf("tasks.template.list: %w", err)
        }
        
        // An empty page comes as an array [], a non-empty one as an object keyed by template ID,
        // so unmarshal task_templates into json.RawMessage first
        var page struct {
        	TaskTemplates json.RawMessage `json:"task_templates"`
        }
        if err := json.Unmarshal(res.Result, &page); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        
        templates := map[string]struct {
        	ID    b24.ID `json:"ID"`
        	Title string `json:"TITLE"`
        }{}
        if len(page.TaskTemplates) > 0 && page.TaskTemplates[0] == '{' {
        	if err := json.Unmarshal(page.TaskTemplates, &templates); err != nil {
        		return fmt.Errorf("parse templates: %w", err)
        	}
        }
        for _, template := range templates {
        	fmt.Println(template.ID, template.Title)
        }
        

Response Handling

HTTP Status: 200

{
            "result": {
                "task_templates": {
                    "77": {
                        "ID": 77,
                        "TITLE": "Checklist test template",
                        "CREATED_BY": "1",
                        "RESPONSIBLE_ID": "1",
                        "ACCOMPLICES": [],
                        "AUDITORS": [],
                        "REPLICATE": "N",
                        "GROUP_ID": null
                    }
                }
            },
            "total": 1,
            "time": {
                "start": 1795003871,
                "finish": 1795003871.889437,
                "duration": 0.8894369602203369,
                "processing": 0,
                "date_start": "2026-11-18T15:11:11+03:00",
                "date_finish": "2026-11-18T15:11:11+03:00",
                "operating_reset_at": 1795004280,
                "operating": 0.1682889461517334
            }
        }
        

Returned Data

Name
type

Description

result
object

Root element of the response (detailed description)

next
integer

The start value for the next page. Returned if there are more records in the selection

total
integer

Total number of templates that match the filter and are available to the user

time
time

Information about the request execution time

Object result

Name
type

Description

task_templates
object

Task templates. The key is the template ID, the value is an object with the fields from select.

If no fields are passed in select, the template object contains all fields, including user fields UF_*, SE_CHECKLIST, SE_ACCESS, SE_TAG, and BASE_TEMPLATE_ID. The fields are described in Task Template Fields.

Unlike tasks.template.get, the fields ACCOMPLICES, AUDITORS, RESPONSIBLES, and DEPENDS_ON are returned as arrays, and REPLICATE_PARAMS as an object.

If there are no templates, an empty array [] is returned

Error Handling

HTTP Status: 400

{
            "error": "INVALID_QUERY",
            "error_description": "Invalid template query parameters"
        }
        

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

INVALID_QUERY

Invalid template query parameters

Possible reasons:

  • select, filter, or order contains a field that is not in the list of allowed fields
  • select, filter, or order is not passed as an array

400

100

Invalid value {x} to match with parameter {params}. Should be value of type array.

The params parameter is not passed as an object

400

140

Internal server error.

The value * is passed in select

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

503

BITRIX_REST_V3_EXCEPTION_LIMITER_QUERYTIMELIMITEXCEPTION
Request canceled: query time limit exceeded

The SQL query inside the method ran longer than the SQL query time limit. The Retry-After header contains the limit in seconds

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 lasts 5 minutes, after which the accumulated execution time of the method is counted from zero

429

BITRIX_REST_V3_EXCEPTION_RATELIMITEXCEPTION
Request was blocked because the limit was exceeded

The same block in REST 3.0 methods. The Retry-After header contains the remaining block time in seconds

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

REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — REST is available only by subscription

403

FEATURE_NOT_AVAILABLE_ON_CURRENT_PLAN
This feature is not available on your current plan.

The Bitrix24 Market application is blocked because the number of installed applications exceeds the plan limit. Events are not delivered to such an application. Applications exempt from the limit are not blocked

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