Docs
Docs/API Reference/Accounts

Accounts

Manage connected social media accounts

Accounts

Accounts represent the social media profiles you have connected to Octopost. Each account is linked to a specific platform and stores the credentials needed to publish on your behalf.

Connecting new accounts is done through the OAuth flow in the Octopost Dashboard. The API provides read access and the ability to disconnect accounts.

The Account Object

{
  "id": "acc_abc123",
  "platform": "twitter",
  "platform_user_id": "1234567890",
  "username": "octopost",
  "display_name": "Octopost",
  "avatar_url": "https://pbs.twimg.com/profile_images/abc/photo.jpg",
  "is_active": true,
  "connected_at": "2026-03-15T10:00:00Z",
  "last_used_at": "2026-04-03T12:05:00Z"
}

Fields

FieldTypeDescription
idstringUnique account identifier.
platformstringThe social platform: twitter, bluesky, mastodon, linkedin, threads, instagram, facebook, tiktok, youtube.
platform_user_idstringThe user's ID on the platform.
usernamestringThe user's handle or username on the platform.
display_namestringThe user's display name on the platform.
avatar_urlstring | nullURL to the user's profile image.
is_activebooleanWhether the account connection is active. false if the token has expired or been revoked.
connected_atstringISO 8601 timestamp of when the account was connected.
last_used_atstring | nullISO 8601 timestamp of the last time a post was published through this account.

List Accounts

GET /accounts

Returns all connected social media accounts.

Example

curl https://api.octopost.ink/v1/accounts \
  -H "Authorization: Bearer oct_live_abc123"
{
  "accounts": [
    {
      "id": "acc_abc123",
      "platform": "twitter",
      "platform_user_id": "1234567890",
      "username": "octopost",
      "display_name": "Octopost",
      "avatar_url": "https://pbs.twimg.com/profile_images/abc/photo.jpg",
      "is_active": true,
      "connected_at": "2026-03-15T10:00:00Z",
      "last_used_at": "2026-04-03T12:05:00Z"
    },
    {
      "id": "acc_def456",
      "platform": "bluesky",
      "platform_user_id": "did:plc:abc123",
      "username": "octopost.bsky.social",
      "display_name": "Octopost",
      "avatar_url": "https://cdn.bsky.app/avatars/abc.jpg",
      "is_active": true,
      "connected_at": "2026-03-16T11:00:00Z",
      "last_used_at": "2026-04-03T12:05:00Z"
    },
    {
      "id": "acc_ghi789",
      "platform": "linkedin",
      "platform_user_id": "urn:li:person:abc",
      "username": "octopost",
      "display_name": "Octopost Inc.",
      "avatar_url": "https://media.licdn.com/dms/image/abc/photo.jpg",
      "is_active": false,
      "connected_at": "2026-03-20T09:00:00Z",
      "last_used_at": "2026-03-28T16:00:00Z"
    }
  ]
}

Get an Account

GET /accounts/:id

Returns a single connected account by ID.

Example

curl https://api.octopost.ink/v1/accounts/acc_abc123 \
  -H "Authorization: Bearer oct_live_abc123"
{
  "id": "acc_abc123",
  "platform": "twitter",
  "platform_user_id": "1234567890",
  "username": "octopost",
  "display_name": "Octopost",
  "avatar_url": "https://pbs.twimg.com/profile_images/abc/photo.jpg",
  "is_active": true,
  "connected_at": "2026-03-15T10:00:00Z",
  "last_used_at": "2026-04-03T12:05:00Z"
}

Returns 404 Not Found if the account does not exist.


Disconnect an Account

DELETE /accounts/:id

Disconnects a social media account. This revokes stored tokens and removes the account from Octopost. Posts already published through this account are not affected.

After disconnecting, the account will no longer appear in account listings and cannot be used for publishing.

Example

curl -X DELETE https://api.octopost.ink/v1/accounts/acc_ghi789 \
  -H "Authorization: Bearer oct_live_abc123"

Returns 204 No Content on success.

Errors

CodeReason
404 Not FoundAccount does not exist or has already been disconnected.