Click Reaction

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

ActionDto is the reaction to a click on an element of a timeline record. There are three types of actions, and each is described by its own set of fields:

type Value

What Happens on Click

When to Use

redirect

A link opens: a Bitrix24 object slider, a page, or an external site

You need to take the user to a deal, a lead, or an external service

restEvent

The application receives the onCrmTimelineItemAction event

The click must run logic on the application side

openRestApp

The slider of the application that set the action opens

You need the application's own interface on top of the timeline

The action is set in the following fields:

The type field is required. A value outside the list is rejected by the method with the ENUM_FIELD error, and a field that belongs to none of the three sets — with the FIELD_IS_REDUNDANT error. Bitrix24 does not reject fields of a different action type, but does not use them either.

Link Navigation redirect

A relative link to a standard Bitrix24 object that supports a slider opens the slider. Other relative links open as a regular redirect. A link specifying a domain is considered external and opens in a new browser tab.

Parameters

Required parameters are marked with *

Field

Description

type*
string

Value redirect

uri*
string

Valid link URI, for example https://example.com or /crm/deal/details/1/

Example

{
            "type": "redirect",
            "uri": "/crm/deal/details/1/"
        }
        

Event restEvent

To receive the onCrmTimelineItemAction event, the application subscribes to it with the event.bind method or declares a handler during installation.

The event is received only by the application that set the action: for a configurable activity — the application that created the activity, for additional content blocks — the application that installed the blocks. Other applications do not receive the event.

The context is always passed to the handler:

Field

Description

id

Event identifier — the value of the id field from the action

entityTypeId

Identifier of the CRM object type the activity is linked to

entityId

Identifier of the element of this object

activityId

Identifier of the activity

The values from actionParams are passed through the user's browser, so secrets and tokens must not be put there.

The user who clicked is identified by the standard auth[user_id] field of the event — it does not get into the action context.

Parameters

Required parameters are marked with *

Field

Description

type*
string

Value restEvent

id*
string

Event identifier. Any value can be specified, for example resetButtonClick

actionParams
object

Application data that reaches the event handler: the key is the parameter name, the value is a scalar. No more than 20 values, all of them are cast to strings

animationType
string

Animation shown while the event is being processed: loader or disable. Any other value is rejected by the method with the ENUM_FIELD error

The event handler often changes the record itself: it adds blocks or replaces the set of buttons. While the event is being processed, animationType shows the user that the click has been accepted:

Value

What Is Blocked

loader

The entire timeline record, with a loader on top of it

disable

Only the button that was clicked

The block is not released automatically: it persists until the application updates the activity with the crm.activity.configurable.update method.

Example

{
            "type": "restEvent",
            "id": "resetButtonClick",
            "actionParams": {
                "myId": 123,
                "someImportant": "qwerty"
            },
            "animationType": "disable"
        }
        

Such an action is assigned to a button or a menu item. Besides the context fields, the handler receives myId and someImportant set by the application.

Opening the Application Slider openRestApp

Warning

The action is not supported in the mobile application. If the scenario must work on mobile devices, choose redirect or restEvent.

The slider opens on top of the timeline, and the application interface runs inside it. The context is passed to the slider:

Field

Description

entityTypeId

Identifier of the CRM object type the activity is linked to

entityId

Identifier of the element of this object

activityId

Identifier of the activity

Parameters

Required parameters are marked with *

Field

Description

type*
string

Value openRestApp

actionParams
object

Application data that reaches the slider together with the context: the key is the parameter name, the value is a scalar. No more than 20 values, all of them are cast to strings

sliderParams
ActionSliderParamsDto

Options with which the slider is opened

Example

{
            "type": "openRestApp",
            "actionParams": {
                "myId": 123,
                "someImportant": "qwerty"
            },
            "sliderParams": {
                "title": "This is the application slider header",
                "width": 700
            }
        }
        

ActionSliderParamsDtoObject

The object sets the slider size, the browser window title, and the label in the header. All of its fields are optional: without sliderParams the slider opens with the default settings.

Parameters of the ActionSliderParamsDto Object

Field

Description

Additional

width
integer

Slider width, px

Set either width or leftBoundary

leftBoundary
integer

Full-width slider for the browser window with a left margin, px

Set either width or leftBoundary

title
string

Browser window title text when opening the slider

labelText
string

Label text in the slider header

For example, Request

labelBgColor
string

Label background color

Allowed values: aqua, green, orange, brown, pink, blue, grey, violet. Any other value is rejected by the method with the ENUM_FIELD error

labelColor
string

Label text color

A six-digit HEX code with a hash, for example #ffffff. Any other format is rejected by the method with the WRONG_FIELD_VALUE error

Continue Learning