Skip to main content
POST
/
posts
Create a post
curl --request POST \
  --url https://jsonplaceholder.typicode.com/posts \
  --header 'Content-Type: application/json' \
  --data '
{
  "userId": 123,
  "title": "<string>",
  "body": "<string>"
}
'
{
  "userId": 123,
  "id": 123,
  "title": "<string>",
  "body": "<string>"
}
Overview
  • Creates a new post. JSONPlaceholder fakes creation and responds with a new id.
  • Great for demonstrating request bodies, validation, and response handling without needing a backend.
Request body
  • userId (number, required): The author id.
  • title (string, required): Title for the post.
  • body (string, required): The content.
Example usage
- name: Create a post
  method: POST
  path: /posts
  headers:
    Content-Type: application/json
  body:
    json:
      userId: 1
      title: "Hello Mintlify"
      body: "This is a demo post created from the API playground."
Response notes
  • Status 201: Returns the post object with a generated id.
  • JSONPlaceholder does not persist data; subsequent GETs won’t include this post.
Tips
  • Use this alongside GET /posts to illustrate the difference between mocked creation and read-only data.

Body

application/json
userId
integer
required
title
string
required
body
string
required

Response

201 - application/json

Created post (mocked)

userId
integer
id
integer
title
string
body
string