One versioned surface
Public REST routes live under /v1. Compatibility routes under /api/v1 forward to the same API.
Build against the production REST API for WhatsApp, Instagram, and Messenger conversations. Auth, pagination, messages, journeys, templates, signed webhooks, delivery debugging, and developer endpoints are all here.
Use InstantReply as the messaging layer for your product or internal tools. Your backend can read conversations, send replies, update contacts, route leads, trigger WhatsApp journeys, validate templates, and react to customer messages in real time.
Public REST routes live under /v1. Compatibility routes under /api/v1 forward to the same API.
The API is the same production surface used by the dashboard, automations, AI replies, and journey sends.
Register one webhook endpoint and receive signed POSTs when customers reply or delivery state changes.
Authenticate with a scoped API key in Authorization: Bearer $IR_API_KEY. Keep live and test keys separate. Rotate keys from the developer settings without changing your webhook signing secret.
curl https://api.instantreply.co/v1/conversations \
-H "Authorization: Bearer $IR_API_KEY"curl -X POST https://api.instantreply.co/v1/conversations/$ID/messages \
-H "Authorization: Bearer $IR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"Thanks for reaching out - how can we help?"}'Every list endpoint accepts ?cursor= and returns the next cursor when more records exist. Keep the cursor opaque and pass it back exactly as received.
Responses include X-Request-ID for correlation; you may provide a valid ID or let the API generate one. POST /v1/messages and POST /v1/conversations/:id/messages require Idempotency-Key: an identical retry replays its result, while a different body with the same key returns 409. Other send routes do not necessarily support this header. Use GET /v1/messages or GET /v1/trigger/status/:id to inspect delivery status. GET /v1/status is an unauthenticated database/Redis dependency health check (200 healthy, 503 degraded); request trace fields are internal and there is no public trace lookup endpoint. Sending: a send returns 201 only when it was really sent; if the provider rejects it the response is 422 SEND_FAILED. Free text on WhatsApp requires an open customer-service window; outside it, send an approved template with POST /v1/templates/:id/send. A replayed Idempotency-Key response carries Idempotent-Replayed: true. Per-number sending: the templates endpoint resolves the sender as explicit integration_id, then the template's pinned number, then the workspace's single active WhatsApp number, else 409 AMBIGUOUS_INTEGRATION. Scopes: messages:send for free-text sends, templates:send for template sends, automations:write for per-channel DM/comment toggles and comment rules. Set integration_id on a comment trigger rule to scope it to one connected Instagram/Facebook page. Rate limits are per key per minute by plan tier: 30 free, 120 dev_hobby/starter, 600 trial/dev_pro/growth, 2400 dev_scale/pro, 10000 enterprise; GET /v1/developer/limits returns your key's value.
These are the routes developers use most often. The complete route inventory is in the REST endpoint catalog, but this page explains what each group is for and how it fits into an integration.
Read customer conversations, send replies, and sync message history.
/v1/conversationsList conversations with filters for status, channel, assignee, and cursor pagination.
/v1/conversations/:idRead one conversation with customer, channel, stage, tags, and latest activity.
/v1/conversations/:idUpdate assignment, status, tags, or routing fields for a conversation.
/v1/conversations/:id/messagesRead the message history for a conversation.
/v1/conversations/:id/messagesSend a reply on the conversation's channel with messages:send and a required Idempotency-Key header. Optional integration_id must match the conversation's connected account or returns 409 ACCOUNT_MISMATCH.
/v1/messagesList messages across conversations for audit, sync, or analytics jobs.
/v1/messagesSend free-form content (1–4096 characters) with messages:send and a required Idempotency-Key header. Use conversation_id, or contact_id plus channel for an existing conversation. Optional integration_id selects the connected account; use GET /v1/channels. Ambiguous contact chats return 409 ACCOUNT_REQUIRED.
/v1/messages/:idFetch delivery and content details for one message.
Sync the human-work queue InstantReply creates from handoffs, safety reviews, and routing rules.
/v1/ticketsList tickets by status, priority, kind, assignee, or conversation with stable cursor pagination.
/v1/tickets/:idRead one ticket with lifecycle, SLA, assignment, and conversation references.
/v1/tickets/:idUpdate status, priority, or assignee with optional optimistic concurrency.
Keep the customer record in sync and pull the operational metrics your app needs.
/v1/contactsList contacts with stage, score, owner, and channel identity.
/v1/contacts/:idRead a contact profile and linked conversation context.
/v1/contacts/:idUpdate contact fields created by lead capture or your CRM.
/v1/channelsList connected WhatsApp, Instagram, and Messenger channels.
/v1/channels/:integration_idSet DM replies with { ai_enabled } or Instagram/Facebook comment replies with { ai_comment_replies_enabled } for only this connected account; requires automations:write.
/v1/analytics/summaryRead response-time, volume, and conversion summary metrics.
/v1/usageRead plan usage for messages, AI replies, webhooks, and API calls.
/v1/statusUnauthenticated database/Redis dependency health. Returns 200 when healthy, 503 when degraded, and error_rate: null until enough real usage history exists.
Manage API keys and subscribe your server to signed, real-time events.
/v1/keysList active API keys and scopes.
/v1/keysCreate a scoped key for a backend, agent, or test environment.
/v1/keys/:id/rotateRotate a key without downtime.
/v1/keys/:idRevoke a key immediately.
/v1/webhooksList webhook endpoints.
/v1/webhooksRegister a signed webhook endpoint.
/v1/webhooks/:idDisable a webhook endpoint.
/v1/webhooks/:id/deliveriesInspect recent delivery attempts and failures.
/v1/webhooks/sendTrigger an immediate WhatsApp journey/send.
/v1/webhooks/trigger-campaignCompatibility alias for the immediate send endpoint.
/v1/webhooks/sign-payloadGenerate a test HMAC signature for webhook verification.
Trigger WhatsApp journeys, inspect delivery outcomes, and sync business events.
/v1/journeysList journey templates available to your account.
/v1/journeysCreate a journey and map approved WhatsApp templates to its steps.
/v1/journeys/:idRead one journey with its mapped templates and step delays.
/v1/journeys/:id/stepsReplace the journey step map with organization-owned templates.
/v1/journeys/:id/statusActivate or pause a journey after its template mapping is ready.
/v1/triggerEnroll a contact into a journey or template workflow.
/v1/trigger/limitsRead journey quota, usage, and remaining capacity.
/v1/trigger/status/:idExplain the current delivery result for a trigger.
/v1/trigger/historyReview recent trigger activity.
/v1/trigger/validateValidate a trigger payload before sending.
/v1/trigger/batchTrigger a batch of contacts with per-row results.
/v1/trigger/enrollmentsCancel active enrollments for a contact or journey.
/v1/eventsSend an external business event into InstantReply.
/v1/campaignsList broadcast campaigns.
/v1/campaignsCreate a campaign draft.
/v1/campaigns/:idRead one campaign.
/v1/campaigns/:idUpdate a draft or scheduled campaign.
/v1/campaigns/:id/sendStart an approved campaign send.
Sync the human-work queue InstantReply creates from handoffs, safety reviews, and routing rules.
/v1/ticketsList tickets with status, priority, assignee, conversation, and cursor filters.
/v1/tickets/:idRead one ticket with lifecycle, SLA, assignment, and conversation references.
/v1/tickets/:idUpdate ticket status, priority, assignee, or resolution metadata.
Validate, submit, and debug WhatsApp templates without guessing Meta policy behavior.
/v1/templatesList templates and status from InstantReply and Meta.
/v1/templatesCreate a template draft.
/v1/templates/:idRead a template with category and provider status.
/v1/templates/:id/sendSend an approved template using templates:send. Optional integration_id selects the sender; otherwise the pinned template number or sole active number is used. Multiple unresolved active numbers return 409 AMBIGUOUS_INTEGRATION.
/v1/templates/:idDelete a template from Meta and the local registry.
/v1/templates/generate/validateValidate generated copy before saving it.
/v1/templates/:id/validateCheck category fit and get UTILITY coaching.
/v1/templates/:id/submitSubmit the template to Meta for review.
/v1/developer/capabilitiesRead scopes, enabled features, and integration limits.
/v1/developer/onboardingRead the integration checklist and setup state.
/v1/developer/limitsRead rate limits and plan quotas.
/v1/developer/troubleshooting/errors/:codeLook up a known provider error.
Move leads, trigger automations, and reply to supported social comments.
/v1/pipeline/leadsList leads in the sales pipeline.
/v1/pipeline/leads/:idRead one lead with stage and conversation context.
/v1/pipeline/leads/:idUpdate lead fields from your CRM or app.
/v1/pipeline/leads/:id/stageMove a lead to a new stage.
/v1/pipeline/stagesList configured pipeline stages.
/v1/automationsList available automations.
/v1/automations/:idRead one automation.
/v1/automations/:id/triggerTrigger an automation explicitly.
/v1/commentsList tracked social comments.
/v1/comments/:idRead one tracked social comment.
/v1/comments/:id/replyReply to a supported social comment.
/v1/comments/settingsRead comment automation switches and keyword rules.
/v1/comments/settingsUpdate org-wide comment settings and rules. Add integration_id to a trigger rule to scope it to one connected page; requires automations:write.
Register POST /v1/webhooks once and InstantReply will push real-time events to your server. Deliveries are at least once, so process X-InstantReply-Delivery idempotently.
Your endpoint must accept POST JSON and return any 2xx status within 8 seconds. For local testing, expose localhost with a tunnel such as ngrok or Cloudflare Tunnel.
Call POST /v1/webhooks with a scoped key that has webhooks:write. Subscribe to exact events, *, or namespace wildcards such as message.*, conversation.*, contact.*, ticket.*, or template.*.
The response returns a whsec_ secret once. Store it immediately, verify every delivery, and use GET /v1/webhooks/:id/deliveries to debug status codes, retries, and failures.
Registering a webhook returns its whsec_ signing secret once, in that response body only — store it immediately; it is never shown again. Lost it? Delete the endpoint and register a new one. Verify X-InstantReply-Signature, formatted as sha256=<hex>, with HMAC-SHA256 over {timestamp}.{rawBody} before trusting the payload. Recent attempts are available at GET /v1/webhooks/:id/deliveries.
app.post("/webhooks/instantreply", express.raw({ type: "application/json" }), (req, res) => {
const timestamp = req.header("X-InstantReply-Timestamp")
const signature = req.header("X-InstantReply-Signature")
const rawBody = req.body.toString("utf8")
const signedPayload = timestamp + "." + rawBody
verifyHmacSha256(process.env.IR_WEBHOOK_SECRET, signedPayload, signature)
res.sendStatus(204)
})| Event | Fires when |
|---|---|
message.received | A customer sends a WhatsApp, Instagram, or Messenger message. |
message.sent | An outbound message lands from AI, dashboard, API, automation, or journey. |
conversation.created | A new conversation opens from inbound traffic, coexistence, or a journey. |
conversation.closed | A conversation is resolved manually or by automation. |
conversation.assigned | Ownership changes by manual assignment or routing rules. |
contact.updated | Lead extraction or CRM sync updates a contact. |
contact.opted_out | A contact opts out, for example by replying STOP, so your CRM can suppress them. |
contact.opted_in | A previously opted-out contact opts back in, for example by replying START. |
template.status_update | Meta reports a template review or quality status change. |
message.delivery_failed | A provider rejects or fails delivery after retries. |
ticket.created | InstantReply creates a support ticket from a handoff or review. |
ticket.updated | Ticket status, priority, or assignment data changes. |
ticket.assigned | Ticket ownership changes. |
ticket.closed | A support ticket is resolved. |
Template endpoints help teams ship compliant WhatsApp templates. Validate category fit, submit to Meta, inspect provider outcomes, and explain known delivery errors before a marketer has to guess.
Generated Swagger/OpenAPI output is available in non-production environments for internal validation. Production intentionally does not expose /openapi.json. Use this reference, the REST catalog, and the quickstart as the public developer surface.
A production integration is ready when these are true.