API builder
Some API request functions can be run in the Calculator.
Requests are sent via the POST or GET method to a URL in the following format:
https://chatter.mavibot.ai/api/{api_key}/{action}
Where:
api_key — the API access key generated in the project settings.

To use the token in a URL request, you first need to generate an API key.
Instructions for doing this are provided in the "Generating an API Key" section. ссылка
When copying a URL from this page, a space may appear and must be removed.
Example of an incorrect link: https://chatter.mavibot.pro /api/callback
If the space after .pro remains, the request won’t work.
Do not use prohibited characters when sending a GET request.
Make sure you understand the correct format for GET requests.
How to generate an API key
The old API key generation feature still works as before but is not available for new projects.
If your project already has API keys generated without the access settings described in this section, those existing API keys will continue to function normally.
If you need to generate new keys, use the updated settings.
To generate an API key, go to the project settings:

Next, go to the "Integrations" section:

You’ll find the “Add API key” button in the "Integrations" section:

After clicking the button, a modal window will open with access settings and API key generation options:

Next, you need to select the access permissions for the API key:

The API function will work according to the access permissions you select.
Please note!
The API function depends on the access permissions you set: if you generate an API key with read-only access to client information and then use it to send a message to a client or modify their variables, the API request will fail. The required permission for each API request is specified in the API request card:

Next, enter a name for the API key:

Generate the API key by clicking the "Generate" button:

После чего нажмите "Готово" и ключ api добавится в раздел:

You can add as many API keys as needed, assigning different access permissions to each.

Next, you need to set a primary project key. This allows you to use the key in a request URL with the #{api_key} placeholder.
To do this, click the "{+}" button to the right of the desired API key:

A label will then appear next to the key, indicating that it is the primary project key.

You can access the primary project key via api_key: simply generate the required key, set its permissions, and designate it as the primary project key. Then, in the Calculator, use the request URL with the #{api_key} placeholder, which will contain the value of the primary project key.


Any other generated keys with access settings will be considered secondary keys. In the request URL, you can use their value instead of #{api_key}. To do this, copy the value of the secondary key:

and paste it into the request URL in place of #{api_key}:

An API key generated using the old method is set as the primary project key by default and has full permissions.
Note!
If you delete the key set as the primary project key, you will need to manually designate a new key as the primary.
Please note!
If you have API keys generated using the old method, they will continue to work normally. It is not possible to generate new API keys of the old type.
How to receive messages at the Webhook URL specified in the project settings

Each incoming or outgoing message will be sent as the following JSON POST request:
If a request returns an error, it will not be retried. Even if the server returns errors, notifications will continue to be sent.
How to create a JSON request
Go to the settings of the block where the data will be recorded in the table.

Add an API Request section.
Select POST-JSON as the request type.
Then proceed to fill in the request fields:

Request URL — the path to the function to be called. In the documentation, this is always shown on the first line next to the request type:

Saved values — a list of response parameters with the variable names where the results should be stored, in the following format:
request_parameter -> your_variable
If the response contains parameters with a complex structure, parse them as follows:
"cell_number":{"row":4,"col":2} cell_number|row ->String; cell_number|col -> Column
Request headers — fill in if needed. This usually includes the data format and/or access token.
JSON parameters — the request body, where you specify the data parameters in JSON format. Example:
{"client_id": "#{recipient_id_in_builder}", "message":"Hello!"}
To understand the structure of the response, write #{custom_answer} in the Message field to output the variable’s value.

Next, the documentation lists the allowed parameters in the "Body" section:

