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
MongoDB ObjectId of the post to delete.
Response
"Post deleted successfully"
MongoDB ObjectId of the deleted post.
Example
curl --request DELETE \
--url 'https://api.hayon.app/api/posts/64f1a2b3c4d5e6f7a8b9c0d1' \
--header 'Authorization: Bearer <token>'
Example response
{
"success" : true ,
"message" : "Post deleted successfully" ,
"data" : {
"postId" : "64f1a2b3c4d5e6f7a8b9c0d1"
}
}
Error responses
{
"success" : false ,
"message" : "Post not found or unauthorized"
}