SuperDocs Demo

Create Post

Create a new blog post

POST /posts

Overview

Creates a new blog post. Requires authentication.

Authorization

Request Body

Body Parameters

title required
string

Title of the post

body required
string

Content of the post. Supports plain text or markdown.

userId required
integer

ID of the user creating the post

Response

Returns the created post object with the assigned ID.

id integer

The auto-generated unique identifier for the new post

title string

The title provided in the request

body string

The content provided in the request

userId integer

The 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

StatusDescription
400Invalid request body - missing required fields
401Unauthorized - missing or invalid Bearer token
Try it out
POST /posts
Authorization
Bearer Token