Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.social-api.ai/llms.txt

Use this file to discover all available pages before exploring further.

Available Managed connector - SocialAPI handles the Meta App and platform app review for you. No customer-side Meta for Developers registration required. See Platform credentials.

At a glance

FieldValue
Platform sluginstagram
Auth typeOAuth 2.0 (Meta)
APIMeta Graph API
Best forLargest reach for visual brands; full inbound and outbound surface.

Capabilities

FeatureSupportedNotes
List postsYesReturns posts, reels, carousels
CommentsYesScoped to a specific post
Reply to commentYes
Private replyYesSends a DM to the commenter
Comment replies (thread)Yes
Moderate comment (hide/unhide/delete)Yes
Toggle post commentsYes
DMsYes
Send DMYes
Get DM thread by userYes
ReviewsNoInstagram has no review feature
MentionsYes
Create postYesImages, videos, reels, carousels
Delete postYes

Connecting

curl -X POST https://api.social-api.ai/v1/accounts/connect \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "instagram",
    "metadata": {
      "redirect_uri": "https://app.example.com/oauth/callback"
    }
  }'
Response:
{
  "auth_url": "https://www.instagram.com/oauth/authorize?client_id=...&state=...",
  "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2"
}
Redirect your user to auth_url. After they authorize, Instagram redirects to your redirect_uri with ?code=...&state=.... Then call:
curl -X POST https://api.social-api.ai/v1/oauth/exchange \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "instagram",
    "code": "AQDtbPB9X...",
    "metadata": {
      "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2",
      "redirect_uri": "https://app.example.com/oauth/callback"
    }
  }'

Reading samples

List posts

curl "https://api.social-api.ai/v1/accounts/{id}/posts?limit=10" \
  -H "Authorization: Bearer $SOCAPI_KEY"
Sample response:
{
  "data": [
    {
      "id": "17895695668004550",
      "platform": "instagram",
      "caption": "Hello world #socapi",
      "media_type": "IMAGE",
      "media_url": "https://scontent-...",
      "permalink": "https://www.instagram.com/p/ABC123/",
      "timestamp": "2026-03-01T12:00:00Z",
      "like_count": 42,
      "comments_count": 5,
      "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J"
    }
  ],
  "count": 1
}

List comments on a post

Comments are scoped to a specific post. Use the post id from the response above:
curl "https://api.social-api.ai/v1/accounts/{id}/posts/17895695668004550/comments?limit=10" \
  -H "Authorization: Bearer $SOCAPI_KEY"
Sample response:
{
  "data": [
    {
      "id": "sapi_cmt_aW5zdGFncmFtOjE3ODQxNDA1NzkzMTg3MjE4",
      "platform": "instagram",
      "type": "comment",
      "author": {
        "id": "17841405793187218",
        "name": "Jane Smith",
        "avatar_url": "https://example.com/avatar.jpg"
      },
      "content": {
        "text": "Love this product!",
        "media": []
      },
      "metadata": {
        "post_id": "17895695668004550"
      },
      "created_at": "2026-02-15T14:30:00Z",
      "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
      "platform_id": "17841405793187218"
    }
  ],
  "count": 1
}

List DMs

curl "https://api.social-api.ai/v1/accounts/{id}/dms?limit=10" \
  -H "Authorization: Bearer $SOCAPI_KEY"
Sample response:
{
  "data": [
    {
      "id": "sapi_dm_aW5zdGFncmFtOnQxNzg0MTA1NzkzMTg3MjE4",
      "platform": "instagram",
      "type": "dm",
      "author": {
        "id": "17841405793187218",
        "name": "Jane Smith",
        "avatar_url": "https://example.com/avatar.jpg"
      },
      "content": {
        "text": "Hi, I have a question about my order",
        "media": []
      },
      "metadata": {
        "thread_id": "t_17841405793187218"
      },
      "created_at": "2026-02-15T15:00:00Z",
      "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
      "platform_id": "t_17841405793187218"
    }
  ],
  "count": 1
}

Publishing

Create an Instagram post with optional platform-specific fields:
curl -X POST https://api.social-api.ai/v1/posts \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_ids": ["acc_01HZ9X3Q4R5M6N7P8V2K0W1J"],
    "text": "Hello world #socapi",
    "media_ids": ["https://cdn.example.com/photo.jpg"],
    "platform_data": {
      "instagram": {
        "alt_text": "A product photo showing our new widget",
        "share_to_feed": true
      }
    }
  }'
For the full field reference, media constraints, and error recovery, see Instagram posts.

Limitations and gotchas

  • Private replies. Replying to a comment with "private": true sends a DM to the commenter. This is Instagram’s native “Send Private Reply” feature, not a SocialAPI workaround.
  • Token expiry. Instagram access tokens can expire. If you receive 401 with code: "invalid_token", reconnect the account using the OAuth flow.
  • Account fields. See the shared account object reference for the fields returned by /v1/accounts.

Permissions

  • Permissions. SocialAPI’s managed Meta App already requests these scopes on your behalf: instagram_business_basic, instagram_business_manage_comments, instagram_business_manage_messages, instagram_business_content_publish. You don’t need to apply for any platform app review. See Platform credentials.