{
  "info": {
    "name": "Vesper WhatsApp API",
    "description": "Vesper WhatsApp API Gateway — REST API for sending and receiving WhatsApp messages, managing sessions, webhooks, and groups.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "version": "1.0.0"
  },
  "variable": [
    { "key": "baseUrl", "value": "https://api.vespergateway.com/api/v1", "type": "string" },
    { "key": "apiKey", "value": "vsp_YOUR_API_KEY_HERE", "type": "string" }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      { "key": "key", "value": "x-api-key", "type": "string" },
      { "key": "value", "value": "{{apiKey}}", "type": "string" },
      { "key": "in", "value": "header", "type": "string" }
    ]
  },
  "item": [
    {
      "name": "Sessions",
      "item": [
        {
          "name": "Create Session",
          "request": {
            "method": "POST",
            "url": "{{baseUrl}}/sessions",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"my-session\"\n}"
            },
            "description": "Create a new WhatsApp session. Scan the QR code to connect."
          }
        },
        {
          "name": "List Sessions",
          "request": {
            "method": "GET",
            "url": "{{baseUrl}}/sessions",
            "description": "List all WhatsApp sessions for this app."
          }
        },
        {
          "name": "Get Session",
          "request": {
            "method": "GET",
            "url": "{{baseUrl}}/sessions/{{sessionName}}",
            "description": "Get details of a specific session."
          }
        },
        {
          "name": "Get QR Code",
          "request": {
            "method": "GET",
            "url": "{{baseUrl}}/sessions/{{sessionName}}/qr",
            "description": "Get QR code for session authentication."
          }
        },
        {
          "name": "Delete Session",
          "request": {
            "method": "DELETE",
            "url": "{{baseUrl}}/sessions/{{sessionName}}",
            "description": "Disconnect and delete a session."
          }
        }
      ]
    },
    {
      "name": "Messaging",
      "item": [
        {
          "name": "Send Text Message",
          "request": {
            "method": "POST",
            "url": "{{baseUrl}}/messages/send-text",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sessionName\": \"my-session\",\n  \"to\": \"905551234567\",\n  \"text\": \"Hello from Vesper!\"\n}"
            },
            "description": "Send a text message via WhatsApp."
          }
        },
        {
          "name": "Send Image",
          "request": {
            "method": "POST",
            "url": "{{baseUrl}}/messages/send-image",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sessionName\": \"my-session\",\n  \"to\": \"905551234567\",\n  \"url\": \"https://example.com/image.jpg\",\n  \"caption\": \"Check this out!\"\n}"
            },
            "description": "Send an image message via URL or base64."
          }
        },
        {
          "name": "Send Document",
          "request": {
            "method": "POST",
            "url": "{{baseUrl}}/messages/send-document",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sessionName\": \"my-session\",\n  \"to\": \"905551234567\",\n  \"url\": \"https://example.com/file.pdf\",\n  \"filename\": \"invoice.pdf\"\n}"
            },
            "description": "Send a document (PDF, DOCX, etc.)."
          }
        },
        {
          "name": "Send Location",
          "request": {
            "method": "POST",
            "url": "{{baseUrl}}/messages/send-location",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sessionName\": \"my-session\",\n  \"to\": \"905551234567\",\n  \"latitude\": 41.0082,\n  \"longitude\": 28.9784,\n  \"name\": \"Istanbul\"\n}"
            },
            "description": "Send a location pin."
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "Create Webhook",
          "request": {
            "method": "POST",
            "url": "{{baseUrl}}/webhooks",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://your-server.com/webhook\",\n  \"events\": [\"message.received\", \"message.sent\", \"session.status\"]\n}"
            },
            "description": "Register a webhook endpoint to receive events."
          }
        },
        {
          "name": "List Webhooks",
          "request": {
            "method": "GET",
            "url": "{{baseUrl}}/webhooks",
            "description": "List all registered webhooks."
          }
        },
        {
          "name": "Update Webhook",
          "request": {
            "method": "PUT",
            "url": "{{baseUrl}}/webhooks/{{webhookId}}",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://your-server.com/webhook-v2\",\n  \"events\": [\"message.received\"]\n}"
            },
            "description": "Update an existing webhook."
          }
        },
        {
          "name": "Delete Webhook",
          "request": {
            "method": "DELETE",
            "url": "{{baseUrl}}/webhooks/{{webhookId}}",
            "description": "Remove a webhook endpoint."
          }
        }
      ]
    },
    {
      "name": "Groups",
      "item": [
        {
          "name": "List Groups",
          "request": {
            "method": "GET",
            "url": "{{baseUrl}}/groups?sessionName=my-session",
            "description": "List all WhatsApp groups for a session."
          }
        },
        {
          "name": "Get Group Info",
          "request": {
            "method": "GET",
            "url": "{{baseUrl}}/groups/{{groupId}}?sessionName=my-session",
            "description": "Get details of a specific group."
          }
        },
        {
          "name": "Send Group Message",
          "request": {
            "method": "POST",
            "url": "{{baseUrl}}/messages/send-text",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sessionName\": \"my-session\",\n  \"to\": \"120363xxx@g.us\",\n  \"text\": \"Hello group!\"\n}"
            },
            "description": "Send a message to a group (use group JID as 'to')."
          }
        }
      ]
    },
    {
      "name": "Health",
      "item": [
        {
          "name": "Health Check",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/../health",
              "host": ["{{baseUrl}}"],
              "path": ["..", "health"]
            },
            "description": "Check API server health status.",
            "auth": { "type": "noauth" }
          }
        }
      ]
    }
  ]
}
