Skip to content

REST API v1 · Resource

Instagram

Instagram messages, posts, comments and insights.

API reference · Instagram

Endpoints

Paths are relative to https://fliok.com/api/v1. Each endpoint names the scope and the lowest key role it needs; a key without them gets 403 (see Authentication). The Instagram endpoints answer for a workspace once the feature is set up for it.

Instagram is a paid add-on on the Basic plan and up. Until your workspace has it, every /instagram endpoint answers 402 instagram_addon_required, with offer saying what the workspace owner can buy in Plan & billing (add_addon or upgrade_plan). Once it is set up and your Instagram professional account is connected in Integrations, these endpoints run the same code as the dashboard — the same roles, rules and limits. Reads need any key; replying, hiding and drafts need the agent role; scheduling, publishing and cancelling need admin.

  • Replies only inside 24 hours. Instagram lets a business answer within 24 hours of the customer’s last message, and that is the only window: Instagram’s Human Agent tag (longer replies by a person) isn’t enabled for Fliok. POST /instagram/send answers 422 outside_24h_window after 24 hours.
  • Posts take photos by URL. POST /instagram/media downloads a JPEG (up to 8 MB) from a public https:// address into your workspace and checks its shape for the post type; private and internal addresses are refused. Reels need a video, which you upload in the dashboard.
  • Nothing permanent from the API. Comments can be answered in public and hidden (reversibly); deleting a comment, and Instagram ads, stay in the dashboard.

Instagram

13
  • GET/instagram/conversationsInstagram Direct chats, cursor-paginated, with whether the 24-hour reply window is openScope instagram:read · viewer role or higher
  • GET/instagram/conversations/{id}/messagesOne Instagram chat and its messages, newest firstScope instagram:read · viewer role or higher
  • POST/instagram/sendReply in an Instagram chat — only within 24 hours of the customer’s last messageScope instagram:write · agent role or higher
  • POST/instagram/mediaGive Fliok a JPEG by public https:// URL for a post; returns a mediaIdScope instagram:write · agent role or higher
  • GET/instagram/postsPosts written in Fliok: drafts, scheduled, published, failed, cancelledScope instagram:read · viewer role or higher
  • POST/instagram/postsSave a draft, schedule a post, or publish now (admin keys) from your mediaIdsScope instagram:write · agent role or higher
  • GET/instagram/posts/recentThe account’s own published posts on Instagram, live, with likes and commentsScope instagram:read · viewer role or higher
  • GET/instagram/posts/{id}One Fliok post — poll it for published or failedScope instagram:read · viewer role or higher
  • POST/instagram/posts/{id}/cancelCancel a scheduled post before it goes out (admin keys)Scope instagram:write · agent role or higher
  • GET/instagram/commentsComments and @mentions, filtered by needs_reply, all, mentions or hiddenScope instagram:read · viewer role or higher
  • POST/instagram/comments/{id}/replyReply in public under a commentScope instagram:write · agent role or higher
  • POST/instagram/comments/{id}/hideHide a comment from everyone but its author, or show it againScope instagram:write · agent role or higher
  • GET/instagram/insightsAccount summary for 7, 28 or 90 days: followers, views, reach, engagement, top postsScope instagram:read · viewer role or higher

Examples

Read your Instagram inbox

curl "https://fliok.com/api/v1/instagram/conversations?limit=20" \
  -H "Authorization: Bearer wa_YOUR_API_KEY"

curl "https://fliok.com/api/v1/instagram/conversations/9f1c2b7e-5d1a-4c3e-9b0a-2f6d8e7c1a44/messages?limit=50" \
  -H "Authorization: Bearer wa_YOUR_API_KEY"

Reply to an Instagram message

curl -X POST https://fliok.com/api/v1/instagram/send \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: dm-riya-1042" \
  -d '{ "conversationId": "9f1c2b7e-5d1a-4c3e-9b0a-2f6d8e7c1a44", "text": "Yes! Size M and L are in stock." }'

Schedule a post

# 1. Hand Fliok the photo: a JPEG at a public https:// address, up to 8 MB
curl -X POST https://fliok.com/api/v1/instagram/media \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://cdn.example.com/diwali-lamps.jpg", "for": "image" }'
# -> 201 { "media": { "mediaId": "instagram-posts/…/1b2c….jpg", "size": 412233, "mime": "image/jpeg",
#          "kind": "image", "width": 1080, "height": 1350 }, "hints": [] }

# 2. Schedule it (admin key). action: draft | schedule | publish
curl -X POST https://fliok.com/api/v1/instagram/posts \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "image",
    "caption": "Diwali lamps are back in stock ✨",
    "media": ["instagram-posts/…/1b2c….jpg"],
    "action": "schedule",
    "scheduledAt": "2026-10-20T18:30:00+05:30"
  }'

# 3. Changed your mind?
curl -X POST https://fliok.com/api/v1/instagram/posts/3e7a…/cancel -H "Authorization: Bearer wa_YOUR_API_KEY"

Answer comments

curl "https://fliok.com/api/v1/instagram/comments?filter=needs_reply&limit=20" \
  -H "Authorization: Bearer wa_YOUR_API_KEY"

curl -X POST https://fliok.com/api/v1/instagram/comments/6c2d…/reply \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "text": "₹1,499 — DM us to order!" }'

curl -X POST https://fliok.com/api/v1/instagram/comments/8e1f…/hide \
  -H "Authorization: Bearer wa_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "hidden": true }'

Read insights

curl "https://fliok.com/api/v1/instagram/insights?days=28" -H "Authorization: Bearer wa_YOUR_API_KEY"

Rate limits

The buckets these endpoints use. Burst is how many requests you can make back-to-back from a full bucket; sustained is how fast it refills.

BucketEndpointsBurstSustained
Reads/messages · /conversations · /contacts · /templates · /phone-numbers · GET /webhooks · Instagram reads · GET /payment-requests/{id}60060 / sec
Instagram replyPOST /instagram/send12030 / sec
Instagram commentsPOST /instagram/comments/{id}/reply · /hide (each its own bucket)601 / sec
Instagram postsPOST /instagram/posts · POST /instagram/posts/{id}/cancel601 / sec
Instagram mediaPOST /instagram/media301 / 2 sec
Instagram live postsGET /instagram/posts/recent301 / 2 sec

Every limit, the RateLimit-* headers and what to do on a 429: Rate limits.