Updates a post by its ID. All parameters are optional; only provided fields will be updated.
| Permission | Description |
|---|---|
posts.update | Update your own post |
posts.update_any | Update any post (admin only) |
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| post-id | int | Yes | ID of the post to update | 123 |
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| title | string | No | Title of the post (max 255 characters) | "My Workout" |
| content | string | No | Content of the post (max 2000 characters) | "Did squats..." |
| is_draft | bool | No | Whether the post is a draft | false |
| in_blog | bool | No | Publish the post on the website blog (requires posts.update_any permission) | false |
{
"title": "My Workout",
"content": "Did squats and deadlifts.",
"is_draft": false
}
Returns the updated post resource.
{
"data": {
"id": 123,
"profile_type": "App\\Models\\User",
"profile_id": 42,
"title": "My Workout",
"content": "Did squats and deadlifts.",
"is_draft": false,
"media": []
}
}
See Post Resource.
| Status | Description | Reference |
|---|---|---|
| 422 | Validation error | Validation error |
| 401 | Unauthorized | Authentication error |
| 403 | Forbidden (no permission) | Permission error |
| 404 | Not found | Not-found error |