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

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Archive a post or draft

Archive a post or draft with [`DELETE /api/v1/posts/{postId}`](https://pubnio.com/api/v1/docs#tag/posts/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}`](https://pubnio.com/api/v1/docs#tag/posts/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](https://pubnio.com/api/v1/openapi) has each field's type.

## Examples

### TypeScript

```ts
const archived = await workspace.posts.delete(postId);
```

### Python

```python
archived = workspace.posts.delete(post_id)
```

### cURL

```sh
curl -X DELETE "https://pubnio.com/api/v1/posts/$POST_ID?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
```

### CLI

```sh
pnio posts delete "$POST_ID"
```

### MCP execute

```js
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](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

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

## Limits

- Field lengths and ranges are in the [OpenAPI document](https://pubnio.com/api/v1/openapi).

## Related

- [Posts operations](https://pubnio.com/docs/reference/#posts)
- [Publishing](https://pubnio.com/docs/publishing/)
- [Post lifecycle](https://pubnio.com/docs/concepts/post-lifecycle/)

Source: https://pubnio.com/docs/reference/posts-delete/index.mdx