How to use a universal webhook
The listed methods can now be executed as either POST or GET requests.
Previously, our methods had fixed parameters (such as client_id and fb_id) for triggering subscriber actions, which imposed certain limitations when integrating with third-party services.
Now you can specify which request parameter SaleBot should use to find the user ID. Use a parameter with the value_ prefix, for example, value_user_id or value_group_id.
Additionally, the callback sending method can now be triggered using the client’s email (client_email) or phone number (client_phone).
The callback, fb_callback, and whatsapp_callback methods are not tied to specific parameter names. You can specify which parameter contains the client’s phone number, email, or ID.
This is useful when setting up webhook reception from a website.
To specify which variable contains the client_id, use the value_client_id parameter and provide the name of the parameter holding this value.
To specify which variable contains the phone number, use value_phone.
To specify which variable contains the email, use value_email.
To specify which variable contains the user_id, use value_user_id.
To specify which variable contains the group_id, use value_group_id.
To specify the variable containing the message itself in the webhook, use value_message (passed in the same way as the other parameters).
Example:
In the address, specify value_client_id = my_client.
https://chatter.mavibot.ai/api/d3f31dabef80ddeb73d43938b4ef8bb0/callback?value_client_id=my_client
{"my_client":49177759, "message":"Hello world"}
The request will be equivalent to the one below:
https://chatter.mavibot.pro/api/d3f31dabef80ddeb73d43938b4ef8bb0/callback
{"client_id":49177759, "message":"Hello world"}
As you can see, the parameter name containing the value is prefixed with value_.
Please note!
Some events generate system notifications within the project.
For example, there are system notifications with a message field that are not empty but contain no client text.
At the same time, the project may also generate message hooks with specific content, such as "message: new_chat_member".
Therefore, it’s important to check the content: it will either be a system notification or a hook for a specific event.
How to start the bot
Start the bot
POST https://chatter.mavibot.ai/api/#{api_key}/callback
URL запроса: https://chatter.mavibot.ai/api/#{api_key}/callback
This method can be used to trigger a funnel for a client or confirm an action on an external resource. The client will not see this message.
Please note: any parameters you additionally pass will be saved in variable
The callback method can now also be triggered using the client’s email (client_email) or phone number (client_phone).
Access permission when generating a key: "Permission to modify/delete client information".

Path
api key* - access token
Body
client_phone - phone number used to look up the client
client_email - email used to look up the client
client_id - client ID in the builder
message - message text
resume_bot - True (optional parameter). If the bot is paused, this is used to unpause it.
Example: resume_bot = True
time_shift - number. If specified, the message will be sent after the given number of seconds from the current time.
send_time - date and time in the format "%Y-%m-%d %H:%M:%S" (e.g., "2024-10-16 13:15:59"). This sets the date and time for sending the message. If both time_shift and send_time are specified, time_shift will take precedence.
Starting the bot using a WhatsApp number
POST https://chatter.mavibot.ai/api/<api_key>/whatsapp_callback
URL request: https://chatter.mavibot.ai/api/<api_key>/whatsapp_callback
This method can trigger the WhatsApp bot after a client registers on the website or submits a request with their phone number.
Please note: any parameters you additionally pass will be saved in variable
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
name - client name message - message text phone - client phone number bot_id - bot ID resume_bot - True (optional parameter). If the bot is paused, use this to resume it. Example: resume_bot = True
time_shift - number. If specified, the message will be sent after the given number of seconds from the current time.
send_time - date and time in the format "%Y-%m-%d %H:%M:%S" (e.g., "2024-10-16 13:15:59"). This sets the date and time for sending the message. If both time_shift and send_time are specified, time_shift will take precedence.
Starting the bot using a Telegram ID
POST https://chatter.mavibot.pro/api/#{api_key}/tg_callback
URL request: https://chatter.mavibot.pro/api/#{api_key}/tg_callback
This method can be used to trigger a funnel for a client or confirm an action on an external website. The client will not see this message.
Please note: any parameters you additionally pass will be saved in variables.
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
message - message text user_id - Telegram user ID group_id - bot name (ended as bot) resume_bot - True (optional parameter). If the bot is paused, use this to resume it. Example: resume_bot = True
time_shift - number. If specified, the message will be sent after the given number of seconds from the current time.
send_time - date and time in the format "%Y-%m-%d %H:%M:%S" (e.g., "2024-10-16 13:15:59"). This sets the date and time for sending the message. If both time_shift and send_time are specified, time_shift will take precedence.
Sending callback messages to a list of clients by platform_id
POST https://chatter.mavibot.ai/api/#{api_key}/send_callback_by_platform_id
URL request: https://chatter.mavibot.ai/api/#{api_key}/send_callback_by_platform_id
When clients with a platform_id from the list are found in the project, a callback will be sent with the text from the callback_text field. Limit: 1 request = maximum 300 sends
Example of request parameters: {"platform_ids":[407184121, "79609879898", "2rwewefw"], "callback_text": "test_callback"}
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
platform_ids - List of client IDs in the messenger callback_text - callback text group_id - bot ID
time_shift - number. If specified, the message will be sent after the given number of seconds from the current time.
send_time - date and time in the format "%Y-%m-%d %H:%M:%S" (e.g., "2024-10-16 13:15:59"). This sets the date and time for sending the message. If both time_shift and send_time are specified, time_shift will take precedence.
Sending a callback message to a client by email
POST https://chatter.mavibot.ai/api/#{api_key}/email_callback
URL request: https://chatter.mavibot.ai/api/#{api_key}/email_callback
This method can trigger the email bot after a client registers on the website or submits a request with their email. The method will locate the client’s email or create it if not found.
Access permission when generating a key: "Permission to modify or delete client information".

