Accounts
Connect a Bluesky Account
Connects a Bluesky account with its identifier and an App Password. Other platforms connect through Create Connect Session.
BearerAuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
Idempotency-Key?stringA 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.
1 <= length <= 255application/json- body
identifier*stringBluesky handle, email or DID, such as alice.bsky.social.
1 <= length <= 253appPassword*stringA Bluesky App Password, in the form xxxx-xxxx-xxxx-xxxx. Create it in Bluesky under Settings, App Passwords.
1 <= length <= 200platform*"bluesky"bluesky. Every other platform connects through a connect session, because the account owner signs in on the platform.
"bluesky"profile?stringProfile to file the account under. It is created if it does not exist. Defaults to the workspace's Default profile.
1 <= length <= 60metadata?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.
Connected account
application/json- response
id*stringplatform*|The platform id. New platforms can be added, so handle a value you do not know.
displayName*stringhandle*stringThe account's handle on the platform, without a leading @. LinkedIn has no handles, so a LinkedIn account has its name here.
avatarUrl*|uristatus*|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*booleanWhether the authorization renews without the account owner signing in again.
tokenExpiresAt*|When the current authorization expires, or null when it does not.
date-timeprofile*|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*stringdate-timeupdatedAt*stringdate-timeimport { 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);{ "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"}