Docs
Docs/API Reference/Accounts

Accounts

List, inspect, refresh and disconnect the social accounts connected to Octopost through the REST API, connect Bluesky, and handle several accounts per network.

Network status (2026-11): X (twitter), Bluesky (bluesky), Mastodon (mastodon) and LinkedIn (linkedin, personal profiles) are live. Threads (threads) opens after Meta approves the Octopost app. Instagram, Facebook, TikTok, YouTube, Pinterest and Reddit are in platform review and not available yet. Discord, Slack and Telegram are not supported.

Accounts are the social profiles you've connected to Octopost. Octopost keeps their sign-in tokens and refreshes them for you. Tokens never appear in API responses.

You connect accounts in the dashboard at https://octopost.ink/dashboard/accounts, because most networks need you to sign in on their site. Bluesky can also be connected through the API (see below).

The account object#

FieldTypeDescription
idstringOctopost account id. Use it in a post's accounts field or with the endpoints below.
platformstringtwitter, threads, bluesky, linkedin or mastodon.
accountIdstringThe account's id on the network.
accountNamestringThe handle or name on the network.
needsReauthbooleantrue when the network rejected the stored sign-in. Reconnect it in the dashboard before posting.
isDefaultbooleanWhether this is the network's default account (the first one you connected).
tokenExpirystring | nullWhen the current access token expires. Octopost refreshes it before then.
lastRefreshedstringSame as updatedAt.
tokenAgestring | nullupdatedAt as text, for example "3 hours ago".
createdAt, updatedAtstringISO 8601 timestamps.

Several accounts on one platform#

You can connect more than one account per network (for example two X accounts): connect again while signed in to the other account on that network. Connecting the same account again just refreshes it. The first account you connected on a network is its default.

A post goes out as the default account unless:


List accounts#

GET /api/accounts

Oldest first, so the first account for each network is its default.

curl https://octopost.ink/api/accounts \
  -H "Authorization: Bearer op_your_api_key_here"
{
  "success": true,
  "accounts": [
    {
      "id": "a1b2c3d4-...",
      "platform": "twitter",
      "accountId": "1234567890",
      "accountName": "octopost",
      "createdAt": "2026-10-01T10:00:00.000Z",
      "updatedAt": "2026-11-04T12:00:00.000Z",
      "needsReauth": false,
      "tokenExpiry": "2026-11-04T14:00:00.000Z",
      "lastRefreshed": "2026-11-04T12:00:00.000Z",
      "tokenAge": "3 hours ago",
      "isDefault": true
    }
  ],
  "accountsNeedingReauth": 0
}

accountsNeedingReauth counts the accounts with needsReauth: true.

List connected networks#

GET /api/accounts/connected-platforms
{ "success": true, "connectedPlatforms": ["twitter", "bluesky"] }

Get an account#

GET /api/accounts/{id}
{
  "success": true,
  "account": {
    "id": "a1b2c3d4-...",
    "platform": "twitter",
    "accountId": "1234567890",
    "accountName": "octopost",
    "createdAt": "2026-10-01T10:00:00.000Z",
    "updatedAt": "2026-11-04T12:00:00.000Z",
    "metadata": {}
  }
}

metadata holds non-secret details Octopost keeps about the account. Its contents vary by network. 404 { "error": "Account not found" } if it isn't yours.


Refresh an account's sign-in#

POST /api/accounts/{id}/refresh

Octopost refreshes tokens on its own before they expire. Call this if a post failed with an expired-token error and you want to try again right away. Works for twitter, linkedin and bluesky. It also clears needsReauth when the refresh works.

{ "success": true, "message": "Token refreshed", "tokenExpiry": "2026-11-04T16:00:00.000Z" }
StatusBody
400{ "error": "Manual refresh not supported for this platform" }
404{ "error": "Account not found" }
500{ "error": "<why the refresh failed>" }. Reconnect the account in the dashboard.

Connect Bluesky#

POST /api/accounts/connect/bluesky

Bluesky signs in with an app password (create one in Bluesky under Settings > Privacy and security > App passwords), so it can be connected without a browser:

{ "handle": "you.bsky.social", "appPassword": "xxxx-xxxx-xxxx-xxxx" }
{
  "success": true,
  "message": "Bluesky account connected successfully",
  "account": { "handle": "you.bsky.social", "did": "did:plc:abc123" }
}

Connecting a handle that's already connected updates it. Errors: 400 when a field is missing, 401 when Bluesky rejects the handle or password, 403 when your plan's account limit is reached.


Disconnect an account#

DELETE /api/accounts/{id}

Removes the account from Octopost and, where the network allows it, revokes Octopost's access there. Posts already published stay up.

{ "success": true, "message": "Account disconnected successfully" }

404 { "error": "Account not found" } if it isn't yours.