Please note: any parameters you additionally pass will be saved in variable
Path
api key* - access token
Body
name - client name message - message text email - email address email_id_bot - bot email address resume_bot - True (optional parameter).
If the bot is paused, use this to resume it. Example: resume_bot = True
time_shift - number. If specified, the message will be sent after the given number of seconds from the current time.
send_time - date and time in the format "%Y-%m-%d %H:%M:%S" (e.g., "2024-10-16 13:15:59"). This sets the date and time for sending the message. If both time_shift and send_time are specified, time_shift will take precedence.
How to work with messages
Message sending parameters
attachment_type — can be: image, video, link, file, or audio. When sending an attachment, the message parameter is optional.
buttons — defines the buttons to be attached to the message. The button format matches the advanced button settings.
Buttons can be passed in two ways: with a hint for messengers that don’t support buttons, or without it.
Example of the buttons parameter:
Sending a message to a client
POST https://chatter.mavibot.ai/api/#{api_key}/message
URL запроса: https://chatter.mavibot.ai/api/#{api_key}/message
This method can be used to send notification messages. The message parameter is required unless you are sending a file. If you are sending a file, the text is optional.
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
message_id - block number for sending message - message text client_id - client ID in the builder attachment_type - file display type. Required if attachment_url is provided. attachment_url - file URL buttons - buttons
time_shift - number. If specified, the message will be sent after the given number of seconds from the current time.
send_time - date and time in the format "%Y-%m-%d %H:%M:%S" (e.g., "2024-10-16 13:15:59"). This sets the date and time for sending the message. If both time_shift and send_time are specified, time_shift will take precedence.
Sending a message in WhatsApp
POST https://chatter.salebot.pro/api/<api_key>/whatsapp_message
URL запроса: https://chatter.mavibot.pro/api/<api_key>/whatsapp_message
Allows you to send a message on behalf of the connected bot to the specified number. The whatsapp_bot_id must be taken from the "Messengers and chats" section. Each connected WhatsApp account is assigned a unique identifier by the builder.
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
message_id - block number for sending whatsapp_bot_id - WhatsApp bot ID from which the message should be sent attachment_url - file URL attachment_type - file display type. Required if attachment_url is provided. message - message text phone - recipient phone number
time_shift - number. If specified, the message will be sent after the given number of seconds from the current time.
send_time - date and time in the format "%Y-%m-%d %H:%M:%S" (e.g., "2024-10-16 13:15:59"). This sets the date and time for sending the message. If both time_shift and send_time are specified, time_shift will take precedence.
Bulk message sending
POST https://chatter.mavibot.ai/api/#{api_key}/broadcast
URL request: https://chatter.mavibot.ai/api/#{api_key}/broadcast
This method allows you to start a broadcast.
You can use one of the following mutually exclusive options:
list parameter — the broadcast will be sent to the specified list of clients.
clients parameter — the broadcast will be sent to an array of client IDs.
platform_ids and group_id parameters — the broadcast will be sent to an array of platform_ids (messenger IDs) for the specified bot (group_id).
If none of the above parameters are provided, the broadcast will not be sent.
Required parameters: message (and/or attachment_type and attachment_url) or message_id.
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
list - list number to which the broadcast should be sent
clients - client IDs in the builder
message - message text
platform_ids - recipient IDs in the messenger. Must be used together with the required group_id parameter
group_id - required only when using platform_ids. Ignored with other options. Specifies the bot for sending to the given platform_ids
attachment_url - file URL
attachment_type - file display type. Required if attachment_url is provided.
buttons - buttons
message_id - block number for sending
shift — number of seconds between messages. The default is 0.2.
time_shift - number. If specified, the message will be sent after the given number of seconds from the current time.
send_time - date and time in the format "%Y-%m-%d %H:%M:%S" (e.g., "2024-10-16 13:15:59"). This sets the date and time for sending the message. If both time_shift and send_time are specified, time_shift will take precedence.
Retrieving message history
GET https://chatter.mavibot.ai/api/#{api_key}/get_history?client_id=
URL request: https://chatter.mavibot.ai/api/#{api_key}/get_history?client_id=
The client_id parameter can be obtained here. ссылка
Access permission when generating the key: "Permission to read client information".

