{
  "info": {
    "_postman_id": "as-impuestos-wiki-siat-monitor-api",
    "name": "impuestos.wiki — API del Monitor SIAT",
    "description": "API pública y gratuita del Monitor SIAT de impuestos.wiki. Estado de los servicios SOAP del SIN (producción y piloto), verificados cada 10 minutos con verificarComunicacion. Sin autenticación. Documentación: https://impuestos.wiki/siat/monitor#api",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://impuestos.wiki",
      "type": "string"
    },
    {
      "key": "ambiente",
      "value": "prod",
      "type": "string"
    },
    {
      "key": "servicio",
      "value": "FacturacionCodigos",
      "type": "string"
    }
  ],
  "event": [
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "pm.test('HTTP 200', () => pm.response.to.have.status(200));",
          "const b = pm.response.json();",
          "pm.test('success = true', () => pm.expect((b.result || b).success).to.eql(true));"
        ]
      }
    }
  ],
  "item": [
    {
      "name": "Resumen de los últimos 30 minutos (REST)",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{base_url}}/siat/monitor/stats/last_hour",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "siat",
            "monitor",
            "stats",
            "last_hour"
          ]
        },
        "description": "GET sin parámetros. Por ambiente (prod, piloto) y servicio: verificaciones, uptime_pct, tiempos de respuesta (ms), último estado y cada verificación. Incluye summary global. Horas en hora de Bolivia (UTC-4)."
      },
      "response": []
    },
    {
      "name": "Uptime de las últimas 24 horas",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"call\",\n  \"params\": {\n    \"as_environment\": \"{{ambiente}}\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/siat/monitor/stats",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "siat",
            "monitor",
            "stats"
          ]
        },
        "description": "JSON-RPC. as_environment: 'prod', 'piloto' o null (ambos). Devuelve stats con clave '<ambiente>:<servicio>': total, online, avg_time (ms) e history de las últimas 20 verificaciones. Horas en UTC."
      },
      "response": []
    },
    {
      "name": "Historial de verificaciones",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"call\",\n  \"params\": {\n    \"as_environment\": \"{{ambiente}}\",\n    \"as_endpoint\": \"{{servicio}}\",\n    \"as_limit\": 20\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/siat/monitor/history",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "siat",
            "monitor",
            "history"
          ]
        },
        "description": "JSON-RPC. Filtros opcionales as_environment y as_endpoint; as_limit máx. 500. Cada registro: status (online|warning|error|timeout|offline), code HTTP, time_ms, message y timestamp (UTC)."
      },
      "response": []
    }
  ]
}