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> # sandboxOAuth 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
| Endpoint | Cost |
|---|---|
GET /v1/social/status | Free |
GET /v1/social/{platform}/initiate | Free |
POST /v1/social/{platform}/disconnect | Free |
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)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
brand_id | query | string | Yes | The brand to inspect. Verified against the account. |
Request
curl "https://api.ai92.ai/v1/social/status?brand_id=b1f0…" \
-H "Authorization: Bearer ai92_test_51a9c0de…"Response 200 OK
{
"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
| Status | Code | When |
|---|---|---|
404 | BRAND_NOT_FOUND | Brand 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
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
platform | path | string | Yes | Platform key (e.g. instagram, facebook, linkedin, x, tiktok). |
brand_id | query | string | Yes | The brand to connect. Verified against the account. |
redirect_url | query | string | No | Where to send the browser after the connect completes. |
Request
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
{
"platform": "instagram",
"auth_url": "https://www.facebook.com/v19.0/dialog/oauth?client_id=…&state=st_9f2a…",
"state": "st_9f2a…"
}Errors
| Status | Code | When |
|---|---|---|
404 | BRAND_NOT_FOUND | Brand not owned by the account. |
422 | UNSUPPORTED_PLATFORM | platform is not a supported provider. |
POST /v1/social/{platform}/disconnect
Cost: Free
Revoke and clear a brand's connection for a platform.
Auth: Bearer
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
platform | path | string | Yes | Platform key to disconnect. |
brand_id | query | string | Yes | The brand to disconnect. Verified against the account. |
reason | body | string / null | No | Optional reason recorded with the disconnect. |
Request
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
{ "platform": "instagram", "brand_id": "b1f0…", "disconnected": true }Errors
| Status | Code | When |
|---|---|---|
404 | BRAND_NOT_FOUND | Brand not owned by the account, or no connection for the platform. |