Path
api key* - access token
Body
client_id - client ID
limit - number of items in the response. Default: 2000, maximum: 2000
start_date - start date of the selection period (required if stop_date is specified), format: dd.mm.yyyy
stop_date - end date of the selection period (required if start_date is specified), format: dd.mm.yyyy
Clear message history
GET https://chatter.mavibot.ai/api/#{api_key}/clear_history?client_id=
URL запроса: https://chatter.mavibot.ai/api/#{api_key}/clear_history?client_id=
Deletes chat history
Access permission when generating a key: "Permission to modify/delete client information".

Path
api key* - access token
Body
client_id - client ID
How to assign clients
Assigning a client to an employee
POST https://chatter.mavibot.ai/api/#{api_key}/assign_to_user
URL request: https://chatter.mavibot.ai/api/#{api_key}/assign_to_user
This method allows you to assign a client to an employee. The email parameter is optional. If no email is provided, the system will assign the client according to its algorithm.
Access permission when generating a key: "Permission to modify/delete client information".

Path
api key* - access token
Body
client_id - client ID email - employee email (optional)
Importing clients into the system
POST https://chatter.mavibot.ai/api/#{api_key}/load_clients
URL request: https://chatter.mavibot.pro/api/#{api_key}/load_clients
This method allows you to import clients into the system. When uploading WhatsApp clients, you can provide the number in any format, either with the ending @s.whatsapp.net or without it.
The group ID (group_id) can be obtained HERE via /api/<api_key>/connected_channels. (If client_type = 13 (telephony), then group_id is an empty string: ""). ссылка
The messenger type from which the client came (client_type) can be found HERE. ссылка
Example: [{"platform_id":"79875555555","group_id":34810,"client_type":6}]
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
platform_id - phone number group_id - group ID client_type - the messenger type a client came from
Add clients to a list
POST https://chatter.mavibot.ai/api/<api_key>/add_to_list
URL request: https://chatter.mavibot.ai/api/<api_key>/add_to_list
Adds clients to a list
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
list_id - list number clients - client ID array
Example: JSON parameters {"list_id":1170282, "clients":[411262772, 646410963]}
Remove clients from a list
POST https://chatter.mavibot.ai/api/#{api_key}/remove_from_list
URL request: https://chatter.mavibot.ai/api/#{api_key}/remove_from_list
Removes clients from a list
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
list_id - list number clients - client numbers array in the Mavibot builder (values of client_id)
Retrieve client list
GET https://chatter.mavibot.ai/api/<api_key>/get_clients
URL request: https://chatter.mavibot.a/aipi/<api_key>/get_clients
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
offset – Offset from the first element
limit – Number of items in the response / Default: 500, Maximum: 500
list – List number
reverse – Indicates reverse sorting (from the oldest record to the newest). This parameter works only if the list is not specified.
Returns the status and an array of items.
Retrieve the list of bot subscribers in any messenger
GET https://chatter.mavibot.ai/api/#{api_key}/subscribers
URL request: https://chatter.mavibot.ai/api/#{api_key}/subscribers
Retrieves client information from a selected messenger.
Note! This method does not return variables.
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
page tag – Tag specified on the subscription page group – VK group ID the subscriber is linked to date_from – Subscribed after this date (timestamp) date_to – Subscribed before this date (timestamp) client_type – Messenger ID for which to retrieve the subscriber list. If not specified, all clients will be returned
How to work with variables
Assigning variables
POST https://chatter.mavibot.ai/api/#{api_key}/save_variables
URL request: https://chatter.mavibot.ai/api/#{api_key}/save_variables
! No limit applies to this request.
Allows you to save variables in both the lead and the client. By default, the variable assignment request adds them to deal variables. To update variables in the client profile, use the client. prefix. For example, for a phone: client.phone.
Access permission when generating a key: "Permission to modify or delete client information".

