Skip to main content
Use the M2M messaging endpoints to connect Visito with your CRM, helpdesk, analytics pipeline, or internal operations backend.

List Channels

Use channels to discover the connected accounts your integration can work with.
Required scope:
Example response:
Store the channel id when you need to send WhatsApp templates from a specific number.

List Conversations

Required scope:
Common query parameters: Example:
The endpoint returns the current live window:
M2M v1 currently exposes the first live conversation window. Even if a response contains nextCursor, the list endpoint does not currently accept a continuation cursor. Use filters and a limit up to 200 to define the working set your integration needs.

Get Conversation Detail

Required scope:
Use this endpoint before sending a reply so your integration has the latest conversation context. Example response:
conversation.needsReply is the authoritative signal that operator action is required. lastMessageRole describes chronology only; do not use it as a substitute for needsReply.

List Conversation Messages

The endpoint returns only the external transcript: inbound user messages and outbound assistant or operator messages. Internal system and tool activity is excluded before pagination. Messages are ordered newest first. Treat cursor as opaque and pass nextCursor unchanged to retrieve older messages. hasMore=true means older external messages remain; nextCursor is null when hasMore=false. Example response:
Use messages[].eventId to correlate a queued requestEventId. Delivery information can appear in messages[].status, messages[].statusReason, and messages[].deliveries. status is always one of received, queued, sent, delivered, read, failed, blocked, partial_sent, or unknown. A dispatcher publish failure is normalized to failed. Message direction describes chronology only. Use conversation.needsReply, not the latest message direction, to decide whether operator action is required.

Send a Reply

Required scope:
Required headers:
Request body:
You can send text, media, or both:
M2M v1 does not currently expose a media-upload endpoint. mediaId can only reference a media asset that already exists for the conversation. For a standalone M2M integration, use text replies unless your workflow already has a valid Visito media ID.
Successful response:
Replies are queued asynchronously. Delivery results are reconciled into Visito conversation history after the channel dispatcher sends the message.

Reconcile an Outbound Reply

  1. Persist the conversationId, replyId, requestEventId, correlationId, and Idempotency-Key from the 202 response.
  2. Read GET /m2m/v1/conversations/{conversationId}/messages.
  3. Match requestEventId to messages[].eventId.
  4. Treat queued as pending, sent as handed to the provider, and failed or blocked as unsuccessful.
  5. If the original send request times out, retry the exact same body with the same idempotency key before deciding to create new outbound work.
Free-form replies can return 409 REPLY_WINDOW_CLOSED. For WhatsApp, use an approved template to reopen the conversation instead of retrying the reply.

When To Use WhatsApp Templates

WhatsApp and Instagram have provider rules around free-form messages. For WhatsApp conversations outside the customer service window, use an approved WhatsApp template instead of a free-form reply. Continue with WhatsApp Templates to create, list, and send templates.