Login | Sign Up
  • FA
  • EN

API Docs

PUT /api/v1/posts/{post-id}

Updates a post by its ID. All parameters are optional; only provided fields will be updated.


Permissions

PermissionDescription
posts.updateUpdate your own post
posts.update_anyUpdate any post (admin only)

Path Parameters

NameTypeRequiredDescriptionExample
post-idintYesID of the post to update123

Request Body Parameters

NameTypeRequiredDescriptionExample
titlestringNoTitle of the post (max 255 characters)"My Workout"
contentstringNoContent of the post (max 2000 characters)"Did squats..."
is_draftboolNoWhether the post is a draftfalse
in_blogboolNoPublish the post on the website blog (requires posts.update_any permission)false

Request Example

{
  "title": "My Workout",
  "content": "Did squats and deadlifts.",
  "is_draft": false
}

Response

200 OK

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.


Error Responses

StatusDescriptionReference
422Validation errorValidation error
401UnauthorizedAuthentication error
403Forbidden (no permission)Permission error
404Not foundNot-found error
footer wave
logo

Dambel, the smart world of fitness and nutrition

LinkedinInstagramXYoutubeTelegramGitHub