Update: The clients parameter allows assigning variables in bulk. Example: {"client_id":49177759, "variables":{"client.phone":"88888888888"}}
Path
api key* - access token
Body
clients – Array of client IDs for variable assignment
client_id – Client ID
variables – Hash of variables (key-value pairs)
Retrieve variables
GET https://chatter.mavibot.ai/api/#{api_key}/get_variables?client_id=
URL request: https://chatter.mavibot.ai/api/#{api_key}/get_variables?client_id=
Access permission when generating a key: "Permission to modify or delete client information".

Example: https://chatter.mavibot.ai/api/d3f31dabef80ddeb73d43938b4ef8bb0/get_variables?client_id=49177759
Path
api key* - access token
Body
client_id - client ID
How to retrieve the client ID (client_id)
Retrieve client_id using the platform_id value
POST https://chatter.mavibot.ai/api/#{api_key}/find_client_id_by_platform_id
URL request: https://chatter.mavibot.ai/api/#{api_key}/find_client_id_by_platform_id
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
platform_ids - ID's array in a messanger group_id - bot ID
Retrieve the client ID from the online chat
GET https://chatter.mavibot.ai/api/#{api_key}/online_chat_client_id?recipient=
URL request: https://chatter.mavibot.ai/api/#{api_key}/online_chat_client_id?recipient=
This method allows you to integrate a website with a chat bot. For example, if a user visits a promotion page, you can immediately send a message in the chat with a personalized offer.
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access tiken
Body
tag - tag (client tag) name - client name recipient - dialog ID on a website
Where to get the recipient?
You can get it on the website with the Mavibot.ai online chat, use JS to get the property MavibotAi.recipient_id.

Retrieve client_id by WhatsApp number
GET https://chatter.mavibot.ai/api/#{api_key}/whatsapp_client_id?phone=
URL request: https://chatter.mavibot.ai/api/#{api_key}/whatsapp_client_id?phone=
This method returns the client ID for making API requests if you know the client’s WhatsApp phone number. If no client exists with that number, the method will return a 404 error.
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
phone - phone number group_id - bot ID
Retrieve client_id by phone number
GET https://chatter.mavibot.ai/api/<api_key>/find_client_id_by_phone?phone=
URL request: https://chatter.mavibot.ai/api/<api_key>/find_client_id_by_phone?phone=
This method returns the client ID for making API requests.
The search is performed both among WhatsApp clients and via variables.
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
phone - phone number
Retrieve client_id by email
GET https://chatter.mavibot.ai/api/#{api_key}/find_client_id_by_email?email=
URL request: https://chatter.mavibot.ai/api/#{api_key}/find_client_id_by_email?email=
This method returns the client ID for making API requests. The search is performed using variables.
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Body
email - email for search
Retrieve client_id by variable value
GET https://chatter.mavibot.ai/api/#{api_key}/find_client_id_by_var?var=&val=
URL запроса: https://chatter.mavibot.ai/api/#{api_key}/find_client_id_by_var?var=&val=
This method returns the client ID for making API requests.
Access permission when generating the key: "Permission to read client information"

Path
api key* - access token
Body
var - variable name to search by val - variable value group_id - group ID search_in - pass the value 'order' to search in deal variables; searches up to three variables for project clients and returns a list of clients that have all the specified variables.
Retrieve the ID of the most recently created client by variable value
GET https://chatter.mavibot.ai/api/#{api_key}/find_latest_client_id_by_var?var=&val=
URL request: https://chatter.mavibot.ai/api/#{api_key}/find_latest_client_id_by_var ?var=&val=
This method returns the ID of the most recently created client for making API requests. It searches both client and deal variables.
Access permission when generating the key: "Permission to read client information"

Path
api key* - access token
Body
var - variable name to search by val - variable value
Retrieve a list of client_id values by variable value
GET https://chatter.mavibot.ai/api/#{api_key}/find_all_client_id_by_var?var=&val=
URL request: https://chatter.mavibot.ai/api/#{api_key}/find_all_client_id_by_var?var=&val=
This method returns a list of client IDs that have the specified variable with the specified value.
Access permission when generating the key: "Permission to read client information"

