curl --location --request POST 'https://test.your-api-server.com/api/kpi-catalog' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Produccion por turno",
"description": "Total de produccion agrupada por turno para una linea",
"category": "production",
"fluxQuery": "from(bucket: \"miobox\") |> range(start: -24h) |> filter(fn: (r) => r._measurement == \"production\")",
"inputs": [
{
"name": "lineId",
"type": "string",
"required": true,
"description": "ID de la linea"
}
],
"outputs": [
{
"name": "total_production",
"type": "number",
"unit": "kg"
}
],
"tags": [
"produccion",
"turno"
],
"isPublic": true
}'