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 (
bluesky), Mastodon (mastodon), LinkedIn (threads), Instagram (youtube, video) are live. Pinterest (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#
| Field | Type | Description |
|---|---|---|
id | string | Octopost account id. Use it in a post's accounts field or with the endpoints below. |
platform | string | twitter, threads, bluesky, linkedin or mastodon. |
accountId | string | The account's id on the network. |
accountName | string | The handle or name on the network. |
needsReauth | boolean | true when the network rejected the stored sign-in. Reconnect it in the dashboard before posting. |
isDefault | boolean | Whether this is the network's default account (the first one you connected). |
tokenExpiry | string | null | When the current access token expires. Octopost refreshes it before then. |
lastRefreshed | string | Same as updatedAt. |
tokenAge | string | null | updatedAt as text, for example "3 hours ago". |
createdAt, updatedAt | string | ISO 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:
- the post names another one with
accounts(see Posts), or - the API key it was sent with has its own default account for that network. Set that when you create the key at https://octopost.ink/dashboard/api/keys.
List accounts#
GET /api/accountsOldest 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}/refreshOctopost 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" }| Status | Body |
|---|---|
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/blueskyBluesky 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.
Connect links#
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-linksAll fields are optional.
{ "label": "Acme Bakery", "networks": ["twitter", "linkedin"], "expiresInDays": 7, "maxAccounts": 5 }| Field | Default | Notes |
|---|---|---|
label | none | Shown to the person on the link page. Up to 80 characters. |
networks | any | Network ids the link may connect. Others are refused. |
expiresInDays | 7 | 1 to 30. |
maxAccounts | 5 | New 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-linksYour 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.