Path
api key* - access token
Body
var - variable name to search by val - variable value
Retrieve a list of client_id values based on multiple variable values
GET https://chatter.mavibot.ai/api/#{api_key}/find_all_client_id_by_several_vars?var=val
URL request: https://chatter.mavibot.ai/api/#{api_key}/find_all_client_id_by_several_vars?var=val
Access permission when generating the key: "Permission to read client information".

Path
api key* - acces token
Body
variable1 - Value1
variable2 - Value2
variable3 - Value3
Search by variables
POST https://chatter.mavibot.ai/api/#{api_key}/find_clients
URL request: https://chatter.mavibot.ai/api/#{api_key}/find_clients
This method searches by variables and returns a list of client IDs that meet the query conditions.
By default, the search is performed on client variables (recommended): {"q": {"result": "ok", "var": "home", "var": "60"}} – the client must have all specified variables
Search in deal variables, at least one of the specified variables must be present: {"q": {"result": "ok", "var": "home", "var": "60"}, "search_in": "order", "include_all": False}
Client variable name equals one of the list values: {"q": {"name": {"_in": ["Joe", "Jane", "Donald"]}}}
Client variable name does NOT equal any of the list values: {"q": {"name": {"_not_in": ["Joe", "Jane", "Donald"]}}}
Client variable name does not equal "Joe": {"q": {"name": {"_not": "Joe"}}}
Note: Number comparison works only if all clients have numeric values in the searched variable. If even one client has a string, the request will fail.
Access permission when generating the key: "Permission to read client information"

Parameters
Path
api key* - access token
Body
q – required parameter, contains the query conditions for searching variables
search_in – specifies which entity’s variables to search; if not provided, the search is done on client variables. Can take the value order.
include_all – whether all conditions in q must be met;
False – if at least one condition matches, the entity is selected
How to work with deals
Retrieve the current deal ID
GET https://chatter.mavibot.ai/api/#{api_key}/get_current_order_id
URL request: https://chatter.mavibot.ai/api/#{api_key}/get_current_order_id
Access permission when generating the key: "Permission to read CRM information".

Path
api key* - access token
Body
client_id - client ID
Retrieve the list of deals
GET https://chatter.mavibot.ai/api/#{api_key}/get_orders
URL request: https://chatter.mavibot.ai/api/#{api_key}/get_orders
Access permission when generating the key: "Permission to read CRM information"

Path
api key* - access token
Body
client_id - client ID
order_status - deal stage: 0 - active deals 1 - successful deals 2 - unsuccessful deals
Move a deal to the next stage in the Mavibot funnel
POST https://chatter.mavibot.ai/api/#{api_key}/move_order_to_next_state
URL request: https://chatter.mavibot.ai/api/#{api_key}/move_order_to_next_state
Access permission when generating the key: "Permission to modify/delete CRM information"

Path
api key* - access token
Body
client_id - client ID
order_id - deal ID
Retrieve deal data
POST https://chatter.mavibot.ai/api/#{api_key}/get_order_vars
URL request: https://chatter.mavibot.ai/api/#{api_key}/get_order_vars
Access permission when generating the key: "Permission to read CRM information"

Path
api key* - access token
Body
client_id - client ID
order_id - deal ID
variables - variable array (format:["var_name1", "var_name2"])
Add deal variables
POST https://chatter.mavibot.ai/api/#{api_key}/set_order_vars
URL request: https://chatter.mavibot.ai/api/#{api_key}/set_order_vars
Access permission when generating the key: "Permission to modify/delete CRM information"

Path
api key* - access token
Body
client_id - client ID
order_id - deal ID
variables -A dictionary of variables (the key is the variable name, and the value is what should be saved in that variable) (format:{"var_name": "var_velue"})
Create a deal
POST https://chatter.mavibot.ai/api/#{api_key}/create_order
URL request: https://chatter.mavibot.ai/api/#{api_key}/create_order
Access permission when generating the key: "Permission to modify/delete CRM information"

Path
api key* - access token
Body
client_id - client ID
name - deal name
description - deal description
budget - deal amount
You must specify one of the following parameters in the request: client_id, email, or phone. If multiple parameters are provided, only one will be used. The priority order is: client_id > phone > email. If phone or email is provided and no client exists with that phone number or email, a new client will be created.
Move a deal to a stage in MavibotCRM
POST https://chatter.mavibot.ai/api/#{api_key}/set_order_state
URL request: https://chatter.mavibot.ai/api/#{api_key}/set_order_state
Access permission when generating the key: "Permission to modify/delete CRM information"

Path
api key* - access token
Body
client_id - client ID
state_id - the stage number to which the client’s deal should be moved
Retrieve the funnel stage ID in Mavibot CRM
GET https://chatter.mavibot.ai/api/#{api_key}/get_order_state
URL request: https://chatter.mavibot.ai/api/#{api_key}/get_order_state
Access permission when generating the key: "Permission to read CRM information"

Path
api key* - access token
Body
client_id - client ID
state_id - deal ID (if not specified, the method will return the stage ID of the current deal)
What other capabilities are available?
Check if a phone number has WhatsApp
GET https://chatter.mavibot.ai/api/#{api_key}/check_whatsapp
URL request: https://chatter.mavibot.ai/api/#{api_key}/check_whatsapp
To use this method, WhatsApp must be connected to Mavibot.
Access permission when generating a key: "Permission to modify or delete client information".

Can be called using either GET or POST. The phone number can be provided in any format.
Path
api key* - access token
Body
phone - phone number to check
Get the list of messengers connected to the project
GET https://chatter.mavibot.ai/api/<api_key>/connected_channels
URL request: https://chatter.mavibot.ai/api/<api_key>/connected_channels
Access permission when generating a key: "Permission to modify or delete client information".

The function returns the group_id parameter for each messenger, which must be used when importing clients.
For WhatsApp, it also returns a status field, which can have the following values:
NOT_STARTED = 0 STARTED = 1 ASLEEP = 2 STOPPED = 3
Path
api key* - access token
Retrieve the list of blocks from the bot’s flow
GET https://chatter.mavibot.ai/api/<api_key>/get_messages
URL request: https://chatter.mavibot.ai/api/<api_key>/get_messages
Access permission when generating a key: "Permission to modify or delete client information".

Path
api key* - access token
Retrieve nested client data
delimiter
To retrieve client_id and/or the client’s phone number from nested dictionaries (not at the first level), use the delimiter parameter.
Add the following to your request URL:
?delimiter=1&delimiter_value_client_id={key1}1{key2}&delimiter_value_phone={key1}1{key2}
where:
?delimiter=1 – the delimiter value that separates keys {key1}1{key2}1{key3}
delimiter_value_client_id={key1}1{key2} – to retrieve the client ID
delimiter_value_phone={key1}1{key2} – to retrieve the client phone number
{key1}, {key2}, … – keys containing the values (can include any characters except the delimiter). You can have an unlimited number of keys: ?delimiter=1&delimiter_value_client_id={key1}1{key2}1{key3}1{key4}1{key5}1{key6}. Keys are passed without curly braces.
Use the delimiter between keys. For example, if delimiter=2, then {key1}2{key2}2{key3}; if delimiter=5, then {key1}5{key2}5{key3}. Ensure the key does not contain the delimiter character.
Example:
https://chatter.mavibot.a/aipi/<api_key>/callback?delimiter=1&delimiter_value_client_id={key1}1{key2}&delimiter_value_phone={key1}1{key2}
You can also retrieve only the ID or only the phone number:
https://chatter.salebot.pro/api/<api_key>/callback?delimiter=1&delimiter_value_client_id={key1}1{key2} - only client ID;
https://chatter.salebot.pro/api/<api_key>/callback?delimiter=1delimiter_value_phone={key1}1{key2} - only phone number;
API methods:
Start bot: https://chatter.mavibotbot.ai/api/<api_key>/callback
Start bot by WhatsApp number: https://chatter.mavibotbot.ai/api/<api_key>/whatsapp_callback
Start bot by Telegram ID: https://chatter.mavibotbot.ai/api/<api_key>/tg_callback
Send callback message to email client: https://chatter.mavibotbot.ai/api/<api_key>/email_callback
Send message to client: https://chatter.mavibotbot.ai/api/<api_key>/message
Send WhatsApp message: https://chatter.mavibotbot.ai/api/<api_key>/whatsapp_message
Bulk messaging: https://chatter.mavibotbot.ai/api/<api_key>/broadcast
Assign variables: https://chatter.mavibotbot.ai/api/<api_key>/save_variables
If you need additional methods, please contact support.
Last updated