Connect

Start OAuth Connect

Returns the platform URL where the user authorizes the connection. Send redirectUrl when you call with an API key.

GET
/v1/connections/oauth/{platform}/start

Authorization

headerx-api-key<token>

Workspace API key, sent in the x-api-key header. Keys start with op_ and are created in the dashboard.

Path Parameters

platform*string
Length1 <= length

Query Parameters

redirectUrl?string

Where the browser returns after authorization. Required when you call with an API key.

reconnect?string

Id of an existing connection to re-authorize. Reconnecting does not use a plan slot.

profile?string

Profile to file the new connection under. It is created if it does not exist. When omitted, the workspace default profile is used. Ignored on reconnect.

Lengthlength <= 60
headless?string

Set to true to skip the hosted account picker. The browser then returns to redirectUrl with a tempToken, and you finish the connect with the select endpoint. Applies to Facebook and to Instagram through Facebook Login. Requires redirectUrl.

loginMethod?string

How to connect an Instagram account. Defaults to instagram_login. Use facebook_login for an account linked to a Facebook Page, which adds a step to choose the account.

Value in"instagram_login""facebook_login"

Response Body

Authorization URL

application/json
  1. response
url*string
Formaturi
Example Request
import { Configuration, ConnectionsApi } from "@onepostly/sdk";const connectionsApi = new ConnectionsApi(  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY }));const response = await connectionsApi.startOAuth({  platform: "x",  redirectUrl: "https://app.onepostly.com/connections/callback",  profile: "Business",});console.log(response);
Example Response
{  "url": "https://x.com/i/oauth2/authorize?response_type=code&client_id=YOUR_CLIENT_ID&state=abc123"}