Documentation

OAuth & accounts

Connect Facebook Pages, Instagram business accounts, and X profiles to a tenant.

Supported networks

facebook, instagram, and x. Configure OAuth redirect URLs in the dashboard under OAuth redirects — they must match your Meta/X app settings.

Connect flow

  1. Start OAuth — POST /api/v1/social-networks/:network/auth-url with tenant_id and redirect_uri (where your app receives the user after connect).
  2. Redirect user — Open the returned auth_url in a browser.
  3. List pending pages — GET /api/v1/social-accounts/pending/:session using the session token from the redirect.
  4. Finalize — POST /api/v1/social-accounts/pending/:session/finalize with selectedPageIds.

Start OAuth

POST /api/v1/social-networks/instagram/auth-url

{
  "tenant_id": "ws_abc123",
  "redirect_uri": "https://yourapp.com/studio/channels/select"
}

→ { "success": true, "data": { "auth_url": "https://..." } }

List connected accounts

GET /api/v1/social-accounts?tenantId=ws_abc123

→ {
  "success": true,
  "data": [
    {
      "id": "acct_...",
      "platform": "instagram",
      "username": "yourbrand",
      "nickname": "Your Brand"
    }
  ]
}

Disconnect

DELETE /api/v1/social-accounts/:id revokes the connection and removes stored tokens for that account.