---
title: "Delete a draft post"
method: DELETE
path: "/posts/{postId}"
tags: ["Posts"]
---

# Delete a draft post

`DELETE /posts/{postId}`

## Request

- Base URL: `https://www.juzpost.com/api/cli/v1`
- URL: `https://www.juzpost.com/api/cli/v1/posts/{postId}`
- Auth: HTTP bearer

Permanently deletes a post that is still in `draft` status, along with its per-account
target rows. A scheduled or published post cannot be deleted and returns `409`. Media
the post referenced is released back to orphan state and will be removed by the upload
sweeper unless another post claims it.

## Path parameters

- `postId` string, uuid, required

## Response `200`

Draft deleted.

- DeletedPost: Confirmation that the draft was deleted, with what it was.
  - `deleted` boolean, required: Always true. The post and its target rows are gone.
  - `post` object, required: The deleted draft, so a caller can name it without keeping a copy.
    - `title` string, nullable, required: The draft's title, if one was set.
    - `content` string, nullable, required: The caption.
    - `type` string, required: The post type: text, image, video, story or blog.
    - `mediaCount` integer, required: How many media files were attached.

## Other responses

- `401`: No bearer token was sent, or the token is unknown, revoked or malformed. Run the device login again to obtain a new token.
- `402`: The plan behind this token does not include the capability this operation needs. `error.details.requiredPlan` names the tier that does. This is never a token problem, so do not retry without changing the plan.
- `404`: No such resource. A resource that belongs to someone else is also reported here, so this never confirms whether another tenant's id exists.
- `409`: The resource is not in a state that allows this operation, typically a post that has already left `draft` status. Re-read the resource before retrying.

---

[API](https://skmtc.dev/juzpost/apis/juzpost-rest-api.md) · [All operations](https://skmtc.dev/juzpost/apis/juzpost-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/juzpost/apis/juzpost-rest-api/revisions/19296da24f95?raw)
