{
  "info": {
    "name": "Nodemeta Backend - Newsletter Module API",
    "description": "API documentation for the Newsletter module endpoints. This collection includes newsletter subscription management and subscriber administration.\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## Security Levels:\n- **Public**: No authentication required (subscribe endpoint)\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 Newsletter Operations",
      "item": [
        {
          "name": "Subscribe to Newsletter",
          "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  \"email\": \"user@example.com\",\n  \"name\": \"John Doe\",\n  \"phone\": \"+1234567890\",\n  \"interests\": \"Technology, Blockchain\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/newsletter/subscribe",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "newsletter",
                "subscribe"
              ]
            },
            "description": "Subscribe to the newsletter. Email is required, other fields are optional. If email already exists, subscription will be updated. Public endpoint."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Admin Subscriber Management",
      "item": [
        {
          "name": "List Subscribers",
          "request": {
            "method": "GET",
            "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}}/newsletter?page=1&limit=20&search=&sortBy=createdAt&sortOrder=desc",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "newsletter"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "description": "Page number for pagination"
                },
                {
                  "key": "limit",
                  "value": "20",
                  "description": "Number of subscribers per page"
                },
                {
                  "key": "search",
                  "value": "",
                  "description": "Search term for email or name"
                },
                {
                  "key": "sortBy",
                  "value": "createdAt",
                  "description": "Sort field (createdAt, email, name)"
                },
                {
                  "key": "sortOrder",
                  "value": "desc",
                  "description": "Sort order (asc, desc)"
                }
              ]
            },
            "description": "Get paginated list of newsletter subscribers with optional search and filters. Requires admin authentication and signature."
          },
          "response": []
        },
        {
          "name": "Get Subscriber by ID",
          "request": {
            "method": "GET",
            "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}}/newsletter/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "newsletter",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "subscriber-id-here",
                  "description": "Subscriber ID"
                }
              ]
            },
            "description": "Get a specific newsletter subscriber by ID. Requires admin authentication and signature."
          },
          "response": []
        },
        {
          "name": "Update Subscriber",
          "request": {
            "method": "PUT",
            "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  \"name\": \"Updated Name\",\n  \"phone\": \"+1987654321\",\n  \"interests\": \"Updated interests\",\n  \"active\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/newsletter/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "newsletter",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "subscriber-id-here",
                  "description": "Subscriber ID to update"
                }
              ]
            },
            "description": "Update subscriber information. All fields are optional. Requires admin authentication and signature."
          },
          "response": []
        },
        {
          "name": "Delete Subscriber",
          "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}}/newsletter/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "newsletter",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "subscriber-id-here",
                  "description": "Subscriber ID to delete"
                }
              ]
            },
            "description": "Delete a newsletter subscriber. Requires admin authentication and signature."
          },
          "response": []
        },
        {
          "name": "Toggle Subscriber Status",
          "request": {
            "method": "PATCH",
            "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}}/newsletter/:id/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "newsletter",
                ":id",
                "status"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "subscriber-id-here",
                  "description": "Subscriber ID"
                }
              ]
            },
            "description": "Toggle the active status of a newsletter subscriber. 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)"
    }
  ]
}