External Accounts

Connect an External Account

Changed on

Starts an OAuth connection flow and returns an authorize_url where the user can connect an external account. LinkedIn supports personal profiles only, with scopes omitted. TikTok connects the authenticated user’s profile when scopes are omitted or company advertising assets with advertise. Meta Business and Snapchat support advertising connections only and require advertise. Personal profile connections must be completed in a browser signed in as the initiating Whop user.

post/external_accounts/connect

Request

  • Base URL: https://api.whop.com/api/v1
  • URL: https://api.whop.com/api/v1/external_accounts/connect
  • Auth: HTTP bearer

Headers

Idempotency-Keystring
Example:d9105228-4a08-46b1-8b91-42fed586d383

A unique key that makes this request safe to retry. See Idempotent requests.

Request body

account_idstring

The Account (biz_ identifier) to connect the external account for. An account-scoped API key may omit this to default to its own account. Omit for user profile connections.

platform'meta_business' | 'tiktok' | 'linkedin' | 'youtube' | 'snapchat' required

The platform to connect the external account on. Use meta_business to connect Meta Business assets, which is how Facebook Pages and Instagram accounts are connected — there is no separate instagram value. Use tiktok for TikTok accounts, snapchat for Snapchat Public Profiles, linkedin to connect the authenticated user’s LinkedIn profile, or youtube to connect their YouTube channel.

redirect_urlstring required

Where to send the user once they finish connecting their accounts. Any http or https URL. On success, the user is redirected with an external_account_connected query param naming the platform; if the connection fails, with an external_account_error query param instead. The same values also arrive as social_account_connected / social_account_error.

scopesstring[]

The connection purpose. For meta_business and snapchat, advertise is required and connects company advertising assets. For linkedin and youtube, omit scopes to connect the authenticated user’s profile; advertising is not supported. For tiktok, omit scopes to connect the authenticated user’s profile, or pass advertise to connect company advertising assets. Profile connections still request the platform permissions needed to read the profile.

Example request

{
  "account_id": "biz_xxxxxxxxxxxxxx",
  "platform": "meta_business",
  "redirect_url": "https://example.com/settings/social-accounts",
  "scopes": [
    "advertise"
  ]
}

Response

authorize url returned

authorize_urlstring required

The OAuth authorization URL to redirect the user to.

Example response

{
  "authorize_url": "https://www.facebook.com/v25.0/dialog/oauth"
}

Changes