Developer docsCRM Gateway API reference Postman العربية

Private messages

Messenger and Instagram private messages share one shape. A conversation is one person talking to one account, and messages arrive in real time through Meta webhooks.

GET  /api/v1/conversations?status=open&assigned=unassigned&cursor=...
GET  /api/v1/conversations/{id}
GET  /api/v1/conversations/{id}/messages?cursor=...
POST /api/v1/conversations/{id}/messages   { "text": "..." }
POST /api/v1/conversations/{id}/messages   { "image": { "source": "upload", "uploadId": "0192..." } }
POST /api/v1/conversations/{id}/close
POST /api/v1/conversations/{id}/reopen
POST /api/v1/conversations/{id}/assign     { "userId": "0192..." }
{
  "id": "0192...", "platform": "facebook", "socialAccountId": "0192...",
  "participant": { "platformId": "7000...", "name": "Sara Ahmed", "username": null },
  "status": "open", "assignedUserId": null, "lastMessageAt": "2026-09-27T10:15:00Z",
  "lastMessagePreview": "Is it in stock?", "lastMessageInbound": true, "unreadCount": 1,
  "replyWindowEndsAt": "2026-09-28T10:15:00Z", "canReply": true,
  "botActive": true, "needsHuman": false, "lead": null,
  "ad": null, "fromPost": { "kind": "comment", "id": "1018_77001", "title": "شنط جلد بخصم 30%", "url": "https://www.facebook.com/1018_77001" }
}

ad: the ad the person wrote from (Messenger, Instagram, WhatsApp), with url when Meta sent its link. fromPost: the ordinary post (not an ad) the chat began from, { kind, id, title, url }, where kind is post (WhatsApp), comment (they commented and answered our private reply), shared_post (they sent an Instagram post) or story (they answered a story). Both are null when there is none.

The reply window

Meta allows replies for 24 hours after the customer's last message. After that the platform refuses the send straight away with messaging_window_closed (HTTP 409), before anything reaches Meta. replyWindowEndsAt and canReply tell you in advance.

Sending

Sending is asynchronous and returns 202 with an operationId and a messageId. When Meta accepts it you get social.message.sent. If it fails you get social.message.failed with the error code. A message is text or an image, not both. The limit is 2000 characters on Messenger and 1000 on Instagram.

Events

social.message.receivedNew private message from a customer
social.message.sentA reply left the account, from the platform or from Meta's own apps (origin = external).
social.message.failedA reply couldn't be sent
social.conversation.updatedA conversation was closed, reopened or reassigned

Delivery and read status (delivered, read) update the message itself and are not sent as separate events. Message text is deleted after the configured retention (retention.messages_days).

You need the messages:read scope to read and messages:write to reply, close and assign. On the Meta side the grant needs pages_messaging and instagram_manage_messages.