Discovery
Inspect your key, list Brands and accounts, read capabilities, and manage weekly queue schedule settings.
Updated
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.
| Status | Meaning |
|---|---|
| 200 | Principal and granted scope returned |
| 400 | Ambiguous credentials (see Errors) |
| 401 | Authentication required or key expired/revoked |
| 403 | Suspended 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
| Name | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Page size, 1-100, default 50 |
| cursor | string | No | Opaque 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.
| Status | Meaning |
|---|---|
| 200 | Brands returned |
| 400 | Invalid pagination (see Errors) |
| 401 | Authentication required |
| 403 | Key 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
| Name | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Page size, 1-100, default 50 |
| cursor | string | No | Opaque cursor from nextCursor, max 512 characters |
| brandId | string | No | Restrict 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
}
| Status | Meaning |
|---|---|
| 200 | Accounts returned |
| 400 | Invalid pagination (see Errors) |
| 401 | Authentication required |
| 403 | Key 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | Yes | Social 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" }
}
}
| Status | Meaning |
|---|---|
| 200 | Capabilities and reasons returned |
| 400 | Invalid account ID (see Errors) |
| 401 | Authentication required |
| 403 | Key lacks account:read |
| 404 | Account 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | Yes | Social 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.
| Status | Meaning |
|---|---|
| 200 | Schedule settings returned |
| 400 | Invalid account ID (see Errors) |
| 401 | Authentication required |
| 403 | Key lacks account:read |
| 404 | Account 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | Yes | Social account ID |
| Idempotency-Key | header | UUID | Yes | Stable client UUID; repeat the same UUID after a lost response |
| expectedRevision | body | integer | Yes | Current revision from the read; minimum 1 |
| timezone | body | string | One of the three body variants | IANA timezone name, 1-128 characters, for example Asia/Bangkok |
| slots | body | array | One of the three body variants | Full replacement slot list, max 100 entries, unique weekday plus localTime pairs |
Each slot object:
| Name | Type | Required | Description |
|---|---|---|---|
| weekday | integer | Yes | 1-7 (1 is Monday, 7 is Sunday) |
| localTime | string | Yes | 24-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"
}
}
| Status | Meaning |
|---|---|
| 200 | Settings updated (or identical replay returned) |
| 400 | Validation error, invalid slots, or bad header (see Errors) |
| 401 | Authentication required |
| 403 | Key lacks account:schedule |
| 404 | Account not found or outside the key's scope |
| 409 | REVISION_CONFLICT (stale expectedRevision, with error.details.currentRevision) or idempotency conflict |
| 428 | REVISION_REQUIRED (missing expectedRevision) |
| 429 | Key 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | Yes | Social 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.
| Status | Meaning |
|---|---|
| 200 | Synced video list returned (possibly empty) |
| 400 | Invalid account ID (see Errors) |
| 401 | Authentication required |
| 403 | Key lacks insight:read |
| 404 | Account not found or outside the key's scope |
