Skip to Content
API ReferenceGenerate OAuth Redirect URL

Generate OAuth Redirect URL

Generate a redirect URL to initiate OAuth connection for a user.

You must redirect your user to this URL to allow them to connect their social account.


Endpoint

GET /v1/oauth/{platform}/connect

Headers

Authorization: Bearer YOUR_ACCESS_TOKEN

Query Parameters

ParameterTypeRequiredDescription
user_idstringYesYour internal user identifier
redirect_urlstringYesURL where user will be redirected after OAuth
namestringNoUser name for reference (stored in Palactix)
emailstringNoUser email for reference (stored in Palactix)

Supported Platforms

PlatformSlug
Instagraminstagram
Facebookfacebook
X (Twitter)x
LinkedInlinkedin
YouTubeyoutube
TikToktiktok

Response

{ "redirect_url": "https://platform.com/oauth/authorize?...", "connection_id": "conn_abc123" }

cURL Example

curl -X GET "https://api.palactix.com/v1/oauth/instagram/connect?user_id=123&redirect_url=https://yourapp.com/callback" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

How It Works

  1. Call this API to generate OAuth URL
  2. Redirect your user to redirect_url
  3. User authorizes your app
  4. Palactix processes the connection
  5. Use connection_id to fetch accounts

OAuth Redirect Response

After the user completes the OAuth flow, Palactix redirects the user to your provided redirect_url.

Query parameters are appended to indicate the result of the connection.


Success Response

https://yourapp.com/callback?connection_id=conn_abc123&status=success

Failed Response

https://yourapp.com/callback?connection_id=conn_abc123&status=failed&error=access_denied

Parameters

ParameterTypeDescription
connection_idstringUnique connection identifier
statusstringsuccess or failed
errorstringError code (only present if failed)

How to Handle This

On your frontend or backend:

  • Read connection_id from query params
  • Call the connection accounts API
  • Show connected accounts to the user

Important Notes

  • Always rely on connection_id to fetch actual data
  • Do not trust redirect data as final state
  • Use API to get authoritative results

Errors

400 — Missing Parameters

Occurs when required query parameters are not provided.

Error:

  • MISSING_PARAMETERS

When this happens:

  • user_id is missing
  • redirect_url is missing

How to fix:

  • Ensure both parameters are included
  • Validate input before calling the API

404 — Platform Not Supported

Occurs when the platform slug is invalid or not supported.

Error:

  • PLATFORM_NOT_FOUND

When this happens:

  • Incorrect platform slug
  • Platform not supported

How to fix:

  • Use a valid platform slug from the list above
  • Double-check spelling

400 — Platform Credentials Not Configured

Occurs when OAuth credentials are not set for the selected platform.

Error:

  • CREDENTIALS_NOT_FOUND

When this happens:

  • No credentials added for the platform
  • Credentials are incomplete

How to fix:

  • Add platform credentials in developer dashboard
  • Ensure credentials are verified

500 — Redirect URL Generation Failed

Occurs when Palactix fails to generate the OAuth URL.

Error:

  • REDIRECT_URL_ERROR

When this happens:

  • Internal error
  • Invalid configuration
  • Unexpected failure

How to fix:

  • Retry the request
  • Verify credentials
  • Contact support if issue persists

Debugging Tips

  • Always store connection_id
  • Log request parameters
  • Ensure access token is valid

Next Step

Fetch Connected Accounts

Last updated on