﻿{
  "info": {
    "name": "WhatsApp Mini API",
    "description": "ColeÃ§Ã£o completa da API WhatsApp Mini",
    "version": "1.0.0"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://whatsmini.aledrosistemas.com.br"
    },
    {
      "key": "instance",
      "value": "5515996361986"
    }
  ],
  "item": [
    {
      "name": "Health Check",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/health",
          "host": ["{{baseUrl}}"],
          "path": ["api", "health"]
        }
      }
    },
    {
      "name": "Statistics",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/stats",
          "host": ["{{baseUrl}}"],
          "path": ["api", "stats"]
        }
      }
    },
    {
      "name": "Monitor",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/monitor",
          "host": ["{{baseUrl}}"],
          "path": ["api", "monitor"]
        }
      }
    },
    {
      "name": "List Instances",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/instances",
          "host": ["{{baseUrl}}"],
          "path": ["api", "instances"]
        }
      }
    },
    {
      "name": "Start Instance",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"empCodigo\": \"233\",\n  \"titulo\": \"InstÃ¢ncia de Teste\",\n  \"numero\": \"{{instance}}\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/instances/{{instance}}/start",
          "host": ["{{baseUrl}}"],
          "path": ["api", "instances", "{{instance}}", "start"]
        }
      }
    },
    {
      "name": "Get Instance Status",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/instances/{{instance}}/status",
          "host": ["{{baseUrl}}"],
          "path": ["api", "instances", "{{instance}}", "status"]
        }
      }
    },
    {
      "name": "Get QR Code",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/instances/{{instance}}/qr",
          "host": ["{{baseUrl}}"],
          "path": ["api", "instances", "{{instance}}", "qr"]
        }
      }
    },
    {
      "name": "Stop Instance",
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/instances/{{instance}}/stop",
          "host": ["{{baseUrl}}"],
          "path": ["api", "instances", "{{instance}}", "stop"]
        }
      }
    },
    {
      "name": "Get Instance Params",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/instances/{{instance}}/params",
          "host": ["{{baseUrl}}"],
          "path": ["api", "instances", "{{instance}}", "params"]
        }
      }
    },
    {
      "name": "Set Instance Param",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"key\": \"CUSTOM_PARAM\",\n  \"value\": \"test_value\",\n  \"description\": \"ParÃ¢metro de teste\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/instances/{{instance}}/params",
          "host": ["{{baseUrl}}"],
          "path": ["api", "instances", "{{instance}}", "params"]
        }
      }
    },
    {
      "name": "Send Message",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"instance\": \"{{instance}}\",\n  \"to\": \"5511999999999\",\n  \"message\": \"OlÃ¡! Esta Ã© uma mensagem de teste.\",\n  \"userLogin\": \"API_TEST\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/messages/send",
          "host": ["{{baseUrl}}"],
          "path": ["api", "messages", "send"]
        }
      }
    },
    {
      "name": "Send Media",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "instance",
              "value": "{{instance}}",
              "type": "text"
            },
            {
              "key": "to",
              "value": "5511999999999",
              "type": "text"
            },
            {
              "key": "caption",
              "value": "Legenda da imagem",
              "type": "text"
            },
            {
              "key": "file",
              "type": "file",
              "src": []
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/api/messages/send-media",
          "host": ["{{baseUrl}}"],
          "path": ["api", "messages", "send-media"]
        }
      }
    },
    {
      "name": "List Messages",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/messages?instance={{instance}}&page=1&pageSize=50",
          "host": ["{{baseUrl}}"],
          "path": ["api", "messages"],
          "query": [
            {
              "key": "instance",
              "value": "{{instance}}"
            },
            {
              "key": "page",
              "value": "1"
            },
            {
              "key": "pageSize",
              "value": "50"
            }
          ]
        }
      }
    },
    {
      "name": "AI Reply",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"instance\": \"{{instance}}\",\n  \"message\": \"OlÃ¡, preciso de ajuda com meu pedido\",\n  \"context\": {\n    \"systemPrompt\": \"VocÃª Ã© um assistente virtual especializado em atendimento ao cliente.\"\n  }\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/ai/reply",
          "host": ["{{baseUrl}}"],
          "path": ["api", "ai", "reply"]
        }
      }
    },
    {
      "name": "Transcribe Audio",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "instance",
              "value": "{{instance}}",
              "type": "text"
            },
            {
              "key": "audio",
              "type": "file",
              "src": []
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/api/ai/transcribe",
          "host": ["{{baseUrl}}"],
          "path": ["api", "ai", "transcribe"]
        }
      }
    },
    {
      "name": "Extract Text from Image",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "instance",
              "value": "{{instance}}",
              "type": "text"
            },
            {
              "key": "image",
              "type": "file",
              "src": []
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/api/ai/ocr",
          "host": ["{{baseUrl}}"],
          "path": ["api", "ai", "ocr"]
        }
      }
    },
    {
      "name": "Get AI Config",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/ai/config/{{instance}}",
          "host": ["{{baseUrl}}"],
          "path": ["api", "ai", "config", "{{instance}}"]
        }
      }
    },
    {
      "name": "Webhook Incoming",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"instance\": \"{{instance}}\",\n  \"message\": {\n    \"id\": \"msg_123\",\n    \"from\": \"5511999999999@c.us\",\n    \"to\": \"{{instance}}@c.us\",\n    \"body\": \"Mensagem recebida via webhook\",\n    \"type\": \"text\",\n    \"timestamp\": 1640995200\n  }\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/webhooks/incoming",
          "host": ["{{baseUrl}}"],
          "path": ["api", "webhooks", "incoming"]
        }
      }
    },
    {
      "name": "Webhook Outgoing",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"instance\": \"{{instance}}\",\n  \"to\": \"5511999999999\",\n  \"message\": \"Mensagem enviada via webhook\",\n  \"media\": null\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/webhooks/outgoing",
          "host": ["{{baseUrl}}"],
          "path": ["api", "webhooks", "outgoing"]
        }
      }
    },
    {
      "name": "List Webhooks",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/webhooks",
          "host": ["{{baseUrl}}"],
          "path": ["api", "webhooks"]
        }
      }
    },
    {
      "name": "Configure Webhook",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"instance\": \"{{instance}}\",\n  \"url\": \"https://webhook.site/your-webhook-url\",\n  \"events\": [\"message\", \"status\"],\n  \"secret\": \"your-webhook-secret\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/webhooks/configure",
          "host": ["{{baseUrl}}"],
          "path": ["api", "webhooks", "configure"]
        }
      }
    },
    {
      "name": "Create Flow",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"instance\": \"{{instance}}\",\n  \"name\": \"Fluxo de Atendimento\",\n  \"description\": \"Fluxo padrÃ£o de atendimento ao cliente\",\n  \"steps\": [\n    {\n      \"id\": \"step1\",\n      \"type\": \"message\",\n      \"content\": \"OlÃ¡! Como posso ajudar?\"\n    },\n    {\n      \"id\": \"step2\",\n      \"type\": \"wait\",\n      \"timeout\": 30\n    }\n  ]\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/flow",
          "host": ["{{baseUrl}}"],
          "path": ["api", "flow"]
        }
      }
    },
    {
      "name": "List Flows",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/flow?instance={{instance}}",
          "host": ["{{baseUrl}}"],
          "path": ["api", "flow"],
          "query": [
            {
              "key": "instance",
              "value": "{{instance}}"
            }
          ]
        }
      }
    },
    {
      "name": "Get Runtime Status",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/runtime/status",
          "host": ["{{baseUrl}}"],
          "path": ["api", "runtime", "status"]
        }
      }
    },
    {
      "name": "Get Runtime Metrics",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/runtime/metrics",
          "host": ["{{baseUrl}}"],
          "path": ["api", "runtime", "metrics"]
        }
      }
    },
    {
      "name": "Get Runtime Config",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/runtime/config",
          "host": ["{{baseUrl}}"],
          "path": ["api", "runtime", "config"]
        }
      }
    },
    {
      "name": "Update Runtime Config",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"parameters\": {\n    \"LOG_LEVEL\": \"debug\",\n    \"RETENTION_DAYS\": \"90\"\n  }\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/runtime/config",
          "host": ["{{baseUrl}}"],
          "path": ["api", "runtime", "config"]
        }
      }
    },
    {
      "name": "Clear Cache",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"type\": \"all\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/runtime/cache/clear",
          "host": ["{{baseUrl}}"],
          "path": ["api", "runtime", "cache", "clear"]
        }
      }
    },
    {
      "name": "Restart Instance",
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/runtime/instances/{{instance}}/restart",
          "host": ["{{baseUrl}}"],
          "path": ["api", "runtime", "instances", "{{instance}}", "restart"]
        }
      }
    },
    {
      "name": "Cleanup",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"days\": 30\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/cleanup",
          "host": ["{{baseUrl}}"],
          "path": ["api", "cleanup"]
        }
      }
    }
  ]
}

