Get social network authentication URL

Generate an OAuth authentication URL for connecting a social media account.

Generate an OAuth authentication URL for connecting a social media account. This endpoint returns a URL that you should redirect users to in order to authenticate and authorize your application to access their social media account.

Prerequisites:

  • The social network must be configured for your organization using the POST /v1/social-networks endpoint
  • You must have valid OAuth credentials (client_key and client_secret) stored for the specified network

Workflow:

  1. Ensure the social network is configured for your organization
  2. Call this endpoint to get the authentication URL (optionally include tenant_id to associate accounts with your end-users)
  3. Redirect the user to the returned auth_url
  4. The user will authenticate on the social network's platform
  5. The user will be redirected back to your specified redirect_uri (or default)
  6. Handle the OAuth callback to complete the account connection

Tenant ID: Optionally provide a tenant_id to associate the connected social account with a specific tenant/customer in your system. This enables filtering social accounts by tenant using GET /v1/social-accounts?tenantId=xxx. The tenant_id must contain only alphanumeric characters, underscores, and hyphens.

Redirect URI: If you provide a redirect_uri in the request body, it is the final application destination after Outstand completes the connection, not the OAuth callback registered with the provider. For YouTube BYOK, configure oauth_callback_url on the credential separately. If redirect_uri is omitted, the user returns to the Outstand dashboard.

Connecting multiple accounts on the same network: Most networks skip the authorization screen and silently re-use the account already signed in on the user's browser session. That means a user connecting their second account can end up re-authorizing the first one, with logging out of the network as the only workaround. Set force_account_selection: true to always show the authorization / account-selection screen. It is honoured by tiktok, facebook, instagram, youtube and google_business, and ignored by networks that expose no equivalent, so it is safe to send on every request.

Instagram reauthentication: Instagram forces reauthentication by default. Set force_auth: false to allow the existing Instagram session to be reused. Omit it or set force_auth: true to keep forced reauthentication. force_account_selection: true takes precedence over force_auth: false. Other networks ignore force_auth.

Instagram Direct Messages: Messaging access is not requested by default. To use the Conversations API, set scopes to instagram_business_basic,instagram_business_content_publish,instagram_business_manage_comments,instagram_business_manage_insights,instagram_business_manage_messages. Custom scopes replace the defaults, so keep the first four unless you deliberately want a messaging-only connection. Accounts connected without instagram_business_manage_messages do not receive DMs and must be reconnected with it.

Important: For white-label users, this is a very important endpoint as it guarantees your customers never see our branding in the authentication flow.

Permissions: Requires accounts:connect. Access is limited by the API key creator's current organization membership and stored key ceiling. See Organization permissions.

POST
/v1/social-networks/{network}/auth-url

Path Parameters

network*string

Request Body

application/json
  1. body

Request schema for generating authentication URL

redirect_uri?string

Optional redirect URI for successful OAuth callback. If not provided, a default redirect URI will be used - which redirects in our management dashboard. The redirect URI usually is used to redirect somewhere in your own application to continue the user journey.

Formaturi
tenant_id?string

Optional customer-provided tenant identifier. This will be associated with any social accounts created during this OAuth flow, enabling you to filter accounts by tenant later using the GET /v1/social-accounts endpoint.

scopes?string

Optional comma-separated list of OAuth scopes to request for this network. When provided, ONLY these scopes are requested, overriding the defaults. When omitted, the default scopes for the network are used. Useful when bringing your own OAuth keys and your app only has a subset of products or permissions enabled. Messaging scopes (instagram_business_manage_messages, pages_messaging, dm.read, dm.write) require the organization DM messaging setting (Outstand dashboard, Settings > Security): while it is off they are refused with 403 and code dm_messaging_disabled, and while it is on the defaults already include them.

force_auth?boolean

Instagram only. Controls forced reauthentication (force_reauth). Defaults to true when omitted, preserving the existing behavior. Set false to allow the existing Instagram session to be reused. force_account_selection: true takes precedence. Ignored by other networks.

force_account_selection?boolean

Optional. When true, the OAuth flow always shows the network's authorization / account-selection screen instead of silently re-using the account already signed in on the user's browser session. Set this when your users connect more than one account on the same network - otherwise the second connection can silently re-authorize the first account and the user has to log out of the network to switch. Honoured by tiktok and tiktok-business (disable_auto_auth), facebook (auth_type=reauthenticate), instagram (force_reauth), youtube and google_business (prompt=select_account). Networks with no equivalent (linkedin, x, pinterest, threads, vimeo, bluesky) ignore it, so it is safe to send unconditionally.

Response Body

Authentication URL generated successfully

application/json
  1. response

Successful authentication URL response

success*boolean
data*

Authentication URL data

Example Request
curl -X POST 'https://api.outstand.so/v1/social-networks/string/auth-url' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "success": true,  "data": {    "auth_url": "http://example.com"  }}