> ## Documentation Index
> Fetch the complete documentation index at: https://mcp.shipcontent.com/llms.txt
> Use this file to discover all available pages before exploring further.

---
title: Instagram
description: Connect a professional account, review immediate feed images, carousels, Reels and Stories, and read supported insights.
section: channels
order: 10
status: implemented
mode: both
reviewed: 2026-11-19
sources: [db/migrations/20261119T0400_agent_connected_account.sql, src/lib/mcp/agent-post-publish-tools.ts, src/lib/server/marketing/post-scheduled-instagram-adapter.ts, db/accounts.sql, db/publishing.sql, db/instagram.sql, src/lib/server/instagram/InstagramLifecycle.ts, src/lib/server/marketing/service.ts, docs/instagram-connection-contract.md, src/lib/server/auth/README.md, README.md, src/lib/server/instagram/instagram-agent-tools.ts, src/lib/server/instagram/InstagramOAuthProvider.ts, src/lib/server/instagram/instagram-readiness-provider.ts, src/lib/server/database/queries.ts, src/worker/MediaWorkerLoop.ts, src/lib/mcp/agent-tools.ts, src/lib/server/mcp/AgentMcp.ts, src/lib/instagram/auto-publish.ts, src/lib/marketing/marketing-drafts.ts, src/components/owner/post-review.tsx, src/lib/social/connect-path.ts, src/lib/server/social/connect-start.ts, src/lib/server/instagram/instagram-callback.ts, src/components/owner/channel-tiles.tsx, src/app/posts/review/page.tsx, src/app/[workspace]/(app)/marketing/page.tsx, src/components/owner/instagram-approval-panel.tsx, src/components/owner/instagram-destination-selector.tsx, src/lib/instagram/instagram-owner-publish.ts, src/lib/server/instagram/instagram-reel-media.ts, src/lib/server/instagram/InstagramReadinessCheck.ts, src/lib/media/video-inspection.ts, src/lib/instagram/instagram-readiness.ts, src/lib/server/storage/media.ts, src/lib/marketing/post-catalogue.ts, src/lib/marketing/post-scheduling.ts, src/lib/server/marketing/PostScheduling.ts, src/components/owner/post-schedule-controls.tsx, src/lib/server/instagram/InstagramScheduledPublication.ts, .env.example, src/app/integrations/[product]/[kind]/route.ts, src/lib/server/lifecycle/meta-lifecycle-route.ts, src/lib/server/lifecycle/meta-signed-request.ts, src/lib/server/lifecycle/MetaLifecycleCallback.ts, db/meta.sql, src/worker/InstagramPublicationWorker.ts, src/worker/TokenRefreshWorker.ts, src/lib/server/instagram/instagram-scheduled-media.ts, db/migrations/20261112T2015_instagram_trial_reels.sql, src/lib/instagram/trial-reel.ts, src/lib/server/instagram/trial-reels-access.ts, src/lib/server/marketing/marketing-post-digest.ts, src/lib/server/instagram/instagram-graph.ts, db/migrations/20261112T2130_agent_instagram_destination.sql, src/lib/server/instagram/instagram-approval-database.ts, src/lib/server/marketing/post-metrics-agent-tools.ts, src/lib/mcp/agent-post-metrics-tools.ts, src/lib/server/marketing/post-metric-mapping.ts, src/lib/server/instagram/instagram-metrics-reader.ts]
tools: [get_onboarding_status, start_instagram_connection, get_instagram_connection, list_instagram_connections, prepare_instagram_destination, prepare_instagram_readiness, get_instagram_readiness, prepare_instagram_approval, get_instagram_approval, publish_instagram_reel, edit_post, inspect_post, get_post, record_post_observation, prepare_post_schedule, get_post_schedule, publish_post, get_post_metrics, refresh_post_metrics]
next: [/docs/channels/tiktok-ads]
---


Publishing uses no credits. With plan enforcement on, a new owner or automatic-agent approval and each new container or publish request require publishing access. A queued job stops before the next provider write if that access ends. An accepted provider result can still be saved and read. Exact saved approval replays remain available. Updated October 16, 2026.

