Skip to main content
This endpoint requires a valid Bearer token. You can only delete posts that belong to your account.

Endpoint

DELETE /api/posts/:postId
Deletion is permanent. There is no recycle bin or undo operation. Deleting a post does not remove already-published content from the platforms themselves.

Path parameters

postId
string
required
MongoDB ObjectId of the post to delete.

Response

success
boolean
required
true on success.
message
string
required
"Post deleted successfully"
data
object
required

Example

curl --request DELETE \
  --url 'https://api.hayon.app/api/posts/64f1a2b3c4d5e6f7a8b9c0d1' \
  --header 'Authorization: Bearer <token>'

Example response

200
{
  "success": true,
  "message": "Post deleted successfully",
  "data": {
    "postId": "64f1a2b3c4d5e6f7a8b9c0d1"
  }
}

Error responses

404
{
  "success": false,
  "message": "Post not found or unauthorized"
}

Build docs developers (and LLMs) love