Help Center / Detailed instructions / AI Agents

How to connect VK to an AI agent

The VK channel is needed so the AI agent can reply to messages from your VK community. The main first-line scenario is text messages.

Important: the channel is considered connected only after the Callback API is fully configured in VK and a test message is sent. A successful token check alone is not enough.

What you need beforehand

  • You already have a VK community.
  • You have access to that community’s settings.
  • The AI agent has already been created.
  • The AI agent is enabled.

What data you will need

  • Channel name — set in Mobitsa.
  • Group token — created in VK and pasted into Mobitsa.
  • VK confirmation string — shown in VK and pasted into Mobitsa.
  • Callback API secret key — taken from Mobitsa and pasted into VK.
  • Callback API address — taken from Mobitsa and pasted into VK.

Step 1. Add the VK channel in Mobitsa

  1. Open the required AI agent.
  2. Go to the Channels section.
  3. Add a new VK channel.

Step 2. Get the data from the VK channel form

In the VK channel form, you will need the following fields and values:

  • Channel name.
  • Group token.
  • VK confirmation string.
  • Callback API secret key to copy.
  • Callback API address to copy.

At this stage, it is important to remember the data sources: Group token and VK confirmation string come from VK, while Callback API secret key and Callback API address are taken from Mobitsa.

Step 3. Prepare the VK community

  1. Open the VK community.
  2. Go to Management.
  3. Open the Messages section.
  4. Enable Community messages.
  5. Then open Management → Additional → API usage.

Step 4. Get the Group token in VK

In the API usage section, create an access token for community messages.

  1. Create an access token.
  2. Copy it.
  3. Paste the value into the Group token field in Mobitsa.

This token is used to verify access to the community.

VK — the "Access keys" section where the community Group token is created and copied for community messages
VK: creating and copying the Group token in the "Access keys" section
Mobitsa — the VK channel setup form, the "Group token" field where the community token from VK is pasted
Mobitsa: paste the Group token from VK into the "Group token" field

Step 5. Add the Callback API server

In the Callback API tab in VK, add a server.

  1. Open the Callback API tab.
  2. Click add server.
  3. Paste the Callback API address from the VK channel form in Mobitsa into the server address field.
Mobitsa — the VK channel form with the "Callback API address" field that needs to be copied
Mobitsa: copy the Callback API address from the VK channel form
VK — Callback API settings, the "Address" field where the server address from Mobitsa is pasted
VK: paste the Callback API address from Mobitsa into the "Address" field

Step 6. Copy the VK confirmation string

After adding the server, VK will show a string like "String that the server must return".

  1. Copy this string in VK.
  2. Paste it into the VK confirmation string field in Mobitsa.
  3. Return to VK and click Confirm.

Important: the confirmation string is issued by VK, not Mobitsa.

VK — the Callback API screen with the confirmation string that needs to be copied for Mobitsa
VK: copy the server confirmation string
Mobitsa — the VK channel setup form with the "VK confirmation string" field where the string from VK is pasted
Mobitsa: paste the confirmation string from VK into the "VK confirmation string" field

Step 7. Specify the Secret key

  1. Copy the Callback API secret key from Mobitsa.
  2. Paste it into the Secret key field in the Callback API settings in VK.

Important: the Callback API secret key is taken from Mobitsa, while the VK confirmation string comes from VK.

Callback API secret key block in the Mobitsa VK channel form
Callback API secret key - copy it
Paste into the Secret key field in VK
Paste into the Secret key field in VK

Step 8. Enable message events

After setting up the server, open the Event types section in VK and enable events from the Messages block.

This is a required step. Even if the token is verified and the server is added, messages will not reach the channel without events.

message events in the Event types tab in VK
message events in the Event types tab in VK

Step 9. Check the token in Mobitsa

Return to Mobitsa and click Check token.

After a successful check, click Save in the agent channel.

A successful check only confirms that the community token is correct. It does not mean the whole channel is fully working yet.

Step 10. Send a test message

  1. Send a message to the VK community messages.
  2. Return to Mobitsa.
  3. Check whether a new dialog appears.
  4. Check whether the AI agent replied.

The test message is the final connection check.

How to know VK is connected correctly

  • Token check was successful.
  • Callback API is configured.
  • Message events are enabled.
  • A test message was received.
  • A dialog appeared in Mobitsa.
  • The AI agent replied.

What to do if the channel is not working

  • Check whether the Group token is entered correctly.
  • Make sure the Callback API address from Mobitsa is specified in VK.
  • Check whether the VK confirmation string field is filled in.
  • Check whether the Callback API secret key is entered.
  • Make sure events from the Messages section are enabled in VK.
  • After setup, send a new test message.

If the token passes the check but there are no dialogs, the cause is usually related to the Callback API or event settings.

What not to confuse

  • Group token — the community access token from VK.
  • VK confirmation string — the string shown by VK.
  • Callback API secret key — the value from Mobitsa for VK settings.
  • Callback API address — the server address from Mobitsa for VK settings.

Remember: the channel is considered working only after a successful test message and a dialog appears in Mobitsa.