Skip to content

Archive a post or draft

PubNio API posts.delete: archive a post or draft. Request fields, examples in five clients, errors, and idempotency.

Archive a post or draft with DELETE /api/v1/posts/{postId}. Requires an API key with the read scope or a signed-in workspace member. Only an owner can archive a post that was submitted; others can archive drafts.

Request

Queued deliveries are cancelled and queue assignments released. The post and its delivery history stay readable to analytics.

Deleting archives the post. Every destination whose current attempt is still queued becomes cancelled, and its queue slots are released. PubNio makes no provider call, so a delivery already submitted or published stays on the network.

Only a workspace owner can delete a post that has been submitted for publishing; any member can delete a draft. Afterwards GET /api/v1/posts/{postId} returns not-found.

Parameter In Type Required
postId path UUID Yes
workspaceId query UUID Yes

Response

  • HTTP 200: an object with archived.

The OpenAPI document has each field’s type.

Examples

const archived = await workspace.posts.delete(postId);
archived = workspace.posts.delete(post_id)
curl -X DELETE "https://pubnio.com/api/v1/posts/$POST_ID?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
pnio posts delete "$POST_ID"
async () => {
  const postId = "<postId>";
  const response = await codemode.request({
    method: "DELETE",
    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

No key, so a retried DELETE is not deduplicated. Read the current state before you retry.

Limits

Type to search…

↑↓ navigate↵ selectEsc close