curl -X DELETE https://api-verifier-2.onrender.com/api/blog/65a1b2c3d4e5f6g7h8i9j0k1 \
-H "Authorization: Bearer <your-token>"
{
"message": "Post deleted successfully"
}
{
"error": "Forbidden"
}
{
"error": "Post not found"
}
Blog
Delete post
Delete a blog post
DELETE
/
api
/
blog
/
{id}
curl -X DELETE https://api-verifier-2.onrender.com/api/blog/65a1b2c3d4e5f6g7h8i9j0k1 \
-H "Authorization: Bearer <your-token>"
{
"message": "Post deleted successfully"
}
{
"error": "Forbidden"
}
{
"error": "Post not found"
}
This endpoint requires authentication. Only the author or an admin can delete a post.
Path parameters
string
required
The post ID
Response
string
Deletion confirmation message
- Draft/pending posts: Permanently deleted
- Public posts by author: Soft deleted (marked as “deleted”)
- Any post by admin: Permanently deleted
curl -X DELETE https://api-verifier-2.onrender.com/api/blog/65a1b2c3d4e5f6g7h8i9j0k1 \
-H "Authorization: Bearer <your-token>"
{
"message": "Post deleted successfully"
}
{
"error": "Forbidden"
}
{
"error": "Post not found"
}