Requests and activity

Recover durable mutation receipts by request ID and read the scoped activity feed.

Updated

Open in ClaudeOpen in ChatGPT
On this page

These two endpoints answer what happened and who did it. GET /api/v1/requests/{requestId} recovers the stored receipt of a mutation you already submitted - the safe way to resolve a lost or ambiguous response. GET /api/v1/activity lists the social activity feed for your scope, including sanitized failure codes. Receipt lookup semantics (when to reuse a key, when a 404 means stop) live in Idempotency; this page documents the wire shapes.

Look up a request receipt

GET /api/v1/requests/{requestId}

Recovers the durable receipt of an accepted mutation for the authenticated principal. Every accepted mutation that runs through the durable boundary stores a receipt: post create/update/delete, publish/schedule/cancel/retry/cover-retry, schedule-settings updates, media mutations, thread state updates, and comment reply acceptances. Scopes: any authenticated key or session; a key that holds none of the draft, publishing, schedule, or media actions is denied 403 before any receipt is read. CLI: postkub requests get. MCP: requests_get.

Parameters

NameInTypeRequiredDescription
requestIdpathstringYesUUID request identifier (the value you sent as Idempotency-Key)

Request example

curl -sS https://postkub.com/api/v1/requests/5c2e8f90-1a34-4e67-b2a9-0d8c7b6a5f4e \
  -H "Authorization: Bearer <API_KEY>"

Response 200 OK

{
  "requestId": "5c2e8f90-1a34-4e67-b2a9-0d8c7b6a5f4e",
  "status": "accepted",
  "statusCode": 202,
  "operation": "v1:comments:replies:create",
  "path": "/api/v1/comments/:id/replies",
  "createdAt": "2026-12-04T08:00:08.000Z",
  "result": {
    "requestId": "5c2e8f90-1a34-4e67-b2a9-0d8c7b6a5f4e",
    "replyId": "reply_example123",
    "commentId": "comment_example123",
    "threadId": "thread_example123",
    "socialAccountId": "acc_example1",
    "revision": 1,
    "state": "pending",
    "statusUrl": "/api/v1/replies/reply_example123",
    "replayed": false
  }
}

Envelope fields:

NameTypeDescription
requestIdstringThe UUID you looked up
statusstringAlways accepted - only accepted mutations store receipts
statusCodeintegerThe HTTP status code of the original response
operationstringInternal operation name, for example v1:posts:publish or v1:comments:replies:create
pathstringThe route template the mutation ran on
createdAtstringWhen the mutation was accepted (UTC)
resultobjectThe stored response body of the original operation

result mirrors the original operation's response body. Exactly one variant applies, and it is re-projected through your current authority before being returned:

  • The full original envelope, when you still hold full authority over the stored snapshot's Brand and accounts (post create/update envelopes, publication receipts, thread and reply receipts, schedule-settings receipts, media receipts, key and connection receipts).
  • A sanitized draft receipt { "requestId": ..., "post": { "id": ..., "revision": ... } }, when partial authority remains.
  • A 404 when the stored result is outside your current resource or action authority.

Receipts are principal-namespaced: a key never sees another key's receipt or the owner session's receipt, and vice versa, and a receipt is never returned under a revoked or expired key.

StatusMeaning
200Receipt returned, re-projected through current authority
400requestId is not a valid UUID (see Errors)
401Authentication required, or the key was revoked or expired after the mutation
403The key holds none of the draft, publishing, schedule, or media actions
404No receipt for this principal and request ID, or the stored result is outside your current authority

List activity

GET /api/v1/activity

Lists the scoped social activity feed, newest first: publication lifecycle events, thread state updates, comment reply outcomes, media actions, and sanitized failure codes. Scopes: activity:read. CLI: postkub activity list. MCP: activity_list.

Query parameters

NameTypeRequiredDescription
limitintegerNoPage size, 1-100, default 50
cursorstringNoOpaque cursor from nextCursor, max 512 characters
brandIdstringNoRestrict to one Brand ID
accountIdstringNoRestrict to items involving one social account
postIdstringNoRestrict to items involving one post
fromstringNoISO instant, window start
tostringNoISO instant, window end

from must not be after to. See Pagination for cursor rules.

Request example

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

Response 200 OK

{
  "items": [
    {
      "id": "audit_example123",
      "action": "post:publish",
      "actorType": "agent",
      "targetType": "post",
      "targetId": "post_example123",
      "brandId": "brand_example1",
      "socialAccountIds": ["acc_example1"],
      "postId": "post_example123",
      "publicationId": "pub_example123",
      "revision": 2,
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "sourceKeyId": "key_example1",
      "code": null,
      "createdAt": "2026-12-04T09:00:00.000Z"
    }
  ],
  "nextCursor": null
}

Item fields:

NameTypeDescription
idstringAudit record ID
actionstringWhat happened, for example post:publish, post:publication_blocked, thread.update, comment.reply.sent, or media:ready
actorTypestringuser, agent, or system
targetTypestringRecord type acted on, for example post or publication; null when none applies
targetIdstringRecord ID acted on; null when none applies
brandIdstringBrand the item belongs to; null when unknown
socialAccountIdsarraySorted account IDs involved
postIdstringRelated post; null when none applies
publicationIdstringRelated publication; null when none applies
revisionintegerRelated revision number; null when none applies
requestIdstringMutation request ID when the item came from an API mutation
sourceKeyIdstringAPI key that caused the item; keys see this only for their own actions, sessions see the originating key ID
codestringSanitized failure code, for example PROVIDER_RATE_LIMITED; null when the item is not a failure
createdAtstringWhen the item happened (UTC)

Feeds include post lifecycle and reconciliation actions (post:create through post:publication_recovery_required), account:schedule, thread.update, the comment.reply.* outcome family, insights.sync.failed, and the media:* action family.

For a scoped key, only items inside its Brands and accounts are returned - an out-of-scope brandId or accountId filter yields an empty page, and socialAccountIds is narrowed to the key's visible accounts. An item from another key keeps sourceKeyId: null.

StatusMeaning
200Activity page returned
400Invalid query (see Errors)
401Authentication required
403Key lacks activity:read