Read a post or draft with GET /api/v1/posts/{postId}. Requires an API key with the read scope or a signed-in workspace member.
Request
Returns isDraft, revision, text, media, saved targets, current delivery state, and one delivery per destination with providerRef, url, issue, nextAction, canRetry, and canReconcile.
Each delivery reports canRetry and canReconcile. canRetry is true only for a failed attempt on a post that is not deleted, with an issue recorded and no provider post id; a TikTok submission id counts as no receipt only after tiktok_processing_failed. submission_uncertain and confirmation_unavailable never allow a retry. canReconcile is true only for an unresolved attempt that kept a provider post or submission id.
nextAction spells out the step. A failure caused by billing names the Billing settings fix a workspace owner must make, then a retry with POST /api/v1/posts/{postId}/targets/{targetId}/retry when the attempt can be retried. Any other retryable failure says to call POST /api/v1/posts/{postId}/targets/{targetId}/retry with the current attemptId, and any other failure says to create a new post for that destination. An unresolved delivery says to call POST /api/v1/posts/{postId}/targets/{targetId}/reconcile or, without a receipt, to check the provider. A retryable provider_rate_limited failure gives the wait the provider asked for, if it named one; PubNio retries those by itself up to 3 times when the wait is short enough.
A deleted post returns not-found.
| Parameter | In | Type | Required |
|---|---|---|---|
postId |
path | UUID | Yes |
workspaceId |
query | UUID | Yes |
Response
- HTTP 200:
PostwithpostId,isDraft,revision,text,media,targets,scheduledAt,deliveries,status,createdAt,updatedAt.status:draft,scheduled,queued,submitting,confirming,published,provider_draft,failed,unresolved,cancelled
The OpenAPI document has each field’s type.
Examples
const post = await workspace.posts.get(postId);post = workspace.posts.get(post_id)curl "https://pubnio.com/api/v1/posts/$POST_ID?workspaceId=$WORKSPACE_ID" \
-H "Authorization: Bearer $PUBNIO_API_KEY"pnio posts get "$POST_ID"Also: pnio posts publish, pnio posts status, pnio posts wait, pnio schedule skip-to-next.
async () => {
const postId = "<postId>";
const response = await codemode.request({
method: "GET",
path: `/api/v1/posts/${postId}`,
query: { workspaceId: codemode.workspaceId },
});
return response.data;
};Errors
It declares no problem of its own.
It declares the problems most operations declare.
Idempotency
None needed: a read is safe to retry.
Limits
- Field lengths and ranges are in the OpenAPI document.