{
  "info": {
    "name": "Nodemeta Backend - Blogs Module API",
    "description": "API documentation for the Blogs module endpoints. This collection includes blog management, comments, and user interactions.\n\n## Required Headers:\n\n### Standard Headers:\n- **Content-Type**: `application/json` (for requests with body)\n- **Authorization**: `Bearer <token>` (for admin endpoints)\n- **X-Request-Id**: Optional request tracking ID\n\n### Admin Endpoints (require signature verification):\n- **X-Signature**: RSA signature of the request\n- **X-Nonce**: Unique nonce to prevent replay attacks\n- **X-Timestamp**: Request timestamp\n\n### File Upload:\n- **Content-Type**: `multipart/form-data` (for blog creation/update with images)\n\n## Security Levels:\n- **Public**: No authentication required\n- **Admin**: Requires JWT token + admin role + request signature",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "12345678"
  },
  "item": [
    {
      "name": "Public Blog Operations",
      "item": [
        {
          "name": "List Blogs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Request-Id",
                "value": "{{requestId}}",
                "description": "Optional: Request tracking ID"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/blogs?page=1&limit=20&search=&category=&sortBy=createdAt&sortOrder=desc",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "blogs"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "description": "Page number for pagination"
                },
                {
                  "key": "limit",
                  "value": "20",
                  "description": "Number of blogs per page"
                },
                {
                  "key": "search",
                  "value": "",
                  "description": "Search term for blog title/content"
                },
                {
                  "key": "category",
                  "value": "",
                  "description": "Filter by category"
                },
                {
                  "key": "sortBy",
                  "value": "createdAt",
                  "description": "Sort field (createdAt, title, views, likes)"
                },
                {
                  "key": "sortOrder",
                  "value": "desc",
                  "description": "Sort order (asc, desc)"
                }
              ]
            },
            "description": "Get paginated list of blogs with optional search and filters. Public endpoint."
          },
          "response": []
        },
        {
          "name": "Get Blog by Slug",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Request-Id",
                "value": "{{requestId}}",
                "description": "Optional: Request tracking ID"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/blogs/slug/:slug",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "blogs",
                "slug",
                ":slug"
              ],
              "variable": [
                {
                  "key": "slug",
                  "value": "sample-blog-slug",
                  "description": "Blog slug"
                }
              ]
            },
            "description": "Get a specific blog post by its slug. Public endpoint."
          },
          "response": []
        },
        {
          "name": "Get Blog Comments",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Request-Id",
                "value": "{{requestId}}",
                "description": "Optional: Request tracking ID"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/blogs/:id/comments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "blogs",
                ":id",
                "comments"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "blog-id-here",
                  "description": "Blog ID"
                }
              ]
            },
            "description": "Get all comments for a specific blog post. Public endpoint."
          },
          "response": []
        },
        {
          "name": "Handle Blog Action",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Request-Id",
                "value": "{{requestId}}",
                "description": "Optional: Request tracking ID"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"blogId\": \"blog-id-here\",\n  \"action\": \"view\",\n  \"userId\": \"optional-user-id\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/blogs/actions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "blogs",
                "actions"
              ]
            },
            "description": "Handle view or like actions on blogs. Action can be 'view' or 'like'. userId is required for 'like' action. Public endpoint."
          },
          "response": []
        },
        {
          "name": "Create Comment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Request-Id",
                "value": "{{requestId}}",
                "description": "Optional: Request tracking ID"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"text\": \"This is a comment\",\n  \"author\": \"John Doe\",\n  \"userId\": \"optional-user-id\",\n  \"parentId\": \"optional-parent-comment-id\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/blogs/:id/comments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "blogs",
                ":id",
                "comments"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "blog-id-here",
                  "description": "Blog ID"
                }
              ]
            },
            "description": "Create a new comment on a blog post. parentId is optional for replies. Public endpoint."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Admin Blog Management",
      "item": [
        {
          "name": "Create Blog",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{authToken}}"
              },
              {
                "key": "X-Request-Id",
                "value": "{{requestId}}",
                "description": "Optional: Request tracking ID"
              },
              {
                "key": "X-Signature",
                "value": "{{signature}}",
                "description": "RSA signature for request verification (required for admin endpoints)"
              },
              {
                "key": "X-Nonce",
                "value": "{{nonce}}",
                "description": "Unique nonce to prevent replay attacks"
              },
              {
                "key": "X-Timestamp",
                "value": "{{timestamp}}",
                "description": "Request timestamp"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "title",
                  "value": "Sample Blog Title",
                  "description": "Blog title",
                  "type": "text"
                },
                {
                  "key": "subtitle",
                  "value": "Sample subtitle",
                  "description": "Blog subtitle",
                  "type": "text"
                },
                {
                  "key": "description",
                  "value": "Blog description",
                  "description": "Short description",
                  "type": "text"
                },
                {
                  "key": "content",
                  "value": "<p>Blog content in HTML</p>",
                  "description": "Full blog content",
                  "type": "text"
                },
                {
                  "key": "category",
                  "value": "Technology",
                  "description": "Blog category",
                  "type": "text"
                },
                {
                  "key": "author",
                  "value": "NodeMeta Team",
                  "description": "Author name",
                  "type": "text"
                },
                {
                  "key": "date",
                  "value": "2025-12-30",
                  "description": "Publication date",
                  "type": "text"
                },
                {
                  "key": "featured",
                  "value": "false",
                  "description": "Whether blog is featured",
                  "type": "text"
                },
                {
                  "key": "slug",
                  "value": "sample-blog-slug",
                  "description": "URL slug (auto-generated if empty)",
                  "type": "text"
                },
                {
                  "key": "image",
                  "description": "Blog image file",
                  "type": "file"
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/blogs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "blogs"
              ]
            },
            "description": "Create a new blog post with image upload. Requires admin authentication and signature. Content-Type is multipart/form-data."
          },
          "response": []
        },
        {
          "name": "Update Blog",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{authToken}}"
              },
              {
                "key": "X-Request-Id",
                "value": "{{requestId}}",
                "description": "Optional: Request tracking ID"
              },
              {
                "key": "X-Signature",
                "value": "{{signature}}",
                "description": "RSA signature for request verification (required for admin endpoints)"
              },
              {
                "key": "X-Nonce",
                "value": "{{nonce}}",
                "description": "Unique nonce to prevent replay attacks"
              },
              {
                "key": "X-Timestamp",
                "value": "{{timestamp}}",
                "description": "Request timestamp"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "title",
                  "value": "Updated Blog Title",
                  "description": "Blog title",
                  "type": "text"
                },
                {
                  "key": "subtitle",
                  "value": "Updated subtitle",
                  "description": "Blog subtitle",
                  "type": "text"
                },
                {
                  "key": "description",
                  "value": "Updated description",
                  "description": "Short description",
                  "type": "text"
                },
                {
                  "key": "content",
                  "value": "<p>Updated blog content</p>",
                  "description": "Full blog content",
                  "type": "text"
                },
                {
                  "key": "category",
                  "value": "Technology",
                  "description": "Blog category",
                  "type": "text"
                },
                {
                  "key": "author",
                  "value": "NodeMeta Team",
                  "description": "Author name",
                  "type": "text"
                },
                {
                  "key": "date",
                  "value": "2025-12-30",
                  "description": "Publication date",
                  "type": "text"
                },
                {
                  "key": "featured",
                  "value": "false",
                  "description": "Whether blog is featured",
                  "type": "text"
                },
                {
                  "key": "slug",
                  "value": "updated-blog-slug",
                  "description": "URL slug",
                  "type": "text"
                },
                {
                  "key": "existingImage",
                  "value": "path/to/existing/image.jpg",
                  "description": "Path to existing image if not uploading new one",
                  "type": "text"
                },
                {
                  "key": "image",
                  "description": "New blog image file (optional)",
                  "type": "file"
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/blogs/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "blogs",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "blog-id-here",
                  "description": "Blog ID to update"
                }
              ]
            },
            "description": "Update an existing blog post with optional image upload. Requires admin authentication and signature. Content-Type is multipart/form-data."
          },
          "response": []
        },
        {
          "name": "Delete Blog",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{authToken}}"
              },
              {
                "key": "X-Request-Id",
                "value": "{{requestId}}",
                "description": "Optional: Request tracking ID"
              },
              {
                "key": "X-Signature",
                "value": "{{signature}}",
                "description": "RSA signature for request verification (required for admin endpoints)"
              },
              {
                "key": "X-Nonce",
                "value": "{{nonce}}",
                "description": "Unique nonce to prevent replay attacks"
              },
              {
                "key": "X-Timestamp",
                "value": "{{timestamp}}",
                "description": "Request timestamp"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/blogs/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "blogs",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "blog-id-here",
                  "description": "Blog ID to delete"
                }
              ]
            },
            "description": "Delete a blog post. Requires admin authentication and signature."
          },
          "response": []
        },
        {
          "name": "Toggle Blog Status",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{authToken}}"
              },
              {
                "key": "X-Request-Id",
                "value": "{{requestId}}",
                "description": "Optional: Request tracking ID"
              },
              {
                "key": "X-Signature",
                "value": "{{signature}}",
                "description": "RSA signature for request verification (required for admin endpoints)"
              },
              {
                "key": "X-Nonce",
                "value": "{{nonce}}",
                "description": "Unique nonce to prevent replay attacks"
              },
              {
                "key": "X-Timestamp",
                "value": "{{timestamp}}",
                "description": "Request timestamp"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"active\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/blogs/:id/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "blogs",
                ":id",
                "status"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "blog-id-here",
                  "description": "Blog ID"
                }
              ]
            },
            "description": "Activate or deactivate a blog post. Requires admin authentication and signature."
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:3000",
      "type": "string",
      "description": "Base URL for the API"
    },
    {
      "key": "authToken",
      "value": "",
      "type": "string",
      "description": "JWT authentication token"
    },
    {
      "key": "requestId",
      "value": "",
      "type": "string",
      "description": "Optional: Request tracking ID (auto-generated if empty)"
    },
    {
      "key": "signature",
      "value": "",
      "type": "string",
      "description": "RSA signature for admin endpoints (required)"
    },
    {
      "key": "nonce",
      "value": "",
      "type": "string",
      "description": "Unique nonce for admin endpoints (required)"
    },
    {
      "key": "timestamp",
      "value": "",
      "type": "string",
      "description": "Request timestamp for admin endpoints (required)"
    }
  ]
}