Skip to content

Retry a failed delivery

PubNio API posts.retry: retry a failed delivery. Request fields, examples in five clients, errors, and idempotency.

Retry a failed delivery with POST /api/v1/posts/{postId}/targets/{targetId}/retry. Requires an API key with the publish scope or a signed-in workspace owner.

Request

Retry the frozen content for one failed destination. Repeating the same expected attempt ID returns the same replacement. Uncertain publications require reconciliation.

Pass the attemptId you read from GET /api/v1/posts/{postId} as expectedAttemptId. A retry makes a replacement attempt with status queued that reuses the failed attempt’s frozen revision and content snapshot, so edits made since then are not sent.

Sending the same expectedAttemptId again returns that same replacement attempt instead of making a second one. If the target’s current attempt is another one, the call fails with attempt-changed and names currentAttemptId.

A deleted post, or an attempt that is not failed with evidence the provider did not publish it, fails with delivery-not-retryable; create a new post for that destination instead.

Parameter In Type Required
postId path UUID Yes
targetId path UUID Yes
workspaceId query UUID Yes
Body field Type Required
expectedAttemptId UUID Yes

Response

  • HTTP 202: an object with targetId, attemptId, accountId, scheduledAt, queueId, slotId, assignmentId, occurrenceDate, localDate, localTime, timezone, status.
    • status: scheduled, queued, submitting, confirming, published, provider_draft, failed, unresolved, cancelled

The OpenAPI document has each field’s type.

Examples

const result = await workspace.posts.retry(postId, targetId, {
  expectedAttemptId: attemptId,
});
result = workspace.posts.retry(
    post_id,
    target_id,
    expected_attempt_id=attempt_id,
)
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 "$POST_ID" "$TARGET_ID" --expected-attempt-id "$ATTEMPT_ID"
async () => {
  const postId = "<postId>";
  const targetId = "<targetId>";
  const attemptId = "<attemptId>";
  const response = await codemode.request({
    method: "POST",
    path: `/api/v1/posts/${postId}/targets/${targetId}/retry`,
    query: { workspaceId: codemode.workspaceId },
    body: { expectedAttemptId: attemptId },
  });
  return response.data;
};

Errors

It also declares the problems most operations declare.

Idempotency

No key. The required expectedAttemptId makes a stale retry fail instead of applying twice.

Limits

Type to search…

↑↓ navigate↵ selectEsc close