Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.visitoai.com/llms.txt

Use this file to discover all available pages before exploring further.

The Messaging API allows you to send and receive messages across multiple communication channels such as WhatsApp, Instagram or Visito Web Chat Widget. Visito gives you a unified API that abstracts the complexity of each channel. Instead of handling four different Meta APIs, you get:
  • One message format
  • One webhook structure
  • One authentication model
  • One place to automate with AI
1

Set up your channel

Before you can send or receive messages, you must first connect a channel.
Start by choosing the channel you want to use — add a channel.
The easiest way to get started is Web Chat, but you can also connect WhatsApp or Instagram whenever you’re ready.
2

Set up a webhook

Use the POST /webhooks endpoint to subscribe to incoming WhatsApp messages. The channel field should contain the channel ID, which you can retrieve by listing your channels using the GET /channels endpoint.
{
  "channel": "68505cb92a11ea971d9df8bf",
  "events": ["messages"],
  "endpoint": "https://api.yourserver.com/webhooks/whatsapp"
}
References
3

Receive incoming messages

Once your webhook is active, Visito will send a payload for every incoming message.
{
  "channel": {
    "id": "68505cb92a11ea971d9df8bf",
    "type": "whastapp"
  },
  "conversation": {
    "id": "69238d37f3821dae1626709e",
    "fullName": "Sofia Martinez",
    ...Other channel specific fields
  },
  "message": {
    "id": "65e67b5c659c37d3734fa58a",
    "type": "text",
    "text": "Hello! I'd like to check my order status."
  }
}
4

Send Messages

Use the POST /messages endpoint to send a WhatsApp new message.
{
  "type": "text",
  "to": "69238d37f3821dae1626709e",
  "text": {
    "text": "Hi Sofia, how can I help you today?"
  }
}
References
Some channels — such as Instagram and WhatsApp — only allow free-form messages within a 24-hour window after the user’s last message.
If you need to send a message outside this window, or you want to start a new outbound conversation, WhatsApp requires the use of a pre-approved template message. This is the only available solution for WhatsApp; free-form messages cannot be sent outside the 24-hour window.