Instagram work is tied to one professional account and one exact saved post. The owner can publish a feed image, image carousel, Reel, image Story or video Story immediately. Updated 2026-11-19: with Publish, an agent can publish and schedule a Reel, a feed image and an image carousel through `publish_post` and `prepare_post_schedule`; `publish_instagram_reel` publishes a Reel only. Stories need the owner. The owner can also schedule a feed image or image carousel. An agent cannot select an account or give itself Publish permission.

## Connect

Call `start_instagram_connection` with a stable `requestId`. Give `connectionUrl` to the owner. The link is `/connect/instagram` with the saved request. The owner signs in if needed, and goes straight to Instagram. The link keeps the request bound to the agent grant. Resume with `get_instagram_connection` or `list_instagram_connections`. Credentials and OAuth state never appear in MCP output.

The owner can also start with **Connect** on the Connections page or in setup, without an agent. **Manage** disconnects. There is one open request per owner. When one exists, `start_instagram_connection` returns it, whoever started it. Revoking an agent cancels the open request of that agent. A request that the owner started does not depend on any agent.

Instagram access lasts about 60 days. The worker refreshes a connected token that expires in 30 days or less and is at least 24 hours old. It checks about every 6 hours. It acts as the owner who connected the account, and only while that owner is an active owner. While a refresh runs, the lifecycle status is `refreshing`. If the refresh fails and Instagram still accepts the saved token, the connection stays connected. The last refresh then shows `failed` with the code `INSTAGRAM_REFRESH_FAILED`, and the worker tries again at its next check. If the saved token no longer works, or the result is unclear, the owner must reconnect. If the worker cannot refresh the token for 60 days, the token expires and the owner must connect again. Updated October 14, 2026. The worker does not refresh the token while the owner's account access has ended. The connection stays connected. When access returns, the worker refreshes the token at its next check. If the token expired before then, the owner must connect again. Updated October 29, 2026.

The server checks Meta's returned grants. It keeps the exact digits of a numeric ID and compares them with the authenticated profile before it saves a connected status. If a connection result is unconfirmed, read its saved state. The owner can cancel that request and start a new one.

The post account selector shows each current connected account once. Pending or failed renewals do not add duplicate choices. Expired, disconnected or revoked access is not selectable. Connection management retains the request history.

For a published post, reconnecting the same Instagram account restores its name and selected account in the preview. The saved publication stays bound to its original connection. A draft requires an explicit account selection after reconnect. Updated October 12, 2026.

Stories use Image unless you select Video. A Story saved without an explicit media type uses the same Image default during publishing checks. Select Video before attaching a video Story.

## Insights access

In Connections, use **Enable insights** or **Renew insights** to grant `instagram_business_manage_insights`. The server checks the actual returned grant. Denied or failed insights renewal keeps an existing valid publishing connection. Insights access is optional for publication.

The dashboard reads supported per-media lifetime views, shares, reach and saves, plus supported likes/comments. Stories do not expose common likes/comments; missing values remain unavailable. A permission, access or provider failure preserves that post's previous successful metrics and shows its refresh error. An account access, permission or rate-limit failure stops further reads for that saved connection during the refresh. A Story-specific failure leaves other posts free to refresh. Posts from another saved connection can also refresh. Returned zero is zero. Stored permission is not proof that a metrics read succeeded.

Updated 2026-11-19: agents read these numbers with `get_post_metrics` and refresh them with `refresh_post_metrics`. Likes and comments need `instagram_business_basic`; without it the read fails and the row has `failure.code` `reconnect`. Views, shares, reach and saves need `instagram_business_manage_insights`; without it each value is `needs-permission`. The owner grants it with **Enable insights** or **Renew insights** in Connections. A Story has no likes, comments or saves (`unsupported-format`). See [Read post performance](/docs/workflows/metrics).

After reconnect, historical insights can use the current grant for the same workspace, Instagram account, product app and app-scoped identity. The server checks that grant again after the provider read. A disconnected or changed grant cannot return fresh metrics. Publication keeps its original connection checks. Updated October 12, 2026.

## Owner formats

Feed images use JPEG, at most 8 MB, with aspect ratio 4:5 through 1.91:1. Carousels contain 2 to 10 JPEG images in saved order; every child uses the feed-image limits. Mixed media carousels are unavailable. Image Stories use JPEG up to 8 MB; 9:16 is recommended. Video Stories use the Reel codec/container rules, with 3–60 seconds and aspect ratio 0.1:1 through 10:1. The app upload cap stays 50 MiB.

Story support in this app requires a current Business account. This is the app support rule; current Instagram Login documents do not establish a Meta restriction on Creator Stories. Story publication omits the caption and expires after 24 hours. A Story link or native expiry timestamp can be unavailable.

Owner approval binds the format, placement, workspace, destination, caption and ordered media IDs, kinds, sizes and SHA-256 values. Changes make that approval stale. Saved v1 Reel jobs keep their original payload. Every carousel child, parent and publish call has a durable intent. A lost reply stays unknown; a PUBLISHED container without a final media ID cannot become a confirmed delivery. Do not send it again. A confirmed native ID is saved before the optional native-result read; missing links stay unavailable.

## Draft and destination

Create or read a post draft with `create_post`, `edit_post`, `get_post`, and `inspect_post`. Attach saved media for a supported [owner format](/docs/channels/instagram#owner-formats) in the owner review flow. Call `prepare_instagram_destination` with the `postId`; the owner selects the connected destination at `/posts/review`.

## Readiness

With an active account grant, call `get_onboarding_status` before owner approval. Read `delivery.app.deploymentId`
and `delivery.worker.deploymentId` for the running releases. The worker status
must be `ready`. A missing or old heartbeat, or a disabled publication setup,
requires operator action before approval. This check does not inspect the
selected account or saved media.

Call `prepare_instagram_readiness` with the `postId` and give the review URL to the owner. Read `get_instagram_readiness` for the exact post. A passing result can become stale after draft, facts, media, account, credential, or authority changes. It does not approve publication or prove provider processing.

A failed video inspection includes `mediaIssue`: the failed `rule`, a plain `message`, the measured `actual` value when available, and the `expected` value. The result keeps this detail across reload and exact request replay. The owner sees the specific export action beside **Publish**. Server inspection failures identify the failed step and remain unconfirmed; they do not mean Instagram rejected the video. Server logs include the check and post IDs with the same bounded detail. File paths, raw process output and account credentials are excluded.

The provider check reads the authenticated account from Instagram, compares its professional account ID with the saved destination, and then checks the current publishing limit. An unconfirmed response cannot pass readiness.

## Trial Reels

Updated 2026-11-12. A trial Reel is an Instagram Reel that Instagram shows to non-followers first. Set `trialReel` on an Instagram Reel draft with `create_post` or `edit_post`, or select **Reel audience** in the post editor.

- `manual`: the owner shares the Reel with followers in the Instagram app.
- `performance`: Instagram shares the Reel with followers when it performs well.
- `off`: a normal Reel. This is the default.

The operator controls trial Reels with the server-only `SHIPCONTENT_INSTAGRAM_TRIAL_REELS_USERS` setting on the app server. It is a comma-separated list of owner UUIDs. `*` allows every owner. Unset, empty or a list with an invalid item allows no owner. The setting grants no other access. For an owner who is not on the list, `manual` and `performance` return `INVALID_INPUT` for that owner and for the owner's agents, and the post editor does not offer a trial Reel. `off` is always accepted. The setting controls only the selection. A trial value that is already saved stays on the post, a duplicate of that post keeps it, and the post still publishes as a trial Reel. The post editor shows **Reel audience** for such a post, with the saved value and **Normal Reel**.

Only an Instagram Reel accepts a trial value. Another channel or format returns `INVALID_INPUT`. A change of channel or format clears the value. A duplicate keeps the value only when the new draft is also an Instagram Reel.

The trial value is part of the checked content, of the owner review digest and of the approval manifest (`manifest.trialReel`). A multi-platform Publish or Schedule from the post editor sends the trial value that the owner sees on each version. When the saved value is different, the server returns `CONTENT_CHANGED` and sends nothing. A change after a readiness check needs a new check. A change after approval makes that approval stale. Owner publication, `publish_instagram_reel` and a Reel schedule all send the approved value. ShipContent sends a trial Reel without the share-to-feed option.

Instagram decides which accounts can publish a trial Reel. If Instagram refuses the container request, the job ends as `unknown` and ShipContent sends no publish request for it. ShipContent cannot share a trial Reel with followers; the owner does that in the Instagram app. No controlled live delivery of a trial Reel is recorded for this feature.

## Approval and publication

Call `prepare_instagram_approval` after a passed readiness request. It returns the saved manifest hash and owner review URL. The link opens the post in Marketing → Posts with the app navigation. The signed-in owner reviews the caption, media and account, then selects **Publish**. That click runs a current readiness check and queues the exact saved post. It needs no extra confirmation checkbox. A failed check shows a plain action message and queues no job. The server execution deadline is unchanged. `get_instagram_approval` reports the approval and job state; its `executionAvailable: true` flag means the worker path exists, not that Instagram accepted a post. Withdrawal revokes authority but cannot prove that an in-flight provider call was cancelled. An unknown outcome must be reconciled, not retried as a new publication.

Updated 2026-10-13. A job is `unknown` only when a container or publish request may have reached Instagram and its result is not known. A failure before that request, for example while the media is staged, is `failed`: nothing was posted, and a new draft can be published. The saved failure keeps the exact internal error code for support.

## Automatic publishing

Updated 2026-11-07: the owner enables Publish for this agent at `/oauth/consent` (a box) or in Agents (**Allow** in the **Publish social posts** row), with the typed confirmation `allow agent`. One decision covers all channels in all owned workspaces. Publishing one reviewed post does not grant Publish.

Each post has a publish mode, `review` or `automatic`. Set it from the user's instruction with `publishMode` in `create_post` or `edit_post`. Use `review` when the user did not say. The owner can change it on the review page. An agent cannot change the owner's `review` to `automatic` (`PUBLISH_MODE_LOCKED`). To publish a Reel without any owner step, set `channel: "instagram"` and `format: "video"` with `create_post` or `edit_post`. `publish_instagram_reel` and `prepare_post_schedule` then use the connected account.

With that permission and an `automatic` post, call `publish_instagram_reel` with the `postId` and a stable `requestId`. One call runs an exact-post readiness check, saves an approval with `approvedBy: "agent_publish"`, the same manifest hash, and one queued job. The same worker publishes the Reel once under the saved execution deadline. Otherwise the tool saves nothing and returns `mode: "owner_review"` with `review.url`. `reason` is `post_requires_review` or `publish_off`. `list_workspaces.access.canPublish` shows the permission.

Updated 2026-11-12. A workspace has one connected Instagram account at most. With Publish and an `automatic` Reel draft, `publish_instagram_reel` and `prepare_post_schedule` use that account before their check. The owner does not have to select it for each post. The call saves the account on a draft that names none. A draft that names an earlier connection of the same Instagram account moves to the current connection. A draft that names the connected account stays as it is.

`DESTINATION_REQUIRED` has three causes: the post is not an Instagram Reel, no connected account is ready, or the post names a different Instagram account. For an account that is not ready, the owner connects it again. A draft that already names the connected account does not get this code: when that account is not ready, the check returns `INSTAGRAM_DESTINATION_UNAVAILABLE`, and the owner connects the account again. For a different account, the owner selects the account on the review page. `INSTAGRAM_VIDEO_REQUIRED` means that the Reel does not have exactly one saved video.

Without Publish, or for a `review` post, the agent selects nothing: the owner selects the account on the review page, or through `prepare_instagram_destination`. Updated 2026-11-19: `publish_post` and `prepare_post_schedule` also use the connected account for an `automatic` image or carousel. A story keeps the owner's selection.

Turning off Publish prevents new agent publication and keeps queued and scheduled work. Disconnecting the agent revokes its account grant and cancels unsent work in all workspaces. Disconnecting Instagram or ending account access also stops new provider work. A provider call that already started can still finish; keep its evidence and do not send a second call.

## Limits

ShipContent has no daily publishing limit. The Instagram content publishing limit still applies.

Disconnect cancels a publication only while it is untouched in the queue. It keeps started, published, and unknown job evidence. A disconnect cannot undo a provider request that already started.

## Evidence

Read the final job state and provider receipt. Do not describe a queued or running job as published. `record_post_observation` can store sourced manual follow-up data for a delivered post; it is distinct from a provider receipt. Customer publication and repeatability remain separate acceptance checks.

## Scheduled delivery

The owner checks the exact saved content and destination, then confirms its time in the [post editor](/docs/workflows/post-draft#automatic-schedules). An agent with Publish can save an automatic post schedule through `prepare_post_schedule`; otherwise the owner confirms the proposed time. A scheduled Reel uses the connected account as in [Automatic publishing](/docs/channels/instagram#automatic-publishing). Scheduled work uses the existing provider worker, current account/media checks and durable recovery. A planned date never publishes.

Updated 2026-10-28. Scheduled Instagram posts are always available for a connected account. No operator flag controls them. A linked job keeps its existing recovery path. See [scheduling errors](/docs/contracts/errors#scheduling-errors).

Updated 2026-10-16. Scheduled delivery supports one Reel MP4 under the current inspection limits, one feed image, and an image carousel. Updated 2026-11-19: an agent with Publish can schedule a Reel, an image or a carousel; before, only the owner could schedule an image or carousel. A schedule keeps the digest of every saved image. At the due time the worker reads each image again and publishes only if every digest matches. Stories cannot be scheduled or published automatically by an agent.

## Provider callbacks

Updated 2026-10-12. Register two URLs in the Instagram app settings, on the owner host. Meta sends a signed POST to each URL.

- Deauthorize callback: `https://<owner-host>/integrations/instagram/deauthorize`
- Data deletion request URL: `https://<owner-host>/integrations/instagram/data-deletion`

ShipContent checks the signature with the Instagram app secret only. No other product secret can replace it. Meta documents this signed request for Facebook. A live Instagram delivery on 2026-10-13 confirmed that the Instagram callbacks use the same format, signed with the Instagram app secret. A request with a wrong signature, product or format gets `400` `INVALID_SIGNED_REQUEST` and changes nothing. Missing app settings give `503` `LIFECYCLE_NOT_CONFIGURED`. A storage fault gives `503` `LIFECYCLE_UNAVAILABLE`, and Meta can retry. Other methods give `405`.

**Deauthorize** removes local access for the verified Instagram account in this app. It covers every workspace and owner that saved this connection. It stops publications that have not started. It keeps posts, metrics and history. A request already in flight can still save its result, but it cannot restore access. An older callback does not disconnect a newer connection or cancel a newer connection request. A token refresh does not make a connection newer. An unknown Instagram account gets `200`. Native posts and Meta consent stay unchanged.

**Data deletion** returns `url` and `confirmation_code`. The URL opens the neutral status page `/data-deletion/{token}` on the owner host. ShipContent erases the provider copies for every owner that saved this connection. The page shows Completed only when all owners are done. The link expires 30 days after the last owner completes. Owner uploads, drafts and business facts stay. A repeated request returns a new link for the same work and never starts a second erasure.

Updated 2026-10-13: the Instagram callbacks match either the Instagram-scoped user ID or the professional account ID of a saved connection, in the configured Instagram app only. Removing the app in Instagram settings makes Meta send both a deauthorize and a data-deletion request. ShipContent then erases the provider data for that account. Owner content stays.

Set `SHIPCONTENT_INSTAGRAM_APP_ID`, `SHIPCONTENT_INSTAGRAM_APP_SECRET`, `SHIPCONTENT_OWNER_ORIGIN` and `SHIPCONTENT_META_LIFECYCLE_DATABASE_URL`. The origin builds the status URL; the request Host is never used. Live Meta delivery to these URLs was verified on 2026-10-13.
