TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pvnm4/Social-Media-Backend/llms.txt
Use this file to discover all available pages before exploring further.
PUT /posts/{id} endpoint fully replaces the content of an existing post. Because this is a PUT (not PATCH), all fields must be provided — omitting a field resets it to its default value. Only the user who originally created the post can update it; attempting to update a post owned by another user returns a 403 Forbidden error.
Endpoint
Authorization header.
Path Parameters
The unique numeric identifier of the post to update.
Request Body
The new title for the post. Replaces the existing title entirely.
The new body/content for the post. Replaces the existing content entirely.
The new published status. Replaces the existing value. Defaults to
true if omitted.Response
HTTP 200 OK — Returns the updatedPost object.
The unique numeric ID of the updated post.
The updated title of the post.
The updated body/content of the post.
The updated published status of the post.
ISO 8601 timestamp of when the post was originally created. This value is not changed by an update.
Details of the user who owns the post.
Error Responses
| Status Code | Description |
|---|---|
401 Unauthorized | No token was provided or the token is invalid/expired. |
403 Forbidden | The authenticated user is not the owner of this post. Message: "Not authorized to perform requested action". |
404 Not Found | No post with the specified id exists. Message: "Post with the id:{id} does not exists". |
422 Unprocessable Entity | The request body is missing required fields or contains invalid values. |
Examples
Successful Response Example
403 Forbidden Response Example
404 Not Found Response Example
This endpoint performs a full replacement. All fields (
title, content, published) must be included in every request. Omitting published will reset it to its default value of true.