Instagram

Publish feed posts, reels, and carousels to Instagram via the PostPeer API.

Overview

Publish feed posts, reels, and carousels to Instagram through PostPeer's unified API. PostPeer handles the Instagram Graph API complexity, including the async media publishing flow.

Note: Instagram requires a Business or Creator account linked to a Facebook Page. PostPeer's OAuth flow handles this connection.

Quick Start

1. Connect an Instagram Account

curl https://api.postpeer.dev/v1/connect/instagram \
  -H "x-access-key: YOUR_API_KEY"

Returns an OAuth URL for Facebook/Instagram authorization. The user must have an Instagram Business Account linked to a Facebook Page.

2. Get the Account ID

curl https://api.postpeer.dev/v1/connect/integrations \
  -H "x-access-key: YOUR_API_KEY"

Find the integration with "platform": "instagram" and note the id.

3. Publish a Post

curl -X POST "https://api.postpeer.dev/v1/posts" \
  -H "x-access-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "New product launch! #startup #launch",
    "platforms": [
      { "platform": "instagram", "accountId": "ig_456" }
    ],
    "mediaItems": [
      { "type": "image", "url": "https://cdn.example.com/photo.jpg" }
    ],
    "publishNow": true
  }'

Response:

{
  "success": true,
  "status": "published",
  "postId": "post_def456",
  "platforms": [
    {
      "platform": "instagram",
      "success": true,
      "platformPostUrl": "https://www.instagram.com/p/ABC123/"
    }
  ]
}

Features

Feed Posts

Single image or video posts with captions and hashtags. Instagram requires at least one media item — text-only posts are not supported.

Reels

Upload short-form vertical videos as Instagram Reels:

curl -X POST "https://api.postpeer.dev/v1/posts" \
  -H "x-access-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Quick tutorial #reels",
    "platforms": [
      { "platform": "instagram", "accountId": "ig_456" }
    ],
    "mediaItems": [
      { "type": "video", "url": "https://cdn.example.com/reel.mp4" }
    ],
    "publishNow": true
  }'

Carousels

Create carousel posts with up to 10 images or videos by passing multiple mediaItems:

curl -X POST "https://api.postpeer.dev/v1/posts" \
  -H "x-access-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Swipe through our latest designs",
    "platforms": [
      { "platform": "instagram", "accountId": "ig_456" }
    ],
    "mediaItems": [
      { "type": "image", "url": "https://cdn.example.com/slide1.jpg" },
      { "type": "image", "url": "https://cdn.example.com/slide2.jpg" },
      { "type": "image", "url": "https://cdn.example.com/slide3.jpg" }
    ],
    "publishNow": true
  }'

Media Requirements

TypeFormatsAspect RatiosDuration
ImageJPG, PNG1:1, 4:5, 1.91:1
Video (feed)MP41:1, 4:53-60 seconds
Video (reel)MP49:163-90 seconds
CarouselJPG, PNG, MP41:1Up to 10 items

PostPeer validates media against these requirements before publishing.

On this page