AI92 פעיל - ההשקה הרכה הגלובלית שלנו בעיצומה: הפלטפורמה המלאה פתוחה ברחבי העולם למשך 30 הימים הראשונים.
תפריט תיעוד

תיעוד מפתחים זה זמין כרגע באנגלית בלבד. קוד והתנהגות API זהים בכל אזור.

Social Connections API

Connect a brand's social platforms over OAuth so the platform can post and read on its behalf. These endpoints mirror the campaign Connections hub into the API instance: list a brand's connected platforms, start an OAuth connect, and disconnect. All routes are served under /v1/social and proxy module-a's state-based OAuth flow.

Connecting is plumbing, so every endpoint here is free — no credits are charged. (The metered work is publishing, which is billed by the relevant publishing surface, not here.)

Authentication

Every request must carry a tenant API key as a Bearer token:

Authorization: Bearer ai92_live_<key>     # production
Authorization: Bearer ai92_test_<key>     # sandbox

OAuth 2.0 access tokens (Authorization: Bearer eyJ…) are also accepted. All routes are brand-scoped: brand_id is required and is verified against your account. Mutating requests support the Idempotency-Key header.

Credit costs at a glance

EndpointCost
GET /v1/social/statusFree
GET /v1/social/{platform}/initiateFree
POST /v1/social/{platform}/disconnectFree

GET /v1/social/status

Cost: Free

Per-platform connection status for a brand. Returns which social platforms are connected and the state of each.

Auth: Bearer (tenant key or OAuth token)

ParameterInTypeRequiredDescription
brand_idquerystringYesThe brand to inspect. Verified against the account.

Request

bash
curl "https://api.ai92.ai/v1/social/status?brand_id=b1f0…" \
  -H "Authorization: Bearer ai92_test_51a9c0de…"

Response 200 OK

json
{
  "brand_id": "b1f0…",
  "platforms": [
    { "platform": "instagram", "connected": true,  "account_name": "@acme", "connected_at": "2026-06-10T12:00:00Z" },
    { "platform": "facebook",  "connected": true,  "account_name": "Acme Corp", "connected_at": "2026-06-10T12:00:00Z" },
    { "platform": "linkedin",  "connected": false, "account_name": null, "connected_at": null }
  ]
}

Errors

StatusCodeWhen
404BRAND_NOT_FOUNDBrand not owned by the account.

GET /v1/social/{platform}/initiate

Cost: Free

Start an OAuth connect for a platform. Returns the provider auth_url (plus an opaque state) to open in the browser; module-a's public, state-based callback stores the connection for the brand once the user finishes the OAuth flow — no callback change is needed on your side.

Auth: Bearer

ParameterInTypeRequiredDescription
platformpathstringYesPlatform key (e.g. instagram, facebook, linkedin, x, tiktok).
brand_idquerystringYesThe brand to connect. Verified against the account.
redirect_urlquerystringNoWhere to send the browser after the connect completes.

Request

bash
curl "https://api.ai92.ai/v1/social/instagram/initiate?brand_id=b1f0…&redirect_url=https://app.acme.com/done" \
  -H "Authorization: Bearer ai92_test_51a9c0de…"

Response 200 OK

json
{
  "platform": "instagram",
  "auth_url": "https://www.facebook.com/v19.0/dialog/oauth?client_id=…&state=st_9f2a…",
  "state": "st_9f2a…"
}

Errors

StatusCodeWhen
404BRAND_NOT_FOUNDBrand not owned by the account.
422UNSUPPORTED_PLATFORMplatform is not a supported provider.

POST /v1/social/{platform}/disconnect

Cost: Free

Revoke and clear a brand's connection for a platform.

Auth: Bearer

ParameterInTypeRequiredDescription
platformpathstringYesPlatform key to disconnect.
brand_idquerystringYesThe brand to disconnect. Verified against the account.
reasonbodystring / nullNoOptional reason recorded with the disconnect.

Request

bash
curl -X POST "https://api.ai92.ai/v1/social/instagram/disconnect?brand_id=b1f0…" \
  -H "Authorization: Bearer ai92_test_51a9c0de…" \
  -H "Content-Type: application/json" \
  -d '{"reason": "rotating the connected account"}'

Response 200 OK

json
{ "platform": "instagram", "brand_id": "b1f0…", "disconnected": true }

Errors

StatusCodeWhen
404BRAND_NOT_FOUNDBrand not owned by the account, or no connection for the platform.