Webhooks API
You can use Webhooks to receive notifications about various events associated with visitor's activity in JivoChat system.
You can set up an HTTP(S) URL where the request will be sent to, when an event occurrs in JivoChat app. POST request will be sent to the specified URL with the event data in JSON object format.
Event type is specified in the event_name field of the 'event' structure.
Other fields depend on the actual event.
For some types of events you can send the data as a response to the HTTP-request to be displayed to the agents in JivoChat app.
call_event#
This event occurs when agents get a new call or an existing call status changes.
Example:
{ "event_name": "call_event", "chat_id": 4398, "widget_id": "2853", "visitor": { "name": "John Smith", "email": "email@example.com", "phone": "+14084987855", "number": "2746", "description": "Description text", "social": {}, "chats_count": 8 }, "agent": { "id": "3599", "name": "Thomas Anderson", "email": "agent@jivosite.com", "phone": "+14083682346" }, "department": { "id": 181, "name": "Sales" }, "session": { "geoip": { "region_code": "CA", "country": "United States", "country_code": "US", "region": "California", "city": "San Francisco", "latitude": "37.7898", "longitude": "-122.3942", "organization": "Wikimedia Foundation" }, "utm": "source=google|medium=cpc|content=banner|campaign=campaign_name", "utm_json": { "source": "google", "campaign": "campaign_name", "content": "banner", "medium": "cpc", "term": "..." }, "ip_addr": "208.80.152.201", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" }, "page": { "url": "http://example.com/", "title": "Page title" }, "call": { "type": "callback", "phone": "+14084987855", "status": "end", "record_url": "http://example.com/record.mp3" }, "analytics": {} }
chat_accepted#
This event is sent when a chat is accepted by the agent. All known data about visitor and some agent's info are to be sent in the request parameters along with visitor's ID, if it was sent to the widget in setUserToken method.
If a response to chat_accepted contains contact_info, this data will be displayed to the agent as if a visitor introduced himself in the chat form. It will be saved in the chat log as well.
{ "event_name": "chat_accepted", "widget_id": "3948", "user_token": null, "visitor": { "name": "John Smith", "email": "email@example.com", "phone": "+14084987855", "description": "Description text", "number": "2198", "social": {}, "chats_count": 1 }, "organization": { "id": "1", "name": "Company name" }, "status": { "id": "4", "title": "contact_later" }, "assigned_agent": { "id": 1, "email": "agent1@gmail.com", "name": "Agent" }, "tags": [ { "id": "17", "title": "Tag example" } ], "chat_id": 7636, "department": { "id": 281, "name": "Sales" }, "session": { "geoip": { "region_code": "CA", "country": "United States", "country_code": "US", "region": "California", "city": "San Francisco", "latitude": "37.7898", "longitude": "-122.3942", "organization": "Wikimedia Foundation" }, "utm": "source=google|medium=cpc|content=banner|campaign=campaign_name", "utm_json": { "source": "google", "campaign": "campaign_name", "content": "banner", "medium": "cpc", "term": "..." }, "ip_addr": "208.80.152.201", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" }, "page": { "url": "http://example.com/", "title": "Page title" }, "analytics": {}, "agent": { "id": "2016", "name": "Thomas Anderson", "email": "agent@jivosite.com", "phone": "+14083682346" }, }
Response parameters
Name | Type | Description |
---|---|---|
result | string | String with the result of a request processing. If the value is not "ok", data will not be passed on to the agent |
custom_data | array | Additional data fields, similar to setCustomData |
contact_info | object | Contact details fields, similar to setContactInfo |
enable_assign | boolean | Flag that determines whether the agent sees the button to link a client to CRM. The button is displayed above all custom_data fields |
crm_link | string fields | Link to the visitor's card in CRM. Displayed to the agent by a separate button below all custom_data |
page | object | Information about the page, where visitor currently is |
custom_data
Name | Type | Description |
---|---|---|
title | string | Name of a custom field |
content | string | Content |
contact_info
Name | Type | Description |
---|---|---|
name | string | Visitor's name |
phone optional | string | Visitor's phone number |
email optional | string | Visitor's email |
page
Name | Type | Description |
---|---|---|
url | string | Current page URL |
title optional | string | Page title |
Example
{ "result": "ok", "custom_data": [ { "title": "Title", "content": "Content text" } ], "contact_info": { "name": "John Smith", "phone": "+14084987855", "email": "email@example.com" }, "page": { "url": "http://example.com/", "title": "Page title" } }
chat_assigned#
The event is sent when a chat is linked to CRM using the parameter "crm_link" from the response to chat_accepted event. All known data about visitor and some agent's info are sent in the request parameters. Also parameters include visitor's ID if it was sent to the widget using setUserToken method.
Example:
{ "event_name": "chat_assigned", "widget_id": "3948", "user_token": null, "visitor": { "name": "John Smith", "email": "email@example.com", "phone": "+14084987855", "number": "2198", "description": "Description text", "social": {}, "chats_count": 1 }, "organization": { "id": "1", "name": "Company name" }, "status": { "id": "4", "title": "contact_later" }, "assigned_agent": { "id": 1, "email": "agent1@gmail.com", "name": "Agent" }, "tags": [], "chat_id": 1207, "session": { "geoip": { "region_code": "CA", "country": "United States", "country_code": "US", "region": "California", "city": "San Francisco", "latitude": "37.7898", "longitude": "-122.3942", "organization": "Wikimedia Foundation" }, "utm": "source=google|medium=cpc|content=banner|campaign=campaign_name", "utm_json": { "source": "google", "campaign": "campaign_name", "content": "banner", "medium": "cpc", "term": "..." }, "ip_addr": "208.80.152.201", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" }, "page": { "url": "http://example.com/", "title": "Page title" }, "analytics": {}, "agent": { "id": "2016", "name": "Thomas Anderson", "email": "agent@jivosite.com", "phone": "+14083682346" }, "assign_to": "https://test-crm.com", }
Response parameters
The expected response is JSON {"result": "ok"} or the error text.
Example
{ "result": "ok" }
chat_updated#
The event is sent when a visitor's information has been updated - for example, a visitor has filled the contacts form in the chat. All known data about visitor is sent in the request parameters along with the information about the agent who accepted the chat. Also there may be visitor's ID if it was sent to the widget using setUserToken method.
Example
{ "event_name": "chat_updated", "widget_id": "3948", "user_token": null, "visitor": { "name": "John Smith", "email": "email@example.com", "phone": "+14084987855", "description": "Description text", "number": "2198", "chats_count": 1 }, "organization": { "id": "2", "name": "Company name" }, "status": { "id": "4", "title": "contact_later" }, "assigned_agent": null, "tags": [ { "id": "7", "title": "Discount" } ], "chat_id": 7507, "department": { "id": 281, "name": "Sales" }, "session": { "geoip": { "region_code": "CA", "country": "United States", "country_code": "US", "region": "California", "city": "San Francisco", "latitude": "37.7898", "longitude": "-122.3942", "organization": "Wikimedia Foundation" }, "utm": "source=google|medium=cpc|content=banner|campaign=campaign_name", "utm_json": { "source": "google", "campaign": "campaign_name", "content": "banner", "medium": "cpc", "term": "..." }, "ip_addr": "208.80.152.201", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" }, "page": { "url": "http://example.com/", "title": "Page title" }, "analytics": {}, "agent": { "id": "2016", "name": "Thomas Anderson", "email": "agent@jivosite.com", "phone": "+14083682346" }, }
Response parameters
Name | Type | Description |
---|---|---|
result | string | String with the result of a request processing. If the value is not "OK", data will not be passed on to the agent |
custom_data | array | Additional data fields, similar to setCustomData |
contact_info | object | Contact data fields, similar to setContactInfo |
enable_assign | boolean | Flag that determines whether the agent sees the button to link a visitor to CRM. The button is displayed above all custom_data fields |
crm_link | string fields | Link to the visitor's card in CRM. Displayed to the agent by a separate button below all custom_data |
page | object | Information about the page where visitor currently is |
client_updated#
The event is triggered by a client's data update. For example, an agent was assigned to the client or client's category was changed. This event is also sent when client's contact details are updated out of an active chat (in the CRM section - Clients).
Example
{ "event_name": "client_updated", "widget_id": "12345678", "user_token": null, "visitor": { "name": "Thomas", "email": "thomas@gmail.com", "phone": "+458745457845", "description": "Description text", "number": 1217, "chats_count": 1 }, "organization": { "id": "1", "name": "Company name" }, "status": { "id": "4", "title": "contact_later" }, "assigned_agent": { "id": 3, "email": "agent3@gmail.com", "name": "Agent3" }, "tags": [ { "id": "17", "title": "Sales" } ], "client_id": "1217" }
Response parameters
The expected response is JSON {"result": "ok"} or the error text.
Example
{ "result": "ok" }
client_attribute_updated#
The event is sent when the client's attributes are changed: they are updated by the agent in the application or the client fills in the attribute field in the contact form.
Example
{ "event_name": "client_attribute_updated", "widget_id": "12345678", "user_token": null, "client_id": 1217, "attributes": [ "some_number_attribute_name": 1234, "some_string_attribute_name": "Some string", ... <attribute_name: string>: <attribute_value: mixed>, ] }
chat_finished#
This event is sent when the chat is closed in JivoChat app. All known data about visitor, agent information and the chat log are sent in the request parameters. Also there may be visitor's ID if it is sent to the widget using setUserToken method.
Example
{ "event_name": "chat_finished", "widget_id": "3948", "visitor": { "name": "John Smith", "email": "email@example.com", "phone": "+14084987855", "description": "Description text", "number": "2198", "chats_count": 2 }, "organization": null, "status": null, "assigned_agent": null, "tags": [], "chat_id": 7607, "session": { "geoip": { "region_code": "CA", "country": "United States", "country_code": "US", "region": "California", "city": "San Francisco", "latitude": "37.7898", "longitude": "-122.3942", "organization": "Wikimedia Foundation" }, "utm": "source=google|medium=cpc|content=banner|campaign=campaign_name", "utm_json": { "source": "google", "campaign": "campaign_name", "content": "banner", "medium": "cpc", "term": "..." }, "ip_addr": "208.80.152.201", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" }, "page": { "url": "http://example.com/", "title": "Page title" }, "analytics": null, "agents": [ { "id": "2016", "name": "Thomas Anderson", "email": "agent@jivosite.com", "phone": "+14083682346" } ], "chat": { "messages": [ { "message": "<Message text is not displayed here>", "timestamp": 1665396476, "type": "visitor" }, { "message": "<Message text is not displayed here>", "timestamp": 1665396483, "type": "agent", "agent_id": 1 } ], "blacklisted": false, "rate": null }, "plain_messages": "", "html_messages": "" }
Response parameters
The response is expected to be JSON {"result": "ok"} or the error text.
Example
{ "result": "ok" }
offline_message#
The event is sent when a visitor sends a message via the chat offline form. All known data about visitor and the offline message are sent in the request parameters. Also the request may include visitor's ID if it has been sent to the widget using setUserToken method.
Example
{ "event_name": "offline_message", "widget_id": "3948", "user_token": null, "visitor": { "name": "John Smith", "email": "email@example.com", "phone": "+14084987855", "description": "Description text", "number": "2198", "chats_count": 1 }, "organization": null, "status": null, "assigned_agent": null, "tags": [], "chat_id": 2026, "session": { "geoip": { "region_code": "CA", "country": "United States", "country_code": "US", "region": "California", "city": "San Francisco", "latitude": "37.7898", "longitude": "-122.3942", "organization": "Wikimedia Foundation" }, "utm": "source=google|medium=cpc|content=banner|campaign=campaign_name", "utm_json": { "source": "google", "campaign": "campaign_name", "content": "banner", "medium": "cpc", "term": "..." }, "ip_addr": "208.80.152.201", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36" }, "page": { "url": "http://example.com/", "title": "Page title" }, "analytics": {}, "message": "Message text", "offline_message_id": 1665399500726 }
Response parameters
The expected response is JSON {"result": "ok"} or the error text.
Example
{ "result": "ok" }
Event parameters#
event
Name | Type | Description |
---|---|---|
event_name | string | Event type |
widget_id | string | Channel's widget ID |
user_token | string | Additional ID of a user (can be set using setUserToken method) |
visitor | object | Object with information about a visitor |
organization | object | Object with the information about an organization, client was assigned |
status | object | Client's category |
assigned_agent | object | Information about an agent assigned to the client |
tags | object | Tags selected for the client |
chat_id | number | ID of a chat |
department optional | object | Information about the department that visitor selected before the chat |
session | object | Visitor's sessions data |
page | object | Current page URL |
call | object | Call information |
analytics optional | object | Analytics |
agent | object | Object with information about an agent |
chat | object | Chat messages log |
visitor
Name | Type | Description |
---|---|---|
name optional | string | Visitor's name |
email optional | string | Visitor's email |
phone optional | string | Visitor's phone |
description | string | Additional information about the visitor |
number | string | Visitor's number |
social optional | object | Information about the visitor's social networks |
chats_count | number | The number of visitor's requests |
organization
Name | Type | Description |
---|---|---|
id | number | Company ID |
name | string | Company title |
status
Name | Type | Description |
---|---|---|
id | number | Client category ID |
title | string | Category name |
assigned_agent
Name | Type | Description |
---|---|---|
id | number | Assigned agent ID |
string | Assigned agent email | |
name | string | Assigned agent name |
tags
Name | Type | Description |
---|---|---|
id | number | Tag ID |
title | string | Tag name |
department
Name | Type | Description |
---|---|---|
id | number | Department ID |
name | string | Department title |
session
Name | Type | Description |
---|---|---|
geoip | object | GeoIP data of a client |
utm | string | UTM in the string format |
utm_json | object | Object with UTM data |
ip_addr | string | IP-address of an active session |
user_agent | string | User_agent data |
page
Name | Type | Description |
---|---|---|
url | string | Current page URL |
title optional | string | Current page title |
agent
Name | Type | Description |
---|---|---|
id | number | Agent ID |
name | string | Agent name |
string | Agent email | |
phone optional | string | Agent phone number |
call
Name | Type | Description |
---|---|---|
type | string | Call type (callback, incoming, outgoing) |
phone | string | Customer's phone number |
status | string | Call status (start, end, agent_connected, client_connected, error) |
reason optional | string | Error reason (avaiable if call status is an error) |
record_url optional | string | Link to .mp3 recording of a call (available if the call has ended) |
chat
Name | Type | Description |
---|---|---|
messages | object | Object with chat messages log |
blacklisted | boolean | Indicates if the client was blocked by an agent in JivoChat app |
rate optional | string | Quality assessment of the chat |
invitation optional | string | Proactive invitation text |
messages
Name | Type | Description |
---|---|---|
message | string | Message text |
timestamp | int | Time tag |
type | string | User type (client or agent) |
agent_id | number | ID of an agent who sent a message |
geoip
Name | Type | Description |
---|---|---|
region_code | string | Region code |
country_code | string | ISO country code |
country | string | Country name |
region | string | Region name |
city | string | City name |
latitude | string | Latitude |
longitude | string | Longitude |
organization | string | Internet service provider name |
utm_json
Name | Type | Desription |
---|---|---|
source optional | string | Value of utm_source |
campaign optional | string | Value of utm_campaign |
content optional | string | Value of utm_content |
medium optional | string | Value of utm_medium |
term optional | string | Value of utm_term |
CRM Webhooks#
In the Webhooks, events for adding and modifying entities in CRM JivoChat have now been added.
The server address to which event data requests will be sent is configured in the 'CRM Settings' section -> 'CRM Webhooks.' The request is sent using the POST method, and the request body is transmitted in JSON format.
The event category (CRM entity with changes) is determined by the event_type field. The type of action (addition, modification, deletion) can be determined by the value of the event_name field.
Pipeline (crm_pipeline)#
The event is sent when adding a pipeline in the 'CRM Settings' - 'Pipelines' section or modifying its settings.
Possible event types:
- created_pipeline -adding a new funnel
- updated_pipeline - updating settings of an existing funnel (editing stages, rejection reasons, currency)
- deleted_pipeline - deleting a funnel
Example:
{ "site_id": 464056, "event_type": "crm_pipeline", "event": { "event_name": "created_pipeline", "pipeline_id": 6, "title": "Gruzly", "currency": "RUB", "pipeline_statuses": [ { "pipeline_status_id": 19, "title": "completed", "position": 0, "color": "0ed16a", "type": "system", "final_status": "successful" }, { "pipeline_status_id": 20, "title": "unsuccessful", "position": 0, "color": "76869d", "type": "system", "final_status": "unsuccessful" }, { "pipeline_status_id": 21, "title": "New", "position": 1, "color": "1fb6fd", "type": "user", "final_status": null } ], "pipeline_reject_reasons": [ { "pipeline_reject_reason_id": 21, "title": "Too expensive", "position": 0 }, { "pipeline_reject_reason_id": 22, "title": "Missed opportunity", "position": 1 }, { "pipeline_reject_reason_id": 23, "title": "Unacceptable terms", "position": 2 }, { "pipeline_reject_reason_id": 24, "title": "Chose another option", "position": 3 } ] } } ```json Event Parameters | Event Name | Type | Description | | ----------------------- | ------ | --------------------------------------------------------------------------------------------------------------- | | pipeline_id | number | Funnel identifier | | title | string | Funnel title | | currency | string | International currency code | | pipeline_statuses | array | Array with information about funnel stages | | pipeline_status_id | number | Stage ID | | title | string | Stage title | | position | number | Order number (position of the stage in the list) | | color | string | Element color (specified in HEX format) | | type | string | Information about who added the stage (system or user) | | final_status | string | Status of successful or unsuccessful deal completion | | pipeline_reject_reasons | array | Array with information about rejection reasons. Contains fields pipeline_reject_reason_id, title, and position. | ## Categories (сrm_status) The sending of the event with "event_type": "crm_status" is triggered when customer category settings are edited in the "CRM Settings" - "Categories" section. Event Types: * **created_status** - addition of a new category * **updated_status** - update of an existing category * **deleted_status** - deletion of a category * **reordered_status** - change in the position of a category in the list * **assigned_status** - assignment of a category to a customer * **changed_require_update_of_status** - toggling the "Require category update when finishing the conversation" setting Example: ```json { "site_id": 464056, "event_type": "crm_status", "event": { "event_name": "assigned_status", "status": { "title": "unsuccessful", "color": "76869d", "position": 3, "status_id": 5, "new_status_id": null }, "client": { "client_id": 1, "widget": { "widget_id": 488651 }, "name": "John Smith", "avatar_url": null, "description": null, "social": null, "assigned_agent": { "assigned_agent_id": null }, "crm_link": null, "chats_count": 0, "visits_count": 0, "custom_data": null, "status": { "title": "unsuccessful", "color": "76869d", "position": 3, "status_id": 5, "new_status_id": null }, "organization": null, "tags": [], "has_deal": 1, "contacts": [{ "contact_type": "email", "contact": "johnsmith@mail.com", "channel_type": "agent_app" }], "blacklist": null } } }
The description of the client object parameters is available in the Webhooks API documentation.
Example:
{ "site_id": 464056, "event_type": "crm_status", "event": { "event_name": "created_status"/"updated_status"/"deleted_status"; "title": "Vno", "color": "0363f6", "position": 6, "status_id": 6, "new_status_id": null } }
Event Parameters
Parameter Name | Type | Description |
---|---|---|
event_name | string | Type of event |
title | string | Category name |
color | string | Element color (specified in HEX format) |
position | number | Order number (position of the category in the list) |
status_id | number | Category ID |
new_status_id | number | ID of the category to which items will be moved after deletion of the current category |
Example:
{ "site_id": 464056, "event_type": "crm_status", "event": { "event_name": "assigned_status", "status": { "title": "unsuccessful", "color": "76869d", "position": 3, "status_id": 5, "new_status_id": null }, "client": { "client_id": 1, "widget": { "widget_id": 488651 }, "name": "John Smith", "avatar_url": null, "description": null, "social": null, "assigned_agent": { "assigned_agent_id": null }, "crm_link": null, "chats_count": 0, "visits_count": 0, "custom_data": null, "status": { "title": "unsuccessful", "color": "76869d", "position": 3, "status_id": 5, "new_status_id": null }, "organization": null, "tags": [], "has_deal": 1, "contacts": [{ "contact_type": "email", "contact": "johnsmith@mail.com", "channel_type": "agent_app" }], "blacklist": null } } }
The description of the parameters for the client object is available below
Tags (crm_client_tag)#
The sending of this event is triggered when managing the tags used to mark a segment in the customer's profile. In the "CRM Settings" -> "Tags" section, it's possible to add, delete, or merge tags
Event types:
- created_client_tag - adding a new tag
- updated_client_tag - updating an existing tag
- deleted_client_tag - deleting a tag
- merged_client_tag - merging current tags into one
- changed_administrator_only_client_tag - managing the setting "Only administrators can add tags"
Example:
{ "site_id": 464056, "event_type": "crm_client_tag"/"updated_client_tag"/"deleted_client_tag", "event": { "event_name": "created_client_tag", "tag_id": 1, "title": "Test_tag" } }
{ "site_id": 360882, "event_type":"crm_client_tag", "event": { "event_name": "merged_tag", "tag": { "tag_id": 6, "title": "NewOne" }, "merged_tags": [{ "tag_id": 9, "title": "SecondOne" }, { "tag_id": 10, "title": "ThirdOne" }] } }
{ "site_id": 360882, "event_type":"crm_client_tag", "event": { "event_name": "changed_administrator_only_client_tag", "enabled": 1 } }
Event Parameters
Parameter | Type | Description |
---|---|---|
event_name | string | Type of event |
tag_id | number | Tag identifier |
title | string | Tag name |
merged_tags | array | Array with data about merged tags |
enabled | boolean | Whether tag management settings were changed: 1 - only administrators can create tags; 0 - all employees can create tags |
Deals (crm_deal)#
A request with this event category is sent every time a deal is added or its data is modified.
Event Types:
- created_deal - addition of a new deal
- updated_deal - Edição do negócio atual
- deleted_deal - Exclusão do negócio
Example:
{ "site_id": 464056, "event_type": "crm_deal", "event": { "event_name": "created_deal"/"updated_deal"/"deleted_deal", "deal_id": 3, "client": { "client_id": 1 }, "title": "Сделка", "text": "Описание сделки", "amount": null, "pipeline": { "pipeline_id": 1, "pipeline_status": { "pipeline_status_id": 1 }, "pipeline_reject_reason": { "pipeline_reject_reason_id": null } }, "assigned_agent": { "assigned_agent_id": 1 }, "created_ts": 1677837220, "closed_ts": null, "creator_agent": { "creator_agent_id": 1 } } }
Event Parameters
Name | Type | Description |
---|---|---|
event_name | string | Type of event |
deal_id | number | Deal identifier |
client | object | Object with client details for whom the deal was added |
title | string | Deal title |
text | string | Deal description |
amount | number | Deal amount |
pipeline | object | Object indicating the sales pipeline and deal status |
assigned_agent | object | Data about the agent assigned to the deal |
created_ts | int | Timestamp |
created_ts | int | Deal creation time in timestamp format |
closed_ts | int | Deal closure time in timestamp format |
creator_agent | object | Object with information about the creator of the deal |
CRM Tasks (crm_task)#
This event is triggered when working with task functionality: adding, deleting, editing, etc. The request body contains information about the task itself, as well as details about the associated client and deal.
Event Types:
- created_task - Adding a new task
- deleted_task - Deleting a task
- updated_task - Editing a task
- completed_task - Completing a task
- fired_task - Task reminder triggered
Example:
{ "site_id": 464056, "event_type": "crm_task", "event": { "event_name": "created_task"/"deleted_task"/"updated_task"/"completed task"/"fired_task", "text": "Текст задачи", "status": "active", "task_id": 2, "agent": { "agent_id": 1 }, "client": { "client_id": 1 }, "notify_ts": 1677838380, "created_ts": 1677837822, "updated_ts": 1677837842, "show_notification": 1, "creator_agent": { "creator_agent_id": 1 }, "deal": { "deal_id": 3 } } }
Event Parameters
Name | Type | Description |
---|---|---|
event_name | string | Type of event |
text | string | Task description |
task_id | number | Task identifier |
agent | object | Data about the agent to whom the task is assigned |
client | object | Information about the client to whom the task is linked |
notify_ts | int | Time when the task reminder will be triggered. Specified in timestamp format |
created_ts | int | Time of task creation in timestamp format |
updated_ts | int | Time of task update in timestamp format |
show_notification | boolean | Whether the task reminder will be shown. 1 - reminder enabled, 0 - will not be shown |
creator_agent | object | Information about the agent who created the task |
deal | object | Data about the deal associated with the task |
Organizations (crm_organization)#
This event is sent when creating an organization (company) that can be associated with a client. In this category, only one type of event is available - created_organization, as other actions with organizations are not available. The request body contains only 2 parameters: event_name and organization_id.
Example:
{ "site_id": 464056, "event_type": "crm_organization", "event": { "event_name": "created_organization", "organization_id": 3, } }
Clients (сrm_client)#
Events are triggered by actions involving a client card: its addition, editing, or deletion.
Event Types:
- assigned_agent_to_client - assigning an operator responsible for the client
- created_client - adding a client
- deleted_client - deleting a client
- updated_client - updating a client
- changed_client_company - changing the company associated with the client
- changed_client_blacklist - blacklisting/unblacklisting a client
- updated_client_contacts - editing client contact information
The webhook's body structure and its parameters are identical for each of these event types.
Example:
{ "site_id": 464056, "event_type": "crm_client", "event": { "event_name": "assigned_agent_to_client", "client_id": 1, "widget": { "widget_id": 488651 }, "name": "John Smith", "avatar_url": null, "description": null, "social": null, "assigned_agent": { "assigned_agent_id": 2 }, "crm_link": null, "chats_count": 0, "visits_count": 0, "custom_data": null, "status": { "title": "new", "color": "1fb6fd", "position": 0, "status_id": 1, "new_status_id": null }, "organization": { "organization_id": 3, "name": "Company" }, "tags": [], "has_deal": 1, "contacts": [{ "contact_type": "email", "contact": "johnsmith@mail.com", "channel_type": "agent_app" }], "blacklist": { "agent": { "agent_id": 1 }, "block_datetime_ts": 1677838504, "unblock_datetime_ts": 1709460904, "ip_address": "109.252.14.36" } }
Event Parameters
Name | Type | Description |
---|---|---|
event_name | string | Type of event |
client_id | number | Client identifier |
widget | object | Information about the communication channel where the client was added (includes the public channel ID) |
name | string | Client's name |
client | object | Information about the client to whom the task was assigned |
avatar_url | string | Link to media file with the client's avatar (relevant for social media channels and chat APIs where such a link can be provided) |
description | string | Description of the client |
social | object | Object with links to the client's profiles on social networks and messengers |
crm_link | string | Link to the client's card in CRM |
chats_count | number | Number of conversations with the client |
visits_count | number | Number of visits |
custom_data | object | Additional information about the client passed using the setCustom Data method |
status | object | Data about the category assigned to the client |
organization | object | Company associated with the client |
tags | array | Tags assigned to the client |
has_deal | boolean | Indicates if a deal has been created with the client |
contacts | array | Client's contact information |
contact_type | string | Contact type: phone/email - phone number/email address |
contact | string | Phone number/email address |
channel_type | string | Where the contact information was added: agent_app - operator's application, widget - external contacts |
blacklist | object | Data about adding the client to the blacklist or unblocking them |
agent | object | Information about the operator who blocked the client |
block_datetime_ts | int | Blocking time in timestamp format |
unblock_datetime_ts | int | Unblocking time in timestamp format |
ip_address | string | Client's IP addres |