Channels

Instagram

Receive direct messages on your Instagram accounts and answer them.

What you can do

  • Receive the direct messages people send your Instagram professional accounts, in your inbox and as message.received events.
  • Answer them with text, quick replies, media, reactions or cards.

Before you start

An owner or admin connects the account in the dashboard, by signing in with Instagram or through a Facebook Page linked to it. An account connected to another workspace is refused.

Instagram allows a message only to someone who wrote to you:

  • Within 24 hours of their last message, anything goes.
  • After that, only a person signed in to your inbox may reply, until 7 days have passed. An API key cannot.
  • Nobody who has not written can be messaged, so there are no Instagram campaigns.

Receive

Text, story replies, story mentions, shares, reactions, postbacks and read receipts land in your inbox on the instagram channel, and your webhook endpoints receive message.received.

  • Each person who writes becomes a contact with no phone. Their Instagram-scoped id is their identity, and the contact address of their thread.
  • A file they send is downloaded when it arrives, since Instagram's links expire, and served at a signed link the message holds.

Send

Reply to the person's Instagram-scoped id:

curl https://v3.ghala.io/v1/messages \
  -H "Authorization: Bearer $GHALA_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: thread-880000000000001-reply-1" \
  -d '{"channel": "instagram", "to": "880000000000001", "type": "text", "text": "Karibu"}'
POST/v1/messagesSend messagemessages:send
  • to is one person's Instagram-scoped id. One recipient per send.
  • from is the account, by its id from GET /v1/channels/instagram or its Instagram id. Leave it out when your workspace has one account.
  • type is text (1 to 1,000 bytes), quick_replies, image, video, audio, file, reaction or cards. Every limit is checked before anything goes to Instagram, and a refusal names the field.

The answer is 201 with {"status": "sent", "channel": "instagram", "messages": [...]}. You can also answer in the thread with Inbox and replies.

Each message is priced at your workspace's Instagram rate. A send Instagram refused is not charged.

Statuses

Instagram reports read when the person opens your message. See Message statuses.

Test mode

Instagram has no sandbox. A test key is refused with not_configured: "instagram has no sandbox; send with a live key".

When it fails

StatuscodeWhen
400missing_field on fromyour workspace has several accounts and from did not say which
400invalid_value on tomore than one recipient
400not_configureda test key, or no Instagram rate is set for your workspace
402insufficient_fundsyour wallet cannot pay for the message
409instagram_window_closedoutside Instagram's window, or the person has not written
409instagram_account_disconnectedno connected account, or not the one in from
502instagram_send_failedInstagram did not take the message

All endpoints

On this page