{
  "info": {
    "_postman_id": "whatsapp-multitenant-gateway-collection",
    "name": "WhatsApp Multi-Tenant Gateway & SaaS API",
    "description": "Complete Postman API Collection for WhatsApp Multi-Tenant Gateway, Multi-Session Message Dispatching, Webhooks, and Master Admin APIs.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://sachalabdullah.shop",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "YOUR_API_KEY_HERE",
      "type": "string"
    },
    {
      "key": "recipientPhone",
      "value": "03001234567",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "📤 Send Messages (Developer API)",
      "item": [
        {
          "name": "1. Send Plain Text Message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{apiKey}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"{{recipientPhone}}\",\n  \"message\": \"Hello! This is a test message from WhatsApp Gateway API.\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/send",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "send"]
            },
            "description": "Send a standard text message to a Pakistani local number (0300...) or international format with country code (92300...)."
          }
        },
        {
          "name": "2. Send PDF Document (File Upload)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "phone",
                  "value": "{{recipientPhone}}",
                  "type": "text"
                },
                {
                  "key": "message",
                  "value": "Please find attached your invoice PDF.",
                  "type": "text"
                },
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                },
                {
                  "key": "send_as_document",
                  "value": "true",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/send",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "send"]
            },
            "description": "Send a PDF, Word, Excel, or ZIP document directly using multipart/form-data file upload."
          }
        },
        {
          "name": "3. Send Photo / Image (File Upload)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "phone",
                  "value": "{{recipientPhone}}",
                  "type": "text"
                },
                {
                  "key": "message",
                  "value": "Here is your product photo!",
                  "type": "text"
                },
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/send",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "send"]
            },
            "description": "Send an image (JPG, PNG, WEBP) with an optional text caption."
          }
        },
        {
          "name": "4. Send Media via Public URL",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{apiKey}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"{{recipientPhone}}\",\n  \"media_url\": \"https://images.unsplash.com/photo-1579202673506-ca3ce28943ef?w=800\",\n  \"caption\": \"Beautiful artwork via URL\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/send",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "send"]
            },
            "description": "Provide a direct public URL to an image or PDF. The server downloads and dispatches it over WhatsApp."
          }
        },
        {
          "name": "5. Bulk Message Dispatch",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{apiKey}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"numbers\": [\n    \"03001234567\",\n    \"03211234567\",\n    \"03451234567\"\n  ],\n  \"message\": \"Dear customer, our annual sale is now live!\",\n  \"delay_ms\": 1000\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/send-bulk",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "send-bulk"]
            },
            "description": "Send the same message to multiple numbers with automatic rate-limiting delay between numbers."
          }
        }
      ]
    },
    {
      "name": "📊 Logs & Status (Developer API)",
      "item": [
        {
          "name": "Check Instance Status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/status",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "status"]
            },
            "description": "Check whether your WhatsApp account is currently CONNECTED, QR_REQUIRED, or DISCONNECTED."
          }
        },
        {
          "name": "Fetch Message Logs (SQLite DB)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/messages?limit=50&offset=0",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "messages"],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0"
                },
                {
                  "key": "chat_id",
                  "value": "923001234567@c.us",
                  "disabled": true
                }
              ]
            },
            "description": "Query paginated history of all incoming and outgoing messages stored in the database."
          }
        },
        {
          "name": "Fetch Conversations / Chats List",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/chats",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "chats"]
            },
            "description": "Get all conversations with contact names, last messages, unread counts, and timestamps."
          }
        }
      ]
    },
    {
      "name": "⚡ Webhooks",
      "item": [
        {
          "name": "Send Test Webhook Ping",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://webhook.site/your-unique-uuid\",\n  \"secret\": \"my_optional_secret_token\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/webhooks/test",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "webhooks", "test"]
            },
            "description": "Dispatches a mock WhatsApp message.received event to verify your server endpoint."
          }
        }
      ]
    },
    {
      "name": "👑 Master Admin APIs (Management)",
      "item": [
        {
          "name": "1. List All Clients & Global Stats",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/admin/tenants",
              "host": ["{{baseUrl}}"],
              "path": ["api", "admin", "tenants"]
            },
            "description": "Get a list of all client instances, their live WhatsApp statuses, API keys, and stats."
          }
        },
        {
          "name": "2. Create New Client Account",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Client B Clothing Store\",\n  \"email\": \"clientb@example.com\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/admin/tenants",
              "host": ["{{baseUrl}}"],
              "path": ["api", "admin", "tenants"]
            },
            "description": "Creates a new tenant instance, generates an API Key, and starts an isolated WhatsApp session."
          }
        },
        {
          "name": "3. Get Client Live QR Code",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/admin/tenants/main-account/qr",
              "host": ["{{baseUrl}}"],
              "path": ["api", "admin", "tenants", "main-account", "qr"]
            },
            "description": "Fetch live QR Code Data URL for any tenant ID."
          }
        },
        {
          "name": "4. Reset / Force New QR for Client",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/admin/tenants/main-account/reset",
              "host": ["{{baseUrl}}"],
              "path": ["api", "admin", "tenants", "main-account", "reset"]
            },
            "description": "Deletes the client's saved session directory and forces WhatsApp to generate a fresh QR code."
          }
        },
        {
          "name": "5. Delete Client Account",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/admin/tenants/client_slug_id",
              "host": ["{{baseUrl}}"],
              "path": ["api", "admin", "tenants", "client_slug_id"]
            },
            "description": "Permanently deletes a client, their WhatsApp session, and message logs."
          }
        }
      ]
    }
  ]
}
