DELETE /posts/{postId}

Deletes a post (only author or admin can perform this action).

Path parameters

  • postId string Required

    The post ID

Responses

  • 204

    Post deleted successfully

  • 401 application/json

    Unauthorized - Invalid or missing authentication token

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 403 application/json

    Forbidden - Only post author or admin can delete

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 404 application/json

    Post not found

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
DELETE /posts/{postId}
curl \
 --request DELETE 'https://api.huy-devops.site/api/posts/{postId}' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (401)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (403)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (404)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (500)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}