Send messages
POST to the Instagram messaging endpoint with a Bearer token. The body uses the Messenger-style recipient / message shape, not the WhatsApp shape.
The basic call
Every send is a POST to ${INSTAGRAM_GRAPH_API_URL}/${INSTAGRAM_USER_ID}/messages with Authorization: Bearer ${INSTAGRAM_ACCESS_TOKEN} and a JSON body of the form { "recipient": { "id": "<igsid>" }, "message": { "text": "..." } }.
The recipient id is the Instagram-scoped sender id (IGSID) you read off the inbound webhook. For the full message-object reference see Meta's Instagram messaging docs.
curl example
Node/Express example
Verbatim from the webhook starter kit (src/providers/instagram.js). It reads whichever base-URL and account-id variables your env has (sandbox sets INSTAGRAM_API_URL + INSTAGRAM_ACCOUNT_ID; your own account sets INSTAGRAM_GRAPH_API_URL + INSTAGRAM_USER_ID), so the same code runs against both.
The 24-hour messaging window
You can reply within 24 hours of the user's last message.
Instagram enforces a standard messaging window. Outside the window, a plain text reply is rejected. Plan your flows to respond inside the window, or use a message tag where one applies.
Sandbox versus your own account
The sandbox proxy uses a different base URL and account-id key (INSTAGRAM_API_URL and INSTAGRAM_ACCOUNT_ID) than a real connected channel (INSTAGRAM_GRAPH_API_URL and INSTAGRAM_USER_ID). The request body shape is identical. See Sandbox for the sandbox env keys.
Next steps
- Receive Webhooks: Handle the inbound message and read the IGSID.
- Sandbox: Try the send flow end-to-end with a test account.