# Move a post to the trash

Moves the post to the trash, where it stays for the installation retention period (30 days by default) before it is deleted forever. Channels still scheduled are cancelled in the same step, with their usual publication.cancelled events, and a pending retry of a failed channel is cancelled. Refused with post_sending while a channel is being sent and with post_needs_answer while a channel waits for someone to record what happened. Removing a post with a published channel requires a project owner, or an editor when the project policy editorsCanRemovePublishedPosts is on; it removes the post from Postdot only, never from the platform. Pass expectedPublishedPublicationIds (the published channels the person confirmed) to refuse with write_conflict when that set changed meanwhile. Emits post.deleted. API keys need publication:delete.

URL: /docs/reference/posts/deletePost

```json
{"openapi":"3.0.3","info":{"title":"Postdot API","description":"The HTTP API for the lightweight, self-hosted Postdot publication orchestrator.","version":"0.1.0"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Postdot API key","description":"A user-owned Postdot API key sent as `Authorization: Bearer <token>`. Its project scope is limited by the creator’s current access."},"sessionCookie":{"type":"apiKey","in":"cookie","name":"better-auth.session_token","description":"The Better Auth email/password session cookie used by the web application."}},"schemas":{}},"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"tags":[{"name":"System","description":"Service health and runtime information."},{"name":"Access","description":"Instance membership and invitations."},{"name":"Projects","description":"Project lifecycle and access."},{"name":"Channels","description":"Project publication destinations."},{"name":"Posts","description":"Source posts and publication creation."},{"name":"Publications","description":"Publication workflow operations."},{"name":"Taxonomy","description":"Project categories and publication tags."},{"name":"Media","description":"Project media assets and uploads."},{"name":"Settings","description":"Instance-level runtime configuration."},{"name":"Audit","description":"Project audit history."},{"name":"Notifications","description":"Signed-in user notification inboxes with optional project context."},{"name":"Analytics","description":"Provider-neutral publication and execution analytics."},{"name":"Provider Analytics","description":"Persisted provider-owned metric observations."},{"name":"Webhooks","description":"Project webhook subscriptions and delivery history."}],"paths":{"/api/projects/{projectId}/posts/{postId}":{"delete":{"operationId":"deletePost","summary":"Move a post to the trash","tags":["Posts"],"description":"Moves the post to the trash, where it stays for the installation retention period (30 days by default) before it is deleted forever. Channels still scheduled are cancelled in the same step, with their usual publication.cancelled events, and a pending retry of a failed channel is cancelled. Refused with post_sending while a channel is being sent and with post_needs_answer while a channel waits for someone to record what happened. Removing a post with a published channel requires a project owner, or an editor when the project policy editorsCanRemovePublishedPosts is on; it removes the post from Postdot only, never from the platform. Pass expectedPublishedPublicationIds (the published channels the person confirmed) to refuse with write_conflict when that set changed meanwhile. Emits post.deleted. API keys need publication:delete.","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"postId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedPublishedPublicationIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100,"uniqueItems":true}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"expectedPublishedPublicationIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100,"uniqueItems":true}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"expectedPublishedPublicationIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100,"uniqueItems":true}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["post"],"properties":{"post":{"type":"object","required":["id","projectId","title","sourceExcerpt","createdAt","deletedAt","purgeAt","deletedBy","publications"],"properties":{"id":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceExcerpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0},"deletedAt":{"type":"integer","minimum":0},"purgeAt":{"type":"integer","minimum":0},"deletedBy":{"anyOf":[{"type":"object","required":["id","displayName"],"properties":{"id":{"type":"string","minLength":1},"displayName":{"type":"string"}}},{"type":"null"}]},"publications":{"type":"array","items":{"type":"object","required":["id","channelId","channelName","state","deliveryMode","scheduledAt","publishedAt","externalUrl"],"properties":{"id":{"type":"string","minLength":1},"channelId":{"type":"string","minLength":1},"channelName":{"type":"string"},"state":{"enum":["draft","scheduled","ready","publishing","published","failed","ambiguous","cancelled"]},"deliveryMode":{"enum":["manual","automatic"]},"scheduledAt":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"externalUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"confirmation":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","required":["channelId","rule","period","maximum","count"],"properties":{"channelId":{"type":"string"},"rule":{"type":"string","enum":["daily_max","weekly_max"]},"period":{"type":"string"},"maximum":{"type":"integer"},"count":{"type":"integer"}}}},"code":{"type":"string"},"message":{"type":"string"},"publicationIds":{"type":"array","items":{"type":"string"}}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"confirmation":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","required":["channelId","rule","period","maximum","count"],"properties":{"channelId":{"type":"string"},"rule":{"type":"string","enum":["daily_max","weekly_max"]},"period":{"type":"string"},"maximum":{"type":"integer"},"count":{"type":"integer"}}}},"code":{"type":"string"},"message":{"type":"string"},"publicationIds":{"type":"array","items":{"type":"string"}}}}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"confirmation":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","required":["channelId","rule","period","maximum","count"],"properties":{"channelId":{"type":"string"},"rule":{"type":"string","enum":["daily_max","weekly_max"]},"period":{"type":"string"},"maximum":{"type":"integer"},"count":{"type":"integer"}}}},"code":{"type":"string"},"message":{"type":"string"},"publicationIds":{"type":"array","items":{"type":"string"}}}}}}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"confirmation":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","required":["channelId","rule","period","maximum","count"],"properties":{"channelId":{"type":"string"},"rule":{"type":"string","enum":["daily_max","weekly_max"]},"period":{"type":"string"},"maximum":{"type":"integer"},"count":{"type":"integer"}}}},"code":{"type":"string"},"message":{"type":"string"},"publicationIds":{"type":"array","items":{"type":"string"}}}}}}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"confirmation":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","required":["channelId","rule","period","maximum","count"],"properties":{"channelId":{"type":"string"},"rule":{"type":"string","enum":["daily_max","weekly_max"]},"period":{"type":"string"},"maximum":{"type":"integer"},"count":{"type":"integer"}}}},"code":{"type":"string"},"message":{"type":"string"},"publicationIds":{"type":"array","items":{"type":"string"}}}}}}}}},"422":{"description":"Response for status 422","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"confirmation":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","required":["channelId","rule","period","maximum","count"],"properties":{"channelId":{"type":"string"},"rule":{"type":"string","enum":["daily_max","weekly_max"]},"period":{"type":"string"},"maximum":{"type":"integer"},"count":{"type":"integer"}}}},"code":{"type":"string"},"message":{"type":"string"},"publicationIds":{"type":"array","items":{"type":"string"}}}}}}}}}}}}},"servers":[{"url":"https://postdot.example","description":"Replace with your Postdot instance origin."}]}
```
