Accounts

Reconnect Account

Renews an account's authorization. For OAuth platforms the response has type oauth and url, where the account owner signs in again with the same account. For Bluesky, send identifier and appPassword and the response has type account and the reconnected account. Reconnecting never adds a billed account.

POST
/v1/accounts/{id}/reconnect

Authorization

Bearer
headerAuthorizationBearer <op_>

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

Path Parameters

id*string
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
redirectUrl?string

Where the browser returns after the owner signs in again. Required with an API key. Ignored for Bluesky.

Formaturi
identifier?string

Bluesky only. The account's handle, email or DID.

Length1 <= length <= 253
appPassword?string

Bluesky only. A new App Password for the account.

Length1 <= length <= 200

Response Body

Authorization URL, or the reconnected Bluesky account

application/json
  1. response

The answer for an OAuth platform. The account owner signs in again at url.

type*"oauth"

Always oauth.

Value in"oauth"
url*string

Where the account owner signs in again.

Formaturi
expiresAt*string

When url stops working, in ISO 8601. A sign-in that finishes later returns to redirectUrl with error=SESSION_EXPIRED. Reconnect again then.

Formatdate-time
Example Request
import { Configuration, AccountsApi } from "@onepostly/sdk";const accountsApi = new AccountsApi(  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await accountsApi.reconnectAccount({  id: "acc_YOUR_LINKEDIN_ACCOUNT_ID",  reconnectAccountBody: {    "redirectUrl": "https://yourapp.com/oauth/onepostly"  },});console.log(response);
Example Response
{  "type": "oauth",  "url": "https://www.linkedin.com/oauth/v2/authorization?response_type=code&state=eyJhbGciOiJIUzI1NiJ9",  "expiresAt": "2027-03-15T10:10:00.000Z"}