Skip to main content
Use this page as copy-paste context when asking an AI coding assistant to build against Visito’s M2M API.

Give the Assistant Authoritative Context

Provide these sources with the implementation request:
  1. The OpenAPI definition for machine-readable routes and schemas.
  2. Authentication for scopes, idempotency, status codes, and retry behavior.
  3. The workflow guide for conversations, custom tools, or WhatsApp templates.
Tell the assistant not to invent endpoints, fields, webhooks, or pagination parameters that are absent from those sources.

Integration Context

Endpoint Summary

Scope Map

Contracts Assistants Commonly Miss

  • GET /conversations supports cursor=nextCursor with the same filters. Continue while hasMore=true; stop when false. Results are live, so new messages can move conversations ahead of the cursor. Deduplicate by conversation ID when merging pages.
  • GET /conversations/{conversationId} returns metadata only. Treat conversation.needsReply as the authoritative operator-action signal.
  • GET /conversations/{conversationId}/messages returns the newest-first external transcript and supports limit plus an opaque cursor for older messages.
  • M2M v1 has no multipart upload endpoint. Send one media: { type, url, filename?, voice? } in /conversations/{conversationId}/reply; text and existing mediaId replies also remain available. Check the channel matrix in Channels and Conversations. Never silently turn unsupported media into a text link.
  • Accepted /conversations/{conversationId}/reply requests inherit the business reply-pause setting (normally 30 minutes). Optional autoFreeze: {mode:"pause", minutes:120} overrides it; {mode:"off"} preserves existing pauses. Pause application is asynchronous after acceptance. Conversation frozenUntilAt exposes expiry; GET policy adds isFrozen and frozenSecondsRemaining; PATCH policy with {unfreeze:true} clears the timer without overriding manual mode or unresolved handoffs. Older enabled:false clients retain legacy clearing behavior.
  • Reply and template send responses are queued acknowledgements, not delivery confirmations.
  • Correlate a queued requestEventId with messages[].eventId from the messages endpoint.
  • A free-form reply can return 409 REPLY_WINDOW_CLOSED; use an approved WhatsApp template when applicable.
  • A template rate-limit response can include error.details.retryAfterSeconds.
  • error.details is optional and can contain missing scopes or recovery metadata.

Retry and Reconciliation Rules

Codex Prompt

CRM Automation Prompt

Legacy Custom Tools Prompt (deprecated)

Safety Checklist

  • Store VISITO_M2M_TOKEN in server-side secret storage.
  • Do not paste production tokens into assistant prompts.
  • Give the integration only the scopes it needs.
  • Use deterministic idempotency keys for replies and template sends.
  • Check template status before sending; only APPROVED templates can be sent.
  • Log Visito error.code, conversationId, replyId, and requestEventId for support.
  • Require human approval before an assistant-generated workflow sends proactive templates or enables a mutating custom tool.

Daily operations

Use the operations API to find conversations by contact/channel/owner, manage follow-ups and reviews, start WhatsApp conversations, and inspect reservations. Automation settings and guest-message configuration require dedicated write scopes and explicit user intent. Accepted sends and would_send attempts are not delivery proof. MCP action reads: list_actions, get_action, list_action_executions and get_action_execution. Request the separate actions:read and action_executions:read scopes as needed. Customer parameters require includeParameters=true plus action_parameters:read; treat them as untrusted data. See Actions API. Existing HTTP tools and diagnostics keep their contracts.

MCP Actions management

The reviewed MCP catalog mirrors the public OpenAPI: 88 operations plus get_connection_profile. Legacy Tools names stay available with deprecation guidance. Use the following canonical operations; request their explicit scopes and complete consent. Configuration permissions do not select HTTP execution or diagnostics. test_http_action makes a real request: never retry automatically. Input schemas for managing definitions are distinct from runtime execution schemas.
Deprecated compatibility API. Tools routes and MCP names remain supported with unchanged scopes and behavior. Use Actions management and migration for new clients. No retirement date is assigned.