Skip to content

Post lifecycle

How a post moves from draft to a confirmed delivery, and what to do at each status.

A post is the content you write. Each destination on it is a target, and each target is delivered separately. So one post can be published on Instagram, still confirming on TikTok, and failed on X at the same time. Read the target status to know what happened where, and the post status for the summary.

The path a target takes

draft → queued → submitting → confirming → published
                                         → provider_draft
                                         → failed       (retry: back to queued)
                                         → unresolved   (reconcile: settles it)

A target with a future scheduledAt shows scheduled while it waits in the queue. You can cancel it any time before submitting.

Status What it means What to do
draft Saved, not submitted. Post level only. Edit, validate, or publish it.
scheduled Waiting for a future scheduledAt. Reschedule or cancel it until the provider write starts.
queued Waiting for its turn to write. Wait.
submitting PubNio is reserving and sending the provider write. Wait. It can no longer be cancelled.
confirming The provider accepted the write. PubNio is checking the result. Wait.
published The provider confirmed the post. providerRef and url are set. Done. Billed as one confirmed publish.
provider_draft The provider saved a native draft, such as a TikTok inbox upload. Done. Billed as one confirmed publish.
failed The attempt reached a definite failure. Read issue and nextAction, then fix and retry.
unresolved PubNio cannot tell yet whether the provider published it. Reconcile it later. Do not retry blindly.
cancelled You cancelled it before the provider write started. Nothing.

scheduled is a display status. The stored attempt stays queued until its time comes. published, provider_draft, failed, unresolved, and cancelled are settled: they do not change on their own.

Post status

The post status uses the same words as its targets. While any target is still working, the post reports that work: scheduled, queued, submitting, or confirming. Once every target settles, the post reports the status that needs you most: unresolved if any target is unresolved, then failed if any failed, then published. A post reports cancelled only when every target was cancelled.

When every target settles, PubNio also sends one summary event:

Every target settled as Post event
published or provider_draft post.published
cancelled post.cancelled
A mix with at least one success post.partial
Anything else with no success post.failed

Each target also sends its own post.delivery.* event as it settles. See Webhooks for the event payloads.

Failed or unresolved

Every target reports canRetry and canReconcile. Failed and unresolved targets also report issue and nextAction, a plain sentence that says what to do next.

  • Failed: the provider said no. Fix what issue names, such as an expired connection or a caption that is too long, then retry. A retry creates a new attempt for that one target and leaves the other targets alone.
  • Unresolved: the provider took the request but PubNio could not read the result, for example after a timeout. Retrying might post twice. Reconcile instead: PubNio checks the provider receipt again and settles the target.
  • Rate limited: the network said the account is posting too fast, and its answer proves nothing was posted. PubNio retries the target by itself, up to 3 times. Meanwhile the target shows scheduled with automaticRetry: { count, max }, and you get a post.scheduled event instead of post.delivery.failed. If retries run out, the target is failed with issue provider_rate_limited, and its nextAction says how long the network asked to wait; retry it after that.
const post = await workspace.posts.get(postId);
for (const target of post.deliveries) {
  if (target.canReconcile)
    await workspace.posts.reconcile(postId, target.targetId, {
      expectedAttemptId: target.attemptId,
    });
  else if (target.canRetry)
    await workspace.posts.retry(postId, target.targetId, {
      expectedAttemptId: target.attemptId,
    });
}
post = workspace.posts.get(post_id)
for target in post["deliveries"]:
    if target["canReconcile"]:
        workspace.posts.reconcile(post_id, target["targetId"], target["attemptId"])
    elif target["canRetry"]:
        workspace.posts.retry(post_id, target["targetId"], target["attemptId"])
curl -X POST "https://pubnio.com/api/v1/posts/$POST_ID/targets/$TARGET_ID/retry?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"expectedAttemptId\":\"$ATTEMPT_ID\"}"
pnio posts retry --workspace "$WORKSPACE_ID" "$POST_ID" "$TARGET_ID" \
  --expected-attempt-id "$ATTEMPT_ID"
pnio posts reconcile --workspace "$WORKSPACE_ID" "$POST_ID" "$TARGET_ID" \
  --expected-attempt-id "$ATTEMPT_ID"

expectedAttemptId is the attempt you looked at. If another caller retried first, the request returns attempt-changed with currentAttemptId, so two workers never retry the same target twice.

Wait for a result

Publishing returns as soon as the work is accepted. To block until the post settles, call posts.wait. It polls for up to 60 seconds by default and at most 1 hour, and returns settled: false with the latest status if time runs out. For long or scheduled work, listen for the webhook instead of waiting.

const { settled, post } = await workspace.posts.wait(postId, {
  timeoutMs: 60_000,
});

Billing

Only published and provider_draft deliveries count as confirmed publishes. Drafts, validation, schedules, cancellations, failures, and retries that fail again are free.

Type to search…

↑↓ navigate↵ selectEsc close