dambel

دمبل

shevron
ورود | ثبت نام

API Docs / comments / update



PUT /api/v1/comments/{comment-id}

Updates the content of an existing comment by its ID.


Permissions

PermissionDescription
comments.updateUpdate your own comment

Path Parameters

NameTypeRequiredDescriptionExample
comment-idintYesID of the comment to update123

Request Body Parameters

NameTypeRequiredDescriptionExample
contentstringYesNew content for the comment (max 255 characters)"Updated comment!"

Request Example

{
  "content": "Updated comment!"
}

Response

200 OK

Returns the updated comment resource.

Schema

{
  "comment": { /* Comment Resource */ }
}

Example

{
  "comment": {
    "id": 123,
    "user_id": 456,
    "commentable_type": "App\\Models\\Gyms\\Gym",
    "commentable_id": 42,
    "content": "Updated comment!",
    "parent_comment_id": 10,
    "created_at": "2025-01-01 00:00:00",
    "updated_at": "2025-01-01 00:10:00"
  }
}

For a full schema, see Comment Resource.


Error Responses

StatusDescriptionReference
422Validation errorValidation error
401UnauthorizedAuthentication error
403Forbidden (no permission)Permission error
footer wave
logo

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutube