Connect

Select Candidate

Connects the chosen candidate and finishes the connect session.

POST
/v1/connect-sessions/{sessionId}/select

Authorization

Bearer
headerAuthorizationBearer <op_>

Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.

Path Parameters

sessionId*string

The connectSession value your redirect URL received.

Length1 <= length

Header Parameters

Idempotency-Key?string

A unique key, such as a UUID, that makes retrying this request safe. A repeat with the same key and body within 24 hours returns the first response instead of acting again. A 429 or 5xx response is not kept, so a retry with the same key runs again.

Length1 <= length <= 255

Request Body

application/json
  1. body
candidateId*string

id of a candidate from List Candidates.

Length1 <= length
redirectUrl?string

Overrides the session's redirectUrl for the final redirect.

Formaturi

Response Body

Connected account

application/json
  1. response
account*
redirectUrl*string

Where to send the browser next.

Formaturi
Example Request
import { Configuration, ConnectApi } from "@onepostly/sdk";const connectApi = new ConnectApi(  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await connectApi.selectConnectCandidate({  sessionId: "CONNECT_SESSION",  selectConnectCandidateBody: {    "candidateId": "123456789012345"  },});console.log(response);
Example Response
{  "account": {    "id": "acc_1699f4157fb643f49d2ac447491f3204",    "platform": "facebook",    "displayName": "Your Brand",    "handle": "yourbrand",    "avatarUrl": "https://cdn.onepostly.com/avatars/yourbrand.jpg",    "status": "active",    "canAutoRenew": true,    "tokenExpiresAt": "2027-05-14T10:00:00.000Z",    "profile": "Business",    "metadata": {      "userId": "user_8412"    },    "createdAt": "2027-03-15T09:00:00.000Z",    "updatedAt": "2027-03-15T09:00:00.000Z"  },  "redirectUrl": "https://yourapp.com/oauth/onepostly?connected=facebook&count=1&accountId=acc_1699f4157fb643f49d2ac447491f3204&handle=yourbrand"}