Get Task History tasks.task.history.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 with read access to the task

The method tasks.task.history.list retrieves the history of changes for a task.

Method Parameters

Required parameters are marked with *

Name
type

Description

taskId*
integer

The identifier of the task for which the history needs to be retrieved.

The task identifier can be obtained when creating a new task or by using the get task list method

filter
object

Filter by event type in the format {FIELD: 'EVENT'}. A list of possible values for FIELD is described below

order
object

An object for sorting the result in the form {"field": "sort value", ... }.

The sorting direction can take the following values:

  • asc — ascending
  • desc — descending

By default, records are sorted in descending order by creation time, meaning from newest to oldest

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"taskId":8137,"filter":{"FIELD":"COMMENT"},"order":{"createdDate":"ASC"}}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/tasks.task.history.list
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"taskId":8137,"filter":{"FIELD":"COMMENT"},"order":{"createdDate":"ASC"},"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/tasks.task.history.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, ISODate } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        // Shape of the payload returned in result (match the "response handling" section of the page)
        type TaskHistoryResult = {
          list: Array<{
            id: number
            createdDate: ISODate
            field: string
            value: {
              from: string | null
              to: string | null
            }
            user: {
              id: number
              name: string
              lastName: string
              secondName: string
              login: string
            }
          }>
        }
        
        try {
          // tasks.task.history.list returns a single page (max 50 records). For the whole result set
          // use a list helper: $b24.actions.v2.callList.make() returns every record as one
          // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
          // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
          // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
          const response = await $b24.actions.v2.call.make<TaskHistoryResult>({
            method: 'tasks.task.history.list',
            params: {
              taskId: 8137,
              filter: { FIELD: 'COMMENT' },
              order: { createdDate: 'ASC' },
              start: 0,
            },
            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('History entries:', result.list.length, result.list)
          }
        } 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 fetchTaskHistory() {
            try {
              // Initialize the SDK inside a Bitrix24 frame
              const $b24 = await B24Js.initializeB24Frame()
        
              // tasks.task.history.list returns a single page (max 50 records). For the whole result set
              // use a list helper: $b24.actions.v2.callList.make() returns every record as one
              // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
              // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
              // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
              const response = await $b24.actions.v2.call.make({
                method: 'tasks.task.history.list',
                params: {
                  taskId: 8137,
                  filter: { FIELD: 'COMMENT' },
                  order: { createdDate: 'ASC' },
                  start: 0,
                },
                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('History entries:', result.list.length, result.list)
            } catch (error) {
              // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
              console.error(error)
            }
          }
        
          document.addEventListener('DOMContentLoaded', fetchTaskHistory)
        </script>
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.tasks.task.history.list(
                task_id=8137,
                filter={
                    "FIELD": "COMMENT",
                },
                order={
                    "createdDate": "ASC",
                },
                start=0,
            ).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}")
        

Example as_list

from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.tasks.task.history.list(
                task_id=8137,
                filter={
                    "FIELD": "COMMENT",
                },
                order={
                    "createdDate": "ASC",
                },
            ).as_list().response
            result = bitrix_response.result
            for item in result:
                print(item)
        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}")
        

Example as_list_fast

from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.tasks.task.history.list(
                task_id=8137,
                filter={
                    "FIELD": "COMMENT",
                },
                order={
                    "createdDate": "ASC",
                },
            ).as_list_fast(descending=True).response
            result = bitrix_response.result
            for item in result:
                print(item)
        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.task.history.list',
                    [
                        'taskId' => 8137,
                        'filter' => ['FIELD' => 'COMMENT'],
                        'order' => ['createdDate' => 'ASC']
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . print_r($result, true);
            processData($result);
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error fetching task history: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'tasks.task.history.list',
            {
                taskId: 8137,
                filter: { FIELD: 'COMMENT' },
                order: {createdDate: 'ASC'},
            },
            function(result){
                console.info(result.data());
                console.log(result);
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'tasks.task.history.list',
            [
                'taskId' => 8137,
                'filter' => ['FIELD' => 'COMMENT'],
                'order' => ['createdDate' => 'ASC']
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "tasks.task.history.list", b24.Params{
        	"taskId": 8137,
        	"filter": b24.Params{
        		"FIELD": "COMMENT",
        	},
        	"order": b24.Params{
        		"createdDate": "ASC",
        	},
        }, b24.WithIdempotent())
        if err != nil {
        	return fmt.Errorf("tasks.task.history.list: %w", err)
        }
        
        // The response arrives as json.RawMessage — unmarshal it
        // into a struct matching the response shape shown below on this page.
        fmt.Printf("%s\n", res.Result)
        

Response Handling

HTTP Status: 200

{
            "result": {
                "list": [
                    {
                        "id": 16359,
                        "createdDate": "2025-09-25T14:09:45+02:00",
                        "field": "NEW",
                        "value": {
                            "from": null,
                            "to": null
                        },
                        "user": {
                            "id": 503,
                            "name": "Maria",
                            "lastName": "Johnson",
                            "secondName": "",
                            "login": "maria@mysite.com"
                        }
                    },
                    {
                        "id": 16361,
                        "createdDate": "2025-09-25T14:09:45+02:00",
                        "field": "COMMENT",
                        "value": {
                            "from": null,
                            "to": "3409"
                        },
                        "user": {
                            "id": 503,
                            "name": "Maria",
                            "lastName": "Johnson",
                            "secondName": "",
                            "login": "maria@mysite.com"
                        }
                    },
                    {
                        "id": 16363,
                        "createdDate": "2025-09-25T14:09:45+02:00",
                        "field": "CHECKLIST_ITEM_CREATE",
                        "value": {
                            "from": "",
                            "to": "What to do"
                        },
                        "user": {
                            "id": 503,
                            "name": "Maria",
                            "lastName": "Johnson",
                            "secondName": "",
                            "login": "maria@mysite.com"
                        }
                    },
                    {
                        "id": 16365,
                        "createdDate": "2025-09-25T14:09:45+02:00",
                        "field": "CHECKLIST_ITEM_CREATE",
                        "value": {
                            "from": "",
                            "to": "Contact the client"
                        },
                        "user": {
                            "id": 503,
                            "name": "Maria",
                            "lastName": "Johnson",
                            "secondName": "",
                            "login": "maria@mysite.com"
                        }
                    },
                    {
                        "id": 16367,
                        "createdDate": "2025-09-25T14:09:45+02:00",
                        "field": "CHECKLIST_ITEM_CREATE",
                        "value": {
                            "from": "",
                            "to": "Prepare the contract"
                        },
                        "user": {
                            "id": 503,
                            "name": "Maria",
                            "lastName": "Johnson",
                            "secondName": "",
                            "login": "maria@mysite.com"
                        }
                    },
                    {
                        "id": 16369,
                        "createdDate": "2025-09-25T14:09:45+02:00",
                        "field": "CHECKLIST_ITEM_CREATE",
                        "value": {
                            "from": "",
                            "to": "Sign the contract"
                        },
                        "user": {
                            "id": 503,
                            "name": "Maria",
                            "lastName": "Johnson",
                            "secondName": "",
                            "login": "maria@mysite.com"
                        }
                    },
                    {
                        "id": 16371,
                        "createdDate": "2025-09-25T14:09:57+02:00",
                        "field": "AUDITORS",
                        "value": {
                            "from": "",
                            "to": "547"
                        },
                        "user": {
                            "id": 503,
                            "name": "Maria",
                            "lastName": "Johnson",
                            "secondName": "",
                            "login": "maria@mysite.com"
                        }
                    },
                    {
                        "id": 16375,
                        "createdDate": "2025-09-25T14:09:57+02:00",
                        "field": "COMMENT",
                        "value": {
                            "from": null,
                            "to": "3411"
                        },
                        "user": {
                            "id": 503,
                            "name": "Maria",
                            "lastName": "Johnson",
                            "secondName": "",
                            "login": "maria@mysite.com"
                        }
                    },
                    {
                        "id": 16373,
                        "createdDate": "2025-09-25T14:09:58+02:00",
                        "field": "COMMENT",
                        "value": {
                            "from": null,
                            "to": "3413"
                        },
                        "user": {
                            "id": 503,
                            "name": "Maria",
                            "lastName": "Johnson",
                            "secondName": "",
                            "login": "maria@mysite.com"
                        }
                    }
                ],
            },
            "time": {
                "start": 1758798620,
                "finish": 1758798620.969019,
                "duration": 0.9690189361572266,
                "processing": 0,
                "date_start": "2025-09-25T14:10:20+02:00",
                "date_finish": "2025-09-25T14:10:20+02:00",
                "operating_reset_at": 1758799220,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
object

The root element of the response. Contains an array list, which includes objects with event descriptions for the task.

Returns an empty array "list":[] if the task does not exist

time
time

Information about the request execution time

Objects lists

Name
type

Description

id
integer

Identifier of the history event

createdDate
string

Date and time of the event creation in ISO 8601 format

field
string

Type of the history event. Possible values for field:

  • TITLE — change of task title
  • DESCRIPTION — change of task description
  • REAL_STATUS — change of actual status
  • STATUS — change of task status
  • PRIORITY — change of priority
  • MARK — change of task rating
  • COMMENT — addition of a comment
  • DELETE — deletion of a task
  • NEW — creation of a new task
  • RENEW — restoration of a task
  • MOVE_TO_BACKLOG — moving a task to the backlog
  • MOVE_TO_SPRINT — moving a task to a sprint
  • PARENT_ID — change of parent task
  • GROUP_ID — change of working group/project
  • STAGE_ID — change of stage
  • CREATED_BY — change of task author
  • RESPONSIBLE_ID — change of executor
  • ACCOMPLICES — change of participants
  • AUDITORS — change of auditors
  • DEADLINE — change of deadline
  • START_DATE_PLAN — change of planned start date
  • END_DATE_PLAN — change of planned end date
  • DURATION_PLAN — change of planned duration
  • DURATION_PLAN_SECONDS — change of planned duration in seconds
  • DURATION_FACT — change of actual duration
  • TIME_ESTIMATE — change of time estimate
  • TIME_SPENT_IN_LOGS — change of actual time spent in logs
  • TAGS — change of task tags
  • DEPENDS_ON — change of task dependencies
  • FILES — change of file list
  • UF_TASK_WEBDAV_FILES — change of user field with files
  • CHECKLIST_ITEM_CREATE — creation of a checklist item
  • CHECKLIST_ITEM_RENAME — renaming of a checklist item
  • CHECKLIST_ITEM_REMOVE — deletion of a checklist item
  • CHECKLIST_ITEM_CHECK — marking a checklist item as completed
  • CHECKLIST_ITEM_UNCHECK — unchecking a checklist item
  • ADD_IN_REPORT — change of the "add to report" flag
  • TASK_CONTROL — change of result control
  • ALLOW_TIME_TRACKING — enabling or disabling time tracking
  • ALLOW_CHANGE_DEADLINE — allowing or prohibiting deadline changes
  • FLOW_ID — change of flow

value
object

The object describes what change occurred:

  • from — value before the change
  • to — value after the change

The type of value depends on the event: for a new comment — ID of the comment, for a checklist item change — text of the item, for adding an auditor — user identifier, and so on

user
object

An object with user description who performed the action

User Object

Name
type

Description

id
integer

User identifier

name
string

First name

lastName
string

Last name

secondName
string

Middle name

login
string

Login

Error Handling

HTTP Status: 400

{
            "error": "0",
            "error_description": "Access denied. (internal error)"
        }
        

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

Code

Description

Value

100

CTaskItem All parameters in the constructor must have real class type (internal error)

Required parameter taskId is not specified

0

wrong task id (internal error)

The value of taskId is of incorrect type

0

Access denied. (internal error)

The user does not have access to the task

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

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

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