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 returns the current first live window. M2M v1 does not currently accept a continuation cursor on this endpoint.
  • 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 media-upload endpoint. Do not generate a media upload workflow.
  • 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

Custom Tools Prompt

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.