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

# Create post

> Create a new blog post

<Note>
  This endpoint requires authentication.
</Note>

## Request body

<ParamField body="title" type="string" required>
  Post title
</ParamField>

<ParamField body="contentRaw" type="string" required>
  Post content (markdown or HTML)
</ParamField>

<ParamField body="summary" type="string">
  Brief summary of the post
</ParamField>

<ParamField body="tags" type="array">
  Array of tag strings
</ParamField>

<ParamField body="coverImageUrl" type="string">
  URL of the cover image
</ParamField>

<ParamField body="publish" type="boolean">
  If `true`, submits for approval. If `false`, saves as draft.
</ParamField>

## Response

Returns the created blog post object.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api-verifier-2.onrender.com/api/blog \
    -H "Authorization: Bearer <your-token>" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "My Trading Strategy",
      "contentRaw": "# Introduction\n\nThis is my trading strategy...",
      "summary": "A detailed look at my trading approach",
      "tags": ["strategy", "trading"],
      "coverImageUrl": "https://example.com/cover.jpg",
      "publish": true
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "_id": "65a1b2c3d4e5f6g7h8i9j0k1",
    "title": "My Trading Strategy",
    "slug": "my-trading-strategy-xyz789",
    "summary": "A detailed look at my trading approach",
    "content": "# Introduction\n\nThis is my trading strategy...",
    "contentRaw": "# Introduction\n\nThis is my trading strategy...",
    "tags": ["strategy", "trading"],
    "coverImageUrl": "https://example.com/cover.jpg",
    "authorId": "user-id-here",
    "visibility": "pending",
    "createdAt": "2024-01-15T10:00:00.000Z"
  }
  ```
</ResponseExample>
