Documentation

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

NameTypeDescription
resultstringString with the result of a request processing. If the value is not "ok", data will not be passed on to the agent
custom_dataarrayAdditional data fields, similar to setCustomData
contact_infoobjectContact details fields, similar to setContactInfo
enable_assignbooleanFlag that determines whether the agent sees the button to link a client to CRM. The button is displayed above all custom_data fields
crm_linkstring fieldsLink to the visitor's card in CRM. Displayed to the agent by a separate button below all custom_data
pageobjectInformation about the page, where visitor currently is

custom_data

NameTypeDescription
titlestringName of a custom field
contentstringContent

contact_info

NameTypeDescription
namestringVisitor's name
phone optionalstringVisitor's phone number
email optionalstringVisitor's email

page

NameTypeDescription
urlstringCurrent page URL
title optionalstringPage 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

NameTypeDescription
resultstringString with the result of a request processing. If the value is not "OK", data will not be passed on to the agent
custom_dataarrayAdditional data fields, similar to setCustomData
contact_infoobjectContact data fields, similar to setContactInfo
enable_assignbooleanFlag that determines whether the agent sees the button to link a visitor to CRM. The button is displayed above all custom_data fields
crm_linkstring fieldsLink to the visitor's card in CRM. Displayed to the agent by a separate button below all custom_data
pageobjectInformation 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" }

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

NameTypeDescription
event_namestringEvent type
widget_idstringChannel's widget ID
user_tokenstringAdditional ID of a user (can be set using setUserToken method)
visitorobjectObject with information about a visitor
organizationobjectObject with the information about an organization, client was assigned
statusobjectClient's category
assigned_agentobjectInformation about an agent assigned to the client
tagsobjectTags selected for the client
chat_idnumberID of a chat
department optionalobjectInformation about the department that visitor selected before the chat
sessionobjectVisitor's sessions data
pageobjectCurrent page URL
callobjectCall information
analytics optionalobjectAnalytics
agentobjectObject with information about an agent
chatobjectChat messages log

visitor

NameTypeDescription
name optionalstringVisitor's name
email optionalstringVisitor's email
phone optionalstringVisitor's phone
descriptionstringAdditional information about the visitor
numberstringVisitor's number
social optionalobjectInformation about the visitor's social networks
chats_countnumberThe number of visitor's requests

organization

NameTypeDescription
idnumberCompany ID
namestringCompany title

status

NameTypeDescription
idnumberClient category ID
titlestringCategory name

assigned_agent

NameTypeDescription
idnumberAssigned agent ID
emailstringAssigned agent email
namestringAssigned agent name

tags

NameTypeDescription
idnumberTag ID
titlestringTag name

department

NameTypeDescription
idnumberDepartment ID
namestringDepartment title

session

NameTypeDescription
geoipobjectGeoIP data of a client
utmstringUTM in the string format
utm_jsonobjectObject with UTM data
ip_addrstringIP-address of an active session
user_agentstringUser_agent data

page

NameTypeDescription
urlstringCurrent page URL
title optionalstringCurrent page title

agent

NameTypeDescription
idnumberAgent ID
namestringAgent name
emailstringAgent email
phone optionalstringAgent phone number

call

NameTypeDescription
typestringCall type (callback, incoming, outgoing)
phonestringCustomer's phone number
statusstringCall status (start, end, agent_connected, client_connected, error)
reason optionalstringError reason (avaiable if call status is an error)
record_url optionalstringLink to .mp3 recording of a call (available if the call has ended)

chat

NameTypeDescription
messagesobjectObject with chat messages log
blacklistedbooleanIndicates if the client was blocked by an agent in JivoChat app
rate optionalstringQuality assessment of the chat
invitation optionalstringProactive invitation text

messages

NameTypeDescription
messagestringMessage text
timestampintTime tag
typestringUser type (client or agent)
agent_idnumberID of an agent who sent a message

geoip

NameTypeDescription
region_codestringRegion code
country_codestringISO country code
countrystringCountry name
regionstringRegion name
citystringCity name
latitudestringLatitude
longitudestringLongitude
organizationstringInternet service provider name

utm_json

NameTypeDesription
source optionalstringValue of utm_source
campaign optionalstringValue of utm_campaign
content optionalstringValue of utm_content
medium optionalstringValue of utm_medium
term optionalstringValue 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 NameTypeDescription
event_namestringType of event
titlestringCategory name
colorstringElement color (specified in HEX format)
positionnumberOrder number (position of the category in the list)
status_idnumberCategory ID
new_status_idnumberID 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

ParameterTypeDescription
event_namestringType of event
tag_idnumberTag identifier
titlestringTag name
merged_tagsarrayArray with data about merged tags
enabledbooleanWhether 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

NameTypeDescription
event_namestringType of event
deal_idnumberDeal identifier
clientobjectObject with client details for whom the deal was added
titlestringDeal title
textstringDeal description
amountnumberDeal amount
pipelineobjectObject indicating the sales pipeline and deal status
assigned_agentobjectData about the agent assigned to the deal
created_tsintTimestamp
created_tsintDeal creation time in timestamp format
closed_tsintDeal closure time in timestamp format
creator_agentobjectObject 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

NameTypeDescription
event_namestringType of event
textstringTask description
task_idnumberTask identifier
agentobjectData about the agent to whom the task is assigned
clientobjectInformation about the client to whom the task is linked
notify_tsintTime when the task reminder will be triggered. Specified in timestamp format
created_tsintTime of task creation in timestamp format
updated_tsintTime of task update in timestamp format
show_notificationbooleanWhether the task reminder will be shown. 1 - reminder enabled, 0 - will not be shown
creator_agentobjectInformation about the agent who created the task
dealobjectData 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

NameTypeDescription
event_namestringType of event
client_idnumberClient identifier
widgetobjectInformation about the communication channel where the client was added (includes the public channel ID)
namestringClient's name
clientobjectInformation about the client to whom the task was assigned
avatar_urlstringLink to media file with the client's avatar (relevant for social media channels and chat APIs where such a link can be provided)
descriptionstringDescription of the client
socialobjectObject with links to the client's profiles on social networks and messengers
crm_linkstringLink to the client's card in CRM
chats_countnumberNumber of conversations with the client
visits_countnumberNumber of visits
custom_dataobjectAdditional information about the client passed using the setCustom Data method
statusobjectData about the category assigned to the client
organizationobjectCompany associated with the client
tagsarrayTags assigned to the client
has_dealbooleanIndicates if a deal has been created with the client
contactsarrayClient's contact information
contact_typestringContact type: phone/email - phone number/email address
contactstringPhone number/email address
channel_typestringWhere the contact information was added: agent_app - operator's application, widget - external contacts
blacklistobjectData about adding the client to the blacklist or unblocking them
agentobjectInformation about the operator who blocked the client
block_datetime_tsintBlocking time in timestamp format
unblock_datetime_tsintUnblocking time in timestamp format
ip_addressstringClient's IP addres