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.
POST /posts/ endpoint creates a new post and automatically associates it with the currently authenticated user. The owner_id field is derived directly from the JWT token — it cannot be set or overridden in the request body. A valid Bearer token must be included with every request.
Endpoint
Authorization header.
Request Body
The title of the post. Must be a non-empty string.
The body or main content of the post. Must be a non-empty string.
Whether the post should be marked as published. Defaults to
true if not provided.Response
HTTP 201 Created — Returns the newly createdPost object.
The auto-generated unique numeric ID assigned to the new post.
The title of the post as provided in the request.
The body/content of the post as provided in the request.
Whether the post is published.
ISO 8601 timestamp of when the post was created, set automatically by the server.
Details of the authenticated user who created the post.
Error Responses
| Status Code | Description |
|---|---|
401 Unauthorized | No token was provided or the token is invalid/expired. |
422 Unprocessable Entity | The request body is missing required fields or contains invalid values. |