Skip to content

Instagram

Instagram publishing uses the official content publishing API: create a media container, wait until its status is finished, then publish. Nothing is posted by automating instagram.com. Direct messages are not requested and are not sent.

Checked against Meta’s docs for content publishing and the publishing limit.

Kind Rule
Image One JPEG, up to 8 MB
Reel One MP4 or MOV, from 3 seconds to 15 minutes, up to 1 GB. It can also appear on the main feed unless you turn that off.
Carousel 2 to 10 images or videos. A video inside a carousel can be up to 60 seconds. A carousel counts as one publish.

Captions can be 2,200 characters and at most 30 hashtags.

The account must be a professional account (Business or Creator). A personal account cannot publish. Switch the profile in the Instagram app, then reconnect.

Before each publish, the product reads content_publishing_limit. When usage reaches the total, the post waits. That quota is a rolling window, usually 24 hours. Creating containers has a separate limit. If publish times out or the response is unclear, the attempt is marked uncertain and is not published again.

Instagram’s servers download the file from a public https link. The product builds that link from MEDIA_PUBLIC_ORIGIN and a signed /media/pull/{token} path. Bytes are not uploaded to Instagram from this server. If the public origin is missing or is not https, publish fails before any container is created.

  1. Open developers.facebook.com/apps and create an app.
  2. The default login is Instagram Login. Add Instagram and API setup with Instagram login. For a Page-linked account, use Facebook Login for Business and set INSTAGRAM_LOGIN_MODE=facebook on the server.
  3. Add the redirect URI exactly: {APP_PUBLIC_ORIGIN}/api/connect/instagram/callback.
  4. Request instagram_business_basic and instagram_business_content_publish. Do not add message permissions. Facebook Login uses instagram_basic, instagram_content_publish, pages_show_list, and pages_read_engagement, and publishes with the Page token.
  5. Put the app id and secret in INSTAGRAM_CLIENT_ID and INSTAGRAM_CLIENT_SECRET.
  6. Set MEDIA_PUBLIC_ORIGIN and MEDIA_SIGNING_KEY (at least 16 characters). Instagram must be able to download the file without a login and without a redirect.
  7. Set INSTAGRAM_HTTP_ALLOW_NETWORK=1 only on the server that may call Instagram. Set INSTAGRAM_GRAPH_VERSION if your app is not on the default Graph version.

A short-lived token is exchanged for a long-lived token of about 60 days. Refresh extends a token that is still valid. Comments and replies are not part of this connection. See Inbox and listening.