Updates a comment (only comment author or admin can perform this action).
PUT
/comments/{commentId}
curl \
--request PUT 'https://api.huy-devops.site/api/comments/{commentId}' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"content":"Thanks for the update!"}'
Request examples
{
"content": "Thanks for the update!"
}
Response examples (200)
{
"success": true,
"code": 200,
"message": "string",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440009",
"postId": "550e8400-e29b-41d4-a716-446655440008",
"userId": "550e8400-e29b-41d4-a716-446655440002",
"content": "Thanks for the update!",
"createdAt": "2024-09-20T11:00:00Z",
"updatedAt": "2024-09-20T11:30:00Z",
"deletedAt": "2026-05-04T09:42:00Z"
}
}
Response examples (400)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2026-05-04T09:42:00Z"
}
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"
}