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.

By Jake Marsh · Updated

Network status (2026-11): X (twitter), Bluesky (bluesky), Mastodon (mastodon), LinkedIn (linkedin, personal profiles), Threads (threads), Instagram (instagram, business and creator accounts) and YouTube (youtube, video) are live. Pinterest (pinterest) is in testing (Pins are visible only to you until Pinterest approves Octopost). Discord, Slack and Telegram (discord, slack, telegram) are in testing: connect a channel from the Accounts page. Facebook, TikTok and Reddit are in platform review and not available yet.

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.


A connect link lets someone else connect their own account to yours without an Octopost login: they open the link, pick a network and sign in there. Each account they connect is added to this Octopost account.

POST /api/connect-links

All fields are optional.

{ "label": "Acme Bakery", "networks": ["twitter", "linkedin"], "expiresInDays": 7, "maxAccounts": 5 }
FieldDefaultNotes
labelnoneShown to the person on the link page. Up to 80 characters.
networksanyNetwork ids the link may connect. Others are refused.
expiresInDays71 to 30.
maxAccounts5New accounts the link can add, 1 to 25. Reconnects don't count.
{
  "success": true,
  "url": "https://octopost.ink/add/opcl_...",
  "link": { "id": "7d0c...", "label": "Acme Bakery", "networks": ["twitter", "linkedin"], "maxAccounts": 5, "accountsAdded": 0, "expiresAt": "2026-11-24T12:00:00.000Z" }
}

The url is returned only here; Octopost keeps a hash of it. 400 for a bad field, 409 when the account already has 25 active links.

GET /api/connect-links

Your links with state (active, expired, revoked, used_up) and accountsAdded, plus networks, the ids a link can offer today.

DELETE /api/connect-links/{id}

Turns a link off. Accounts it already added stay connected. 404 if there's no active link with that id.


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.