Instagram

Instagram API: Post Photos and Videos

How to post a photo or video to Instagram programmatically with the PostGate API — one request, any professional account.

Quick answer

To post a photo to Instagram via API, send one POST /api/posts request with the connected Business or Creator profile, a publicly fetchable HTTPS media URL, and a body — PostGate collapses Instagram’s native container-then-publish flow into that single call. The 202 response is acceptance; the published target with Instagram’s media ID and permalink appears once delivery finishes.

If you already know Instagram publishing requires a professional account and a two-step container flow, and you just want the shortest correct request, this is that page. No background on Meta's app review, no history of the Graph API — one request that posts a photo to Instagram through PostGate, and what the response actually contains.

01

What does the request look like?

PostGate collapses Instagram's native container-then-publish flow into one call. Pass the profile you connected, a media URL, and a body. PostGate creates the container, polls it, and publishes it on Instagram's side — you send one request and get one response.

Post a photo to InstagramPostGate API
curl -X POST "https://api.postgate.studio/api/posts" \
  -H "Authorization: Bearer $POSTGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ig-post-launch-001" \
  -d '{
    "post": { "body": "New drop, live now." },
    "profiles": ["pro_instagram123"],
    "media": ["https://cdn.example.com/product.jpg"]
  }'
02

What comes back in the response?

A 202 with the post ID and an initial aggregate status of processing — this is acceptance, not confirmation that Instagram published anything yet. The real answer lives in the targets array once delivery finishes: a published target carries Instagram's own media ID and permalink. Poll GET /api/posts/{id} or subscribe to the post.published webhook instead of assuming the request itself was the finish line.

03

What are the two things that block this request?

The connected account must be an Instagram Business or Creator profile — see why personal accounts don't work. And the media URL must be publicly fetchable over HTTPS at request time; Instagram's servers pull it directly, so a URL behind auth or a signed link that expires in seconds will fail container creation.

04

Should I send an Idempotency-Key for a one-off post?

It costs one header and prevents the one failure mode that actually matters here: a client timeout followed by an automatic retry that posts the same photo twice. Reuse the same key on retry and PostGate returns the original post instead of creating a second one — see idempotency & safe retries.

Frequently asked questions

Why does my Instagram media URL fail container creation?

The media URL must be publicly fetchable over HTTPS at request time — Instagram’s servers pull it directly, so a URL behind auth or a signed link that expires in seconds will fail container creation.

Does a 202 response mean my Instagram post is live?

No. The 202 with a post ID and an initial aggregate status of processing is acceptance, not confirmation that Instagram published anything yet. The real answer lives in the targets array once delivery finishes: a published target carries Instagram’s own media ID and permalink. Poll GET /api/posts/{id} or subscribe to the post.published webhook.

Do I need an Idempotency-Key for a single Instagram post?

Yes — it costs one header and prevents the one failure mode that actually matters: a client timeout followed by an automatic retry that posts the same photo twice. Reuse the same key on retry and PostGate returns the original post instead of creating a second one.

Can a personal Instagram account be the publishing destination?

No. The connected account must be an Instagram Business or Creator profile — that account-type requirement and a media URL that isn’t publicly fetchable are the two things that block this request.

Build it with PostGate

One API for every social platform your customers care about — sandboxed, documented, and ready today.

Start building Read the docs