> ## Documentation Index
> Fetch the complete documentation index at: https://docs-m.sajidiftekhar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Post

> Creates a new post (JSONPlaceholder fakes creation and returns an object with an id).

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

```api theme={null}
- 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.


## OpenAPI

````yaml POST /posts
openapi: 3.1.0
info:
  title: JSONPlaceholder Demo API
  description: >-
    Demo OpenAPI spec wired to JSONPlaceholder
    (https://jsonplaceholder.typicode.com) to showcase Mintlify 'Try it out'.
  version: 1.0.0
servers:
  - url: https://jsonplaceholder.typicode.com
security: []
paths:
  /posts:
    post:
      summary: Create a post
      description: >-
        Creates a new post (JSONPlaceholder fakes creation and returns an object
        with an id).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewPost'
      responses:
        '201':
          description: Created post (mocked)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
components:
  schemas:
    NewPost:
      type: object
      required:
        - title
        - body
        - userId
      properties:
        userId:
          type: integer
        title:
          type: string
        body:
          type: string
    Post:
      type: object
      properties:
        userId:
          type: integer
        id:
          type: integer
        title:
          type: string
        body:
          type: string

````