🔗Types of webhooks and integrations with services
A webhook is the sending of requests based on events. Requests notify external services about changes and events—information is sent to the specified URL. Webhooks are used for integration.
Selarti offers two types of integration with different webhooks.
Integration with services through the 'AI' section
The first type of integration is configured in the section 'AI' when creating and editing artificial intelligence in the block 'Professional settings.'

In the block 'Professional settings' in the dropdown menu 'AI functions' select 'custom api.'

The 'custom api' function allows you to connect any external services and integrations. This function is called by the AI itself, which then processes requests and transmits data from the dialogue to an external server. At the same time, the AI can not only send but also receive the necessary information from the external server.
Webhooks are sent for various events with any specified parameters. Set rules for the AI on what to collect from the dialogue—address, phone number, other necessary data. For example, the AI collects contacts, name, order details, processes the data, and transmits it to a CRM or another external service. Then it receives a response, for example, confirmation and additional data from external services. After that, it collects, processes, and transmits this information as a response to the user.
With this type of integration, webhooks can be sent and received more than once. During a single dialogue, there can be a hundred events, each of which will send a notification to the required services. For one incoming message, Selarti can trigger up to 100 different integrations.
More details on the setup in the instructions 'Custom API Setup'.
Integration with services through the 'Integrations' section
The second type of integration is configured through the section 'Integrations.' In the section, select event notifications by tags and by messages, upon which webhooks will be sent to the external server.

Types of webhooks:
successful dialogue;
contact received;
interest shown;
transferred to operator;
message for operator;
all messages.
Such webhooks contain ready-made and standard system parameters. For example, success contains information about whether the dialogue was successful or not. Or thread_id—the thread id, used to identify the dialogue with the user. The webhook cannot be changed, and additional fields cannot be added.
With this integration setup, webhooks are sent once per event. For example, if the dialogue is successful—a webhook is sent, if a contact is received—a webhook is sent. That is, one webhook is sent for each event.
More details on creating an integration in the article 'Integrations | Integration.'
Last updated