> ## 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.

# Toggle like

> Like or unlike a blog post

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

## Path parameters

<ParamField path="id" type="string" required>
  The post ID
</ParamField>

## Response

<ResponseField name="liked" type="boolean">
  `true` if the post is now liked, `false` if unliked
</ResponseField>

<ResponseField name="likesCount" type="number">
  Updated total likes count
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api-verifier-2.onrender.com/api/blog/65a1b2c3d4e5f6g7h8i9j0k1/toggle-like \
    -H "Authorization: Bearer <your-token>"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Liked theme={null}
  {
    "liked": true,
    "likesCount": 43
  }
  ```

  ```json 200 Unliked theme={null}
  {
    "liked": false,
    "likesCount": 42
  }
  ```
</ResponseExample>
