Accounts

Connect a Bluesky Account

Connects a Bluesky account with its identifier and an App Password. Other platforms connect through Create Connect Session.

POST
/v1/accounts

Authorization

Bearer
headerAuthorizationBearer <op_>

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

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
identifier*string

Bluesky handle, email or DID, such as alice.bsky.social.

Length1 <= length <= 253
appPassword*string

A Bluesky App Password, in the form xxxx-xxxx-xxxx-xxxx. Create it in Bluesky under Settings, App Passwords.

Length1 <= length <= 200
platform*"bluesky"

bluesky. Every other platform connects through a connect session, because the account owner signs in on the platform.

Value in"bluesky"
profile?string

Profile to file the account under. It is created if it does not exist. Defaults to the workspace's Default profile.

Length1 <= length <= 60
metadata?

Your own key-value pairs for the account, such as the id of your user. The account returns them as metadata. An account that is already connected keeps its metadata.

Response Body

Connected account

application/json
  1. response
id*string
platform*|

The platform id. New platforms can be added, so handle a value you do not know.

displayName*string
handle*string

The account's handle on the platform, without a leading @. LinkedIn has no handles, so a LinkedIn account has its name here.

avatarUrl*|
Formaturi
status*|

active works normally. expired, revoked and error need a reconnect before the account can publish again. expired also covers an authorization that ran out and cannot renew by itself. A disconnected account is no longer returned. The account.disconnected webhook sends it as a DisconnectedAccount. New values can be added, so handle a value you do not know.

canAutoRenew*boolean

Whether the authorization renews without the account owner signing in again.

tokenExpiresAt*|

When the current authorization expires, or null when it does not.

Formatdate-time
profile*|

The name of the profile the account is filed under. null when the account is in no profile.

metadata*

The metadata sent with the connect that added the account. An empty object when none was sent.

xSubscriptionType?|

X only, such as Premium. The account's X subscription, which sets its post length limit. Null when X does not report it, and left out for other platforms.

createdAt*string
Formatdate-time
updatedAt*string
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.createAccount({  createAccountBody: {    "platform": "bluesky",    "identifier": "yourbrand.bsky.social",    "appPassword": "abcd-efgh-ijkl-mnop",    "profile": "Business",    "metadata": {      "userId": "user_8412"    }  },});console.log(response);
Example Response
{  "id": "acc_1699f4157fb643f49d2ac447491f32a8",  "platform": "bluesky",  "displayName": "Your Brand",  "handle": "yourbrand.bsky.social",  "avatarUrl": "https://cdn.onepostly.com/avatars/yourbrand.jpg",  "status": "active",  "canAutoRenew": true,  "tokenExpiresAt": "2027-03-01T12:00:00.000Z",  "profile": "Business",  "metadata": {    "userId": "user_8412"  },  "createdAt": "2027-03-01T10:00:00.000Z",  "updatedAt": "2027-03-01T10:00:00.000Z"}