The auto-generated unique identifier for the new post
Create Post
Create a new blog post
POST
/postsOverview
Creates a new blog post. Requires authentication.
Authorization
Note
This endpoint requires a Bearer token for authentication.
Request Body
Body Parameters
title requiredTitle of the post
body requiredContent of the post. Supports plain text or markdown.
userId requiredID of the user creating the post
Response
Returns the created post object with the assigned ID.
id integertitle stringThe title provided in the request
body stringThe content provided in the request
userId integerThe user ID provided in the request
Example Request
{ "title": "My First Blog Post", "body": "This is the content of my first blog post. It supports **markdown** formatting!", "userId": 1}Example Response
{ "id": 101, "title": "My First Blog Post", "body": "This is the content of my first blog post. It supports **markdown** formatting!", "userId": 1}Error Responses
| Status | Description |
|---|---|
400 | Invalid request body - missing required fields |
401 | Unauthorized - missing or invalid Bearer token |
Try it out
POST
/posts Authorization
Bearer Token