Start OAuth Flow (Step 1 of 3)
GET/social-media-posting/oauth/:platform/start
OAuth Connection Flow - Step 1: Initiate OAuth
This is the first step in the 3-step OAuth flow to connect a social media account:
- Start OAuth (this endpoint) → User authenticates with the platform
- Get Accounts → Retrieve available pages/channels to connect
- Attach Account → Connect the selected account to your location
How to Use
Open this API in a browser window (not via cURL) with the required query parameters. The user will be redirected to the platform's OAuth login screen.
Receiving the OAuth Response
After successful authentication, the OAuth window will post a message back to your application. Listen for this message to get the accountId needed for the next step.
window.addEventListener('message', function(e) {
if (e.data && e.data.page === 'social_media_posting') {
const { actionType, page, platform, placement, accountId, reconnectAccounts } = e.data;
// Use accountId for Step 2: GET /oauth/{locationId}/{platform}/accounts/{accountId}
}
}, false);
Event Data Response
| Field | Type | Example | Description |
|---|---|---|---|
| actionType | string | "close" | The action type |
| page | string | "social-media-posting" | Source page identifier |
| platform | string | "facebook" | The OAuth platform |
| placement | string | "placement" | Placement context |
| accountId | string | "658a9b6833b91e0ecb8f3958" | Use this for Step 2 |
| reconnectAccounts | string[] | ["658a9b...", "efd2da..."] | Accounts that need reconnection |
Next Step
Use the accountId from the response to call:
GET /social-media-posting/oauth/{locationId}/{platform}/accounts/{accountId}
Platform Notes
- bluesky: Currently not supported, will return an error
- tiktok-business: Uses a separate business OAuth flow
Request
Responses
- 200
- 400
- 401
- 422
Successful Response
Bad Request
Unauthorized
Unprocessable Entity