You can connect your bot to any service that has an API or an MCP server: your CRM, online store, accounting system, booking service, or custom software. No pre-built integration module is required.

Once connected, the bot can:

  • Interact with the service — find orders, create deals, retrieve product lists, and book appointments for customers;
  • Track new events in the service — detect new orders, status changes, or customer registrations and notify customers automatically.

All you need is the API URL and an access key.

How to Connect a Service

Open the AI assistant chat in your Mavibot account and specify:

  • The service you want to connect and its URL;
  • The access key obtained from the service;
  • What you want the bot to do.

How to Connect a Service

Example:

We have a Shopify online store: https://myshop.myshopify.com
Application credentials: Client ID …, Client secret …
Requirements: when a new order is placed, the bot sends the customer the order number and total amount; when a customer types "catalog", the bot displays products with prices.

The AI assistant will find the service documentation, establish the connection, configure the required requests, and create the bot blocks. If the service uses private or custom documentation, provide a link to it or describe how the access key is passed.

The assistant displays the proposed changes to the bot flow in a card and applies them after you click "Run".

Once the setup is complete, test the integration: send a command to the bot as a customer and create a test record in the connected service.

Where to Find Your Connections

Project Settings → Service Integrations.

Project Settings

Service Integrations

On this page, you can view:

  • A list of connections and their statuses: "Active", "Token rejected", or "Disabled";
  • The actions the bot can perform in each service and the data it retrieves automatically;
  • The activity log containing recent events, requests, and errors;
  • Advanced settings: test a connection, replace an access key, disable or delete a connection.

You can also connect a service manually without using the AI assistant. Select "Connect Manually" on the same page.

Select "Connect Manually" on the same page.

Supported Authentication Methods

You can use any of the following authentication methods supported by the service API:

  • A permanent token passed in a request header or URL;
  • A username and password (Basic Authentication);
  • A Client ID and Client Secret used to obtain a temporary access token. The bot obtains and refreshes the token automatically;
  • No authentication, if the API is public.

The access key is stored in the connection settings rather than in individual bot blocks. When replacing an access key, you do not need to modify the bot blocks. Simply update the key on the connection settings page.

How the Bot Detects New Records

The bot automatically polls the connected service at scheduled intervals. There is no need to configure webhooks in the external service.

How it works:

  • During the first request, the bot records the existing data in the service. Events are triggered only for records created afterward;
  • For each new record, the bot searches for a customer using the phone number or email address provided in the record. If the customer does not exist, the bot can create a new customer profile automatically;
  • An event is delivered to the matching customer, triggering the corresponding bot block.

Important considerations:

  • Events may be delayed by up to one polling interval;
  • If you change the polling settings, the bot captures the current state of the service again. Records created during reconfiguration will not trigger events;
  • The bot can initiate a conversation only with customers who already have an existing conversation in the messenger, or contact them using the email address or phone number from the record if a suitable communication channel is connected to the project;
  • The bot processes up to 50 new records per request. Any remaining records are processed during the next polling cycle.

If the service supports webhooks and you want to receive events instantly, you can find the webhook URL in the advanced connection settings.

Event-Triggered Bot Blocks

An event is delivered to the bot as a message in the following format:

connector_event <connection> <event>

For example: connector_event api_shopify order_created. A bot block with this condition is triggered when the corresponding event occurs.

The following variables are available within the block:

Variable Description
connector_system Connection name
connector_event Event name
connector_record_id Record ID in the external service
connector_payload Record data in JSON format

Example of calculator code for a new order event:

rec = connector_payload
order_number = rec['name']
order_total = rec['total_price']

Example of the block message: Your order #{order_number} has been placed. Order total: #{order_total}.

Calculator Functions

Parameters must be passed in the specified order. Parameter names are not required. The connection name is passed as the last argument. If the project has only one connection, this argument can be omitted.

connector_call(action, parameters, connection)

Executes an action configured in the connection or calls an MCP server tool. Parameters must be provided as a JSON string.

resp = connector_call("get_products", '{"limit": 5}', "shopify")
first_title = resp['products'][0]['title']

connector_request(method, path, parameters, body, connection)

Sends a request to the external service API using the connection's access key. The path is relative to the base API URL.

resp = connector_request("GET", "/orders.json", '{"status": "any", "limit": 1}', "", "shopify")

connector_actions(connection)

Returns a list of available connection actions in JSON format. For an MCP server, it returns a list of available tools.

connector_status(connection)

Returns the status of project connections in JSON format, including the connection name, status, and most recent error.

Error Handling

If an error occurs, the function returns a string beginning with error:. The same error message is stored in the connector_last_error variable. Check this variable before displaying a response to the customer:

resp = connector_call("create_order", params, "shopify")
if (connector_last_error != '') {
    answer_text = 'Unable to place your order. Please try again later.'
}

MCP Servers

If a service provides an MCP server, simply give the AI assistant its URL and an access key, if required. The server's tools become available as connection actions and can be called using connector_call:

resp = connector_call("microsoft_docs_search", '{"query": "how to create a function"}', "msdocs")

Troubleshooting

Issue Solution
"Token rejected" status The service no longer accepts the access key. Obtain a new key and update it in the advanced connection settings. The project owner receives an email notification about this issue.
The function returns error: 401 or 403 The access key does not have the required permissions for this method. Check the application permissions in the external service.
error: 404 The API endpoint path is incorrect. Check the service documentation or ask the AI assistant to correct the action.
error: 429 The service has reached its request rate limit. Reduce the frequency of function calls or increase the polling interval.
An event is not received Open the connection activity log to check whether polling occurred and whether new records were detected. The record must have been created after polling was configured and must contain the customer's phone number or email address.
A bot block is not triggered by an event Check that the block condition matches the connection and event names displayed in the activity log.

The activity log stores the 50 most recent entries for up to 14 days.

Limitations

  • The external service must be accessible over the internet and support HTTPS;
  • The response to a polling request must not exceed 5 MB or take longer than 8 seconds;
  • Each polling configuration supports up to 300 events per hour. If this limit is exceeded, polling is paused until the next hour;
  • If a connection remains unavailable for more than three days, polling is suspended until the issue is resolved.