Skip to content
techrace/
TECHRACE DOCUMENTATION

Instagram

Connect Instagram professional accounts, publish images, read insights, and manage comments and messages.

Quick reference

PropertyValue
Platform valueinstagram
One connected accountOne Instagram professional (business or creator) account.
Text limit2,200 characters
SupportedOne JPEG image
FeaturesPosting ✓ · Analytics ✓ · Inbox ✓
Provider approvalMeta review; professional account
Login typeInstagram Login (separate Instagram app ID and secret)
TokenLong-lived (60 days), extended automatically before it expires

Before you start

The person connecting needs:

  • An Instagram professional account (Business or Creator). Personal accounts cannot connect.
  • While your Meta app is in Development mode: added as an Instagram tester, invite accepted.

You (the platform owner) need:

  1. In your Meta app add “Instagram API with Instagram Login”; copy the Instagram app ID and secret (different from the Facebook App ID).
  2. Request instagram_business_basic and instagram_business_content_publish.
  3. Business login settings → OAuth redirect URIs: https://YOUR_DOMAIN/auth/callback/instagram
  4. Add Instagram testers under App roles while in Development mode.

Permissions (scopes)

Techrace puts these permissions in the login link. The person approves them on the provider's own screen; only approved permissions are granted.

PermissionRequested by defaultUsed for
instagram_business_basicYesRead the profile and media
instagram_business_content_publishYesPublish images
instagram_business_manage_insightsOptionalInsights and breakdowns
instagram_business_manage_commentsOptionalRead, reply to, hide and delete comments
instagram_business_manage_messagesOptionalDirect messages

Connect an account

POST/api/v1/projects/{project_id}/connect-sessionsconnections:write

Create a connect link with provider "instagram" and send the person's browser to the returned url. return_url is the page in your app where they land afterwards (https, or http://localhost while testing).

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/connect-sessions" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "provider": "instagram",
  "return_url": "https://your-app.com/integrations/done"
}
EOF

After approval the person lands on your return_url with ?connected=instagram&customer_id=…&connection_id=…, or ?error=access_denied|expired|failed&provider=instagram. Your webhook also receives account.connected. Keep the connection_id: every call below uses it.

Publish a post

POST/api/v1/projects/{project_id}/executionsexecutions:write

Publish one JPEG image with a caption.

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/executions" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: unique-key-per-post" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "connection_id": "$CONNECTION_ID",
  "action": "publish",
  "input": {
    "content": "New menu this week ☕️",
    "media_ids": [
      "$MEDIA_ID"
    ]
  }
}
EOF
  • Publishing is asynchronous: the response has status queued. Poll GET /executions/{id} or subscribe to execution.succeeded / execution.failed.
  • Upload images or video first with POST /customers/{customer_id}/media and pass the returned media IDs in media_ids.
  • Re-sending the same Idempotency-Key never posts twice.
  • Caption up to 2,200 characters.
  • Exactly one JPEG image is required; text-only posts are not possible on Instagram.

Analytics

POST/api/v1/projects/{project_id}/analytics/queryanalytics:read
reportWhat it returns
summaryAccount summary for the period
dailyDaily account metrics (e.g. reach)
account_breakdownAccount metrics broken down (use breakdown)
media_breakdownMetrics for one post (content_id = the Instagram media ID, plus breakdown)
audienceFollower audience
lifetimeLifetime metrics for one post (content_id)
curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/analytics/query" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "connection_id": "$CONNECTION_ID",
  "report": "account_breakdown",
  "breakdown": "follow_type",
  "since": "2026-11-01",
  "until": "2026-11-07"
}
EOF
  • Needs instagram_business_manage_insights.

Comments and messages

POST/api/v1/projects/{project_id}/inbox/queryinbox:read

resource: media, comments, replies, conversations or messages.

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/inbox/query" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "connection_id": "$CONNECTION_ID",
  "resource": "comments",
  "media_id": "17890000000000000",
  "limit": 20
}
EOF
POST/api/v1/projects/{project_id}/inbox/operationsinbox:read + inbox:write

action: reply_comment, set_comment_hidden, delete_comment, reply_text, reply_image or mark_conversation_seen.

Limitations

  • Professional accounts only.
  • Publishing: one JPEG image per post. Video, carousels, Stories and Reels publishing are not supported.

Common errors

ErrorMeaningFix
instagram_basic_permission_requiredinstagram_business_basic was not granted.Reconnect and approve all permissions.
Invalid redirect_uri (Instagram screen)Callback not registered for Instagram Login.Add https://YOUR_DOMAIN/auth/callback/instagram in the Instagram product settings.
access_deniedThe person cancelled.Try again and approve.