Give the Assistant Authoritative Context
Provide these sources with the implementation request:- The OpenAPI definition for machine-readable routes and schemas.
- Authentication for scopes, idempotency, status codes, and retry behavior.
- The workflow guide for conversations, custom tools, or WhatsApp templates.
Integration Context
Endpoint Summary
Scope Map
Contracts Assistants Commonly Miss
GET /conversationsreturns the current first live window. M2M v1 does not currently accept a continuation cursor on this endpoint.GET /conversations/{conversationId}returns metadata only. Treatconversation.needsReplyas the authoritative operator-action signal.GET /conversations/{conversationId}/messagesreturns the newest-first external transcript and supportslimitplus an opaquecursorfor 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
requestEventIdwithmessages[].eventIdfrom 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.detailsis 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_TOKENin 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
APPROVEDtemplates can be sent. - Log Visito
error.code,conversationId,replyId, andrequestEventIdfor support. - Require human approval before an assistant-generated workflow sends proactive templates or enables a mutating custom tool.