{
  "info": {
    "_postman_id": "7ff9f987-cb84-4cf4-a186-a8b658a3f749",
    "name": "Argos API v1",
    "description": "Colección pública de la API Argos. No contiene credenciales, tokens de Influx, buckets ni identificadores reales. Define apiKey localmente antes de ejecutar solicitudes. No hay límites de peticiones por segundo ni por IP. La identidad autenticada siccom está exenta del límite de concurrencia en todas las operaciones; los demás clientes tienen un límite predeterminado de 200 peticiones en curso por cliente y tarea, con 429 y Retry-After al superarlo. La exención no garantiza capacidad ilimitada.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-Argos-Api-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{apiKey}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://argos.piedrafitaprognostics.es",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "",
      "type": "string"
    },
    {
      "key": "machineId",
      "value": "machine-1",
      "type": "string"
    },
    {
      "key": "startDate",
      "value": "2026-07-14T09:00:00Z",
      "type": "string"
    },
    {
      "key": "endDate",
      "value": "2026-07-14T10:00:00Z",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Client",
      "item": [
        {
          "name": "Client health",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{baseUrl}}/v1/client/health",
            "description": "Valida la API key y devuelve identidad, configuración no secreta y límites efectivos."
          }
        }
      ]
    },
    {
      "name": "Telemetry",
      "item": [
        {
          "name": "Realtime",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineIds\": [\n    \"{{machineId}}\"\n  ],\n  \"channels\": [\n    \"RPM\"\n  ],\n  \"lookbackSeconds\": 30,\n  \"sampleEvery\": \"1s\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/realtime",
            "description": "Polling de telemetría reciente."
          }
        },
        {
          "name": "Channel points",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineIds\": [\n    \"{{machineId}}\"\n  ],\n  \"channels\": [\n    \"RPM\",\n    \"SPEED\"\n  ],\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\",\n  \"pointsPerChannel\": 3000,\n  \"totalPointsPerMachine\": 8000\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/channel-points",
            "description": "Puntos históricos con presupuesto. Si la ventana (endDate - startDate) es menor de 30 segundos, Argos devuelve todos los puntos sin aggregateWindow y sampleEvery es null en la respuesta."
          }
        },
        {
          "name": "GNSS points",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineIds\": [\n    \"synthetic-machine-1\",\n    \"synthetic-machine-2\"\n  ],\n  \"channels\": {\n    \"latitude\": \"GNSS_LAT\",\n    \"longitude\": \"GNSS_LON\",\n    \"satellites\": \"GNSS_N_SAT\"\n  },\n  \"startDate\": \"2026-01-01T00:00:00Z\",\n  \"endDate\": \"2026-01-01T00:05:00Z\",\n  \"maxPointsPerMachine\": 2\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/gnss-points",
            "description": "Posiciones GNSS crudas por maquina. Intervalo (startDate,endDate]; lat/lon solo se emparejan con el mismo instante de adquisicion original, sin tolerancia ni interpolacion. satellites es opcional; si se omite, nSat es null. Cada maquina pagina de forma independiente; usa nextStartDate como startDate siguiente y deduplica por machineId/ts cuando uses solapamiento. Si el cursor llega a endDate, la continuacion con limites iguales devuelve una pagina vacia y hasMore=false. No hay watermark de completitud de ingesta."
          },
          "response": [
            {
              "name": "Synthetic paginated response",
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"appId\": \"synthetic-app\",\n  \"positionsByMachineId\": {\n    \"synthetic-machine-1\": {\n      \"points\": [\n        {\n          \"ts\": 1767225600123,\n          \"lat\": 41.1234567,\n          \"lon\": 2.1234567,\n          \"nSat\": 1\n        },\n        {\n          \"ts\": 1767225601234,\n          \"lat\": 41.1234581,\n          \"lon\": 2.123459,\n          \"nSat\": null\n        }\n      ],\n      \"nextStartDate\": \"2026-01-01T00:00:01.234567Z\",\n      \"hasMore\": true\n    },\n    \"synthetic-machine-2\": {\n      \"points\": [],\n      \"nextStartDate\": \"2026-01-01T00:05:00Z\",\n      \"hasMore\": false\n    }\n  }\n}"
            }
          ]
        },
        {
          "name": "Channel metadata",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"channels\": [\n    \"RPM\",\n    \"SPEED\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/channel-metadata",
            "description": "Metadatos persistidos de canales."
          }
        },
        {
          "name": "Channels catalog",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineIds\": [\n    \"{{machineId}}\"\n  ],\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/channels",
            "description": "Catálogo de canales del intervalo."
          }
        },
        {
          "name": "Statistics (datos crudos)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"channels\": [\n    \"RPM\",\n    \"SPEED\"\n  ],\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/statistics",
            "description": "Estadísticas exactas (min, max, avg) calculadas sobre los datos crudos almacenados en InfluxDB, sin pre-agregación. Devuelve el valor absoluto máximo y mínimo del sensor en el intervalo."
          }
        },
        {
          "name": "Statistics (ventana de agregación)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"channels\": [\n    \"RPM\",\n    \"SPEED\"\n  ],\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\",\n  \"aggregationWindowMs\": 20\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/statistics",
            "description": "Estadísticas (min, max, avg) calculadas sobre datos pre-agregados con una ventana de 20 ms (aggregateWindow fn: mean). Usar el mismo valor que pointsPerChannel/sampleEvery del endpoint channel-points para que los resultados de diagnosis sean comparables con las gráficas de canal. El campo aggregationWindowMs es opcional; omitirlo equivale al modo de datos crudos."
          }
        },
        {
          "name": "Distance",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineIds\": [\n    \"{{machineId}}\"\n  ],\n  \"channel\": \"SPEED\",\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/distance",
            "description": "Distancia integrada por máquina."
          }
        },
        {
          "name": "Time distance",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"speedChannel\": \"SPEED\",\n  \"channels\": [\n    \"RPM\",\n    \"SPEED\"\n  ],\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\",\n  \"stepCms\": 100\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/time-distance",
            "description": "Canales transformados al eje espacial."
          }
        },
        {
          "name": "Matrix",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"xChannel\": \"THR\",\n  \"yChannel\": \"RPM\",\n  \"speedChannel\": \"SPEED\",\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\",\n  \"xThresholds\": [\n    0,\n    70,\n    90,\n    100\n  ],\n  \"yThresholds\": [\n    0,\n    3000,\n    6000,\n    9000\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/matrix",
            "description": "Matriz de distancia clasificada por umbrales."
          }
        }
      ]
    },
    {
      "name": "Alarms",
      "item": [
        {
          "name": "Data exists",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/data-exists",
            "description": "Comprueba si existen datos."
          }
        },
        {
          "name": "Threshold counts",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\",\n  \"conditions\": [\n    {\n      \"channel\": \"RPM\",\n      \"operator\": \">\",\n      \"value\": 6500\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": "{{baseUrl}}/v1/telemetry/threshold-counts",
            "description": "Cuenta muestras que cumplen condiciones."
          }
        },
        {
          "name": "Threshold occurrences (datos crudos)",
          "request": {
            "method": "POST",
            "header": [{"key": "Content-Type", "value": "application/json"}],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\",\n  \"conditions\": [\n    {\n      \"channel\": \"RPM\",\n      \"operator\": \">\",\n      \"value\": 6500\n    }\n  ]\n}",
              "options": {"raw": {"language": "json"}}
            },
            "url": "{{baseUrl}}/v1/telemetry/threshold-occurrences",
            "description": "Devuelve instantes que cumplen condiciones, evaluados sobre datos crudos (máxima resolución del sensor)."
          }
        },
        {
          "name": "Threshold occurrences (ventana de agregación)",
          "request": {
            "method": "POST",
            "header": [{"key": "Content-Type", "value": "application/json"}],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\",\n  \"aggregationWindowMs\": 20,\n  \"conditions\": [\n    {\n      \"channel\": \"RPM\",\n      \"operator\": \">\",\n      \"value\": 6500\n    }\n  ]\n}",
              "options": {"raw": {"language": "json"}}
            },
            "url": "{{baseUrl}}/v1/telemetry/threshold-occurrences",
            "description": "Devuelve instantes que cumplen condiciones tras aplicar aggregateWindow(fn: mean, every: 20ms). Un pico breve cancelado dentro de la ventana no produce detección. Usar el mismo valor que las gráficas garantiza que la ocurrencia sea visible en el canal."
          }
        },
        {
          "name": "Condition events (datos crudos)",
          "request": {
            "method": "POST",
            "header": [{"key": "Content-Type", "value": "application/json"}],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\",\n  \"conditions\": [\n    {\n      \"channel\": \"RPM\",\n      \"operator\": \">\",\n      \"value\": 6500,\n      \"minimumDurationMs\": 1000\n    }\n  ]\n}",
              "options": {"raw": {"language": "json"}}
            },
            "url": "{{baseUrl}}/v1/telemetry/condition-events",
            "description": "Devuelve intervalos contiguos. Sin aggregationWindowMs usa ventana derivada del presupuesto de puntos con fn: last."
          }
        },
        {
          "name": "Condition events (ventana de agregación)",
          "request": {
            "method": "POST",
            "header": [{"key": "Content-Type", "value": "application/json"}],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"{{machineId}}\",\n  \"startDate\": \"{{startDate}}\",\n  \"endDate\": \"{{endDate}}\",\n  \"aggregationWindowMs\": 20,\n  \"conditions\": [\n    {\n      \"channel\": \"RPM\",\n      \"operator\": \">\",\n      \"value\": 6500,\n      \"minimumDurationMs\": 1000\n    }\n  ]\n}",
              "options": {"raw": {"language": "json"}}
            },
            "url": "{{baseUrl}}/v1/telemetry/condition-events",
            "description": "Devuelve intervalos contiguos con aggregateWindow(fn: mean, every: 20ms). La evaluación de condiciones opera a la misma resolución que las gráficas de canal."
          }
        }
      ]
    },
    {
      "name": "Administration",
      "item": [
        {
          "name": "Reprocessing cleanup (destructive)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/v1/admin/reprocessing-cleanup",
            "description": "Inherits collection API-key authentication. Requires explicit reprocessing-cleanup permission and unrestricted channels. Deletes all DataV2 channels for one machine over [startDate,endDate). 204 success; 400 invalid request/range; 401 invalid key; 403 forbidden endpoint/channels; 429 concurrency; 502 INFLUX_DELETE_FAILED. Execute synthetic examples only against a local fake profile, never against production as a smoke test.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"machineId\": \"synthetic-machine\",\n  \"startDate\": \"2026-01-01T00:00:00Z\",\n  \"endDate\": \"2026-01-01T01:00:00Z\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
        "name":  "GNSS latest",
        "request":  {
                        "method":  "POST",
                        "header":  [
                                       {
                                           "key":  "Content-Type",
                                           "value":  "application/json"
                                       }
                                   ],
                        "body":  {
                                     "raw":  "{\"machineIds\":[\"synthetic-machine-1\",\"synthetic-machine-2\"],\"channels\":{\"latitude\":\"GNSS_LAT\",\"longitude\":\"GNSS_LON\",\"satellites\":\"GNSS_N_SAT\"},\"startDate\":\"2026-01-01T00:00:00Z\",\"endDate\":\"2026-01-02T00:00:00Z\"}",
                                     "options":  {
                                                     "raw":  {
                                                                 "language":  "json"
                                                             }
                                                 },
                                     "mode":  "raw"
                                 },
                        "url":  "{{baseUrl}}/v1/telemetry/gnss-latest",
                        "description":  "Last valid exact-time pair inside explicit coverage, not all history. Requires gnss-latest capability. Collection API-key auth inherited. Per-machine statuses distinguish no samples, invalid pairs and unavailable source. Satellite count does not guarantee fix."
                    }
    },
    {
      "name": "GNSS last valid (no dates)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"machineIds\": [\n    \"synthetic-machine-1\",\n    \"synthetic-machine-2\"\n  ],\n  \"channels\": {\n    \"latitude\": \"GNSS_LAT_POSLLH\",\n    \"longitude\": \"GNSS_LON_POSLLH\",\n    \"satellites\": \"GNSS_N_SAT\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": "{{baseUrl}}/v1/telemetry/gnss-last-valid-position",
        "description": "Requires explicit gnss-last-valid-position capability; inherits collection API-key authentication. No dates or machine-count cap. Argos schedules the complete list internally with bounded instance-wide concurrency and per-machine search budgets. Returns the latest valid retained pair with original sample time; partial search failures are UNAVAILABLE, never definitive absence."
      }
    }
  ]
}
