Discovery

Inspect your key, list Brands and accounts, read capabilities, and manage weekly queue schedule settings.

Updated

Open in ClaudeOpen in ChatGPT
On this page

Discovery endpoints tell an API key what it can see and do: which workspace, Brands, and accounts it targets, which actions it holds, what each connected account supports, and the weekly queue slots used by next-slot scheduling. Start every integration with these reads before creating posts.

Inspect the authenticated principal

GET /api/v1/me

Returns the authenticated principal, the workspace ID, the scoped Brand and account IDs, and the granted actions. Works for every valid key, including action-only keys that would fail other discovery reads. Scopes: any authenticated key. CLI: postkub whoami. MCP: whoami.

Parameters: none.

Request example

curl -sS https://postkub.com/api/v1/me \
  -H "Authorization: Bearer <API_KEY>"

Response 200 OK

{
  "principalType": "api_key",
  "workspaceId": "workspace_example1",
  "user": null,
  "apiKey": {
    "id": "key_example1",
    "name": "Content publishing",
    "prefix": "pk_live_ab12cd",
    "environment": "production",
    "revision": 1,
    "expiresAt": null
  },
  "actions": ["account:read", "brand:read", "post:create", "post:publish"],
  "brandIds": ["brand_example1"],
  "accountIds": ["acc_example1"],
  "brands": [
    {
      "id": "brand_example1",
      "name": "Acme Brand",
      "timezone": "Asia/Bangkok",
      "createdAt": "2026-10-21T00:00:00.000Z"
    }
  ],
  "accounts": [
    {
      "id": "acc_example1",
      "brandId": "brand_example1",
      "provider": "meta",
      "platform": "facebook",
      "name": "Acme Page",
      "handle": "@acme",
      "timezone": "Asia/Bangkok",
      "status": "active",
      "createdAt": "2026-10-21T00:00:00.000Z"
    }
  ]
}

For a signed-in human session, principalType is session, user holds the profile, and apiKey is null. brandIds and accountIds always list the key's full target scope; the brands and accounts arrays are null unless the key also holds brand:read and account:read.

StatusMeaning
200Principal and granted scope returned
400Ambiguous credentials (see Errors)
401Authentication required or key expired/revoked
403Suspended owner, stale ownership, or unsupported legacy key

List Brands

GET /api/v1/brands

Lists the Brands the key is scoped to. Scopes: brand:read. CLI: postkub brands list. MCP: brands_list.

Query parameters

NameTypeRequiredDescription
limitintegerNoPage size, 1-100, default 50
cursorstringNoOpaque cursor from nextCursor, max 512 characters

Request example

curl -sS "https://postkub.com/api/v1/brands?limit=50" \
  -H "Authorization: Bearer <API_KEY>"

Response 200 OK

{
  "items": [
    {
      "id": "brand_example1",
      "name": "Acme Brand",
      "timezone": "Asia/Bangkok",
      "createdAt": "2026-10-21T00:00:00.000Z"
    }
  ],
  "nextCursor": null
}

See Pagination for cursor rules.

StatusMeaning
200Brands returned
400Invalid pagination (see Errors)
401Authentication required
403Key lacks brand:read

List accounts

GET /api/v1/accounts

Lists the connected social accounts the key is scoped to. Scopes: account:read. CLI: postkub accounts list. MCP: accounts_list.

Query parameters

NameTypeRequiredDescription
limitintegerNoPage size, 1-100, default 50
cursorstringNoOpaque cursor from nextCursor, max 512 characters
brandIdstringNoRestrict results to one Brand ID

Request example

curl -sS "https://postkub.com/api/v1/accounts?brandId=brand_example1" \
  -H "Authorization: Bearer <API_KEY>"

Response 200 OK

{
  "items": [
    {
      "id": "acc_example1",
      "brandId": "brand_example1",
      "provider": "meta",
      "platform": "facebook",
      "name": "Acme Page",
      "handle": "@acme",
      "timezone": "Asia/Bangkok",
      "status": "active",
      "createdAt": "2026-10-21T00:00:00.000Z"
    }
  ],
  "nextCursor": null
}
StatusMeaning
200Accounts returned
400Invalid pagination (see Errors)
401Authentication required
403Key lacks account:read

Get account capabilities

GET /api/v1/accounts/{id}/capabilities

Returns the account's truthful capabilities: which actions the caller may use on it, which publish formats are qualified, and explicit availability reasons per capability. Always check this before publishing or scheduling. Scopes: account:read. CLI: postkub capabilities get. MCP: capabilities_get.

Parameters

NameInTypeRequiredDescription
idpathstringYesSocial account ID

Request example

curl -sS https://postkub.com/api/v1/accounts/acc_example1/capabilities \
  -H "Authorization: Bearer <API_KEY>"

Response 200 OK

{
  "accountId": "acc_example1",
  "allowedActions": ["brand:read", "account:read"],
  "publishFormats": [
    { "format": "image", "available": true, "reason": "Live image publication is qualified for this account" },
    { "format": "video", "available": false, "reason": "Live video publication is not qualified for this account yet" }
  ],
  "availability": {
    "drafts": { "available": true, "reason": "Drafts are enabled for this account" },
    "publishing": { "available": true, "reason": "Publishing is enabled for this account" },
    "comments": { "available": true, "reason": "Comment inbox, thread management, and provider replies are enabled for this account" },
    "firstComment": { "available": false, "reason": "First comments are not supported for this account's platform yet" },
    "insights": { "available": true, "reason": "Insights are enabled for this account" }
  }
}
StatusMeaning
200Capabilities and reasons returned
400Invalid account ID (see Errors)
401Authentication required
403Key lacks account:read
404Account not found or outside the key's scope

Read schedule settings

GET /api/v1/accounts/{id}/schedule-settings

Reads the account's weekly queue slots and timezone. Next-slot scheduling reserves the earliest unoccupied slot from this list. Scopes: account:read. CLI: postkub accounts schedule get. MCP: accounts_schedule_get.

Parameters

NameInTypeRequiredDescription
idpathstringYesSocial account ID

Request example

curl -sS https://postkub.com/api/v1/accounts/acc_example1/schedule-settings \
  -H "Authorization: Bearer <API_KEY>"

Response 200 OK

{
  "accountId": "acc_example1",
  "timezone": "Asia/Bangkok",
  "revision": 4,
  "slots": [
    { "weekday": 1, "localTime": "09:00" },
    { "weekday": 3, "localTime": "18:30" }
  ],
  "updatedAt": "2026-11-20T04:12:00.000Z"
}

weekday uses ISO numbering: 1 is Monday, 7 is Sunday. localTime is a 24-hour HH:MM wall time in the account timezone.

StatusMeaning
200Schedule settings returned
400Invalid account ID (see Errors)
401Authentication required
403Key lacks account:read
404Account not found or outside the key's scope

Update schedule settings

PATCH /api/v1/accounts/{id}/schedule-settings

Updates the weekly queue slots and/or the timezone. This is a guarded mutation: it requires an Idempotency-Key header and the current expectedRevision. Scopes: account:schedule. CLI: postkub accounts schedule update. MCP: accounts_schedule_update.

Parameters

NameInTypeRequiredDescription
idpathstringYesSocial account ID
Idempotency-KeyheaderUUIDYesStable client UUID; repeat the same UUID after a lost response
expectedRevisionbodyintegerYesCurrent revision from the read; minimum 1
timezonebodystringOne of the three body variantsIANA timezone name, 1-128 characters, for example Asia/Bangkok
slotsbodyarrayOne of the three body variantsFull replacement slot list, max 100 entries, unique weekday plus localTime pairs

Each slot object:

NameTypeRequiredDescription
weekdayintegerYes1-7 (1 is Monday, 7 is Sunday)
localTimestringYes24-hour HH:MM, for example 09:00

Send timezone only, slots only, or both together.

Request example

curl -sS -X PATCH https://postkub.com/api/v1/accounts/acc_example1/schedule-settings \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Idempotency-Key: 7f6c2f1e-8b4a-4c3d-9e2f-1a2b3c4d5e6f" \
  -H "Content-Type: application/json" \
  -d '{
    "expectedRevision": 4,
    "slots": [
      { "weekday": 1, "localTime": "09:00" },
      { "weekday": 3, "localTime": "18:30" }
    ]
  }'

Response 200 OK

{
  "requestId": "7f6c2f1e-8b4a-4c3d-9e2f-1a2b3c4d5e6f",
  "scheduleSettings": {
    "accountId": "acc_example1",
    "timezone": "Asia/Bangkok",
    "revision": 5,
    "slots": [
      { "weekday": 1, "localTime": "09:00" },
      { "weekday": 3, "localTime": "18:30" }
    ],
    "updatedAt": "2026-12-03T08:00:00.000Z"
  }
}
StatusMeaning
200Settings updated (or identical replay returned)
400Validation error, invalid slots, or bad header (see Errors)
401Authentication required
403Key lacks account:schedule
404Account not found or outside the key's scope
409REVISION_CONFLICT (stale expectedRevision, with error.details.currentRevision) or idempotency conflict
428REVISION_REQUIRED (missing expectedRevision)
429Key rate limit exceeded

List synced videos

GET /api/v1/accounts/{id}/synced-videos

Syncs the account's recent live videos from the TikTok Display API (video.list), lists them, and reports IDs of locally published posts whose video has since been deleted on TikTok. Non-TikTok accounts return supported: false with empty lists. Not available as a CLI command or MCP tool. Scopes: insight:read.

Parameters

NameInTypeRequiredDescription
idpathstringYesSocial account ID

Request example

curl -sS https://postkub.com/api/v1/accounts/acc_example1/synced-videos \
  -H "Authorization: Bearer <API_KEY>"

Response 200 OK

{
  "accountId": "acc_example1",
  "supported": true,
  "scopeMissing": false,
  "videos": [
    {
      "id": "7425139482736152911",
      "title": "Example video title",
      "video_description": "Caption text",
      "duration": 34,
      "cover_image_url": "https://p16-sign-va.tiktokcdn.com/example.jpg",
      "share_url": "https://www.tiktok.com/@acme/video/7425139482736152911",
      "like_count": 120,
      "comment_count": 15,
      "share_count": 3,
      "view_count": 5400,
      "create_time": 1764840000
    }
  ],
  "archivedPostIds": ["post_example123"]
}

When the TikTok credential lacks the video.list scope, scopeMissing is true and videos is empty. A failed provider sync sets syncError to true instead of failing the request.

StatusMeaning
200Synced video list returned (possibly empty)
400Invalid account ID (see Errors)
401Authentication required
403Key lacks insight:read
404Account not found or outside the key's scope