{"swagger": "2.0", "info": {"title": "Zeia-Energy API", "description": "API documentation for Zeia-Energy", "termsOfService": "https://www.google.com/policies/terms/", "contact": {"email": "desarrollo@zeia.com.pe"}, "license": {"name": "BSD License"}, "version": "v1"}, "host": "api.energy.zeia.com.pe", "schemes": ["http"], "basePath": "/api/v1", "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": {"Basic": {"type": "basic"}}, "security": [{"Basic": []}], "paths": {"/accounts/list/": {"get": {"operationId": "accounts_list_list", "description": "", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/RetrieveUser"}}}}}}, "tags": ["accounts"]}, "parameters": []}, "/accounts/request-token/": {"post": {"operationId": "accounts_request-token_create", "description": "", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/Login"}}], "responses": {"201": {"description": "", "schema": {"$ref": "#/definitions/Login"}}}, "tags": ["accounts"]}, "parameters": []}, "/alerts/energy/current-monitoring/": {"get": {"operationId": "alerts_energy_current-monitoring_list", "summary": "GET /api/v1/alerts/energy/current-monitoring/", "description": "Current monitoring alerts paginated (5/page).", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "current_subtype", "in": "query", "description": "current_subtype", "required": false, "type": "string", "enum": ["max_current_exceeded", "min_current_subceeded", "zero_current", "equipment_on", "current_anomaly", "current_unbalance"]}, {"name": "current_phase", "in": "query", "description": "current_phase", "required": false, "type": "string", "enum": ["A", "B", "C"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/current-monitoring/latest-by-phase/": {"get": {"operationId": "alerts_energy_current-monitoring_latest-by-phase_list", "summary": "GET /api/v1/alerts/energy/current-monitoring/latest-by-phase/", "description": "Latest alert per (current_phase + current_subtype) combination plus\ntoday's total alert count.\n\nQuery parameters:\n  measurement_point   Measurement point ID\n  current_phase       A | B | C\n  current_subtype     Filter by specific subtype", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/current-monitoring/latest-by-phase/report/": {"get": {"operationId": "alerts_energy_current-monitoring_latest-by-phase_report_list", "summary": "GET /api/v1/alerts/energy/current-monitoring/latest-by-phase/report/", "description": "Excel with latest alert per (phase + subtype) combination.\nOne sheet per phase group: Fase A | Fase B | Fase C | CUF\n\nQuery parameters: measurement_point, current_phase, current_subtype", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/current-monitoring/report/": {"get": {"operationId": "alerts_energy_current-monitoring_report_list", "summary": "GET /api/v1/alerts/energy/current-monitoring/report/", "description": "Full history Excel. Four sheets: Fase A | Fase B | Fase C | CUF\n\nQuery parameters (all optional):\n  measurement_point, date_after, date_before, current_phase, current_subtype", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "current_subtype", "in": "query", "description": "current_subtype", "required": false, "type": "string", "enum": ["max_current_exceeded", "min_current_subceeded", "zero_current", "equipment_on", "current_anomaly", "current_unbalance"]}, {"name": "current_phase", "in": "query", "description": "current_phase", "required": false, "type": "string", "enum": ["A", "B", "C"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/energy-monitoring/": {"get": {"operationId": "alerts_energy_energy-monitoring_list", "summary": "GET /api/v1/alerts/energy/energy-monitoring/", "description": "Energy monitoring alerts paginated (5/page).", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "energy_subtype", "in": "query", "description": "energy_subtype", "required": false, "type": "string", "enum": ["overconsumption", "undervaluation", "reactive_inductive_exceeded", "reactive_capacitive_exceeded", "average_overconsumption"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/energy-monitoring/latest-by-subtype/": {"get": {"operationId": "alerts_energy_energy-monitoring_latest-by-subtype_list", "summary": "GET /api/v1/alerts/energy/energy-monitoring/latest-by-subtype/", "description": "Latest alert per (energy_type tag + energy_subtype + measurement_point).\nEnergy types: EPpos, EPneg, EQpos, EQneg (detected from notes tag).\nAlso returns today's total alert count.\n\nQuery parameters:\n  measurement_point   Measurement point ID\n  energy_subtype      overconsumption | undervaluation |\n                      reactive_inductive_exceeded | reactive_capacitive_exceeded |\n                      average_overconsumption\n  energy_category     active    → filters overconsumption + undervaluation +\n                                  average_overconsumption (EPpos/EPneg)\n                      reactive  → filters only reactive_inductive_exceeded + reactive_capacitive_exceeded (EQpos/EQneg)\n                      (omit for all)", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/energy-monitoring/latest-by-subtype/report/": {"get": {"operationId": "alerts_energy_energy-monitoring_latest-by-subtype_report_list", "summary": "GET /api/v1/alerts/energy/energy-monitoring/latest-by-subtype/report/", "description": "Excel with latest alert per subtype. Two sheets: Consumida | Generada.\n\nQuery parameters: measurement_point, energy_subtype", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/energy-monitoring/report/": {"get": {"operationId": "alerts_energy_energy-monitoring_report_list", "summary": "GET /api/v1/alerts/energy/energy-monitoring/report/", "description": "Full history Excel. Two sheets: Energía Consumida | Energía Generada.\n\nQuery parameters: measurement_point, date_after, date_before, energy_subtype", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "energy_subtype", "in": "query", "description": "energy_subtype", "required": false, "type": "string", "enum": ["overconsumption", "undervaluation", "reactive_inductive_exceeded", "reactive_capacitive_exceeded", "average_overconsumption"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/harmonic-distortion/": {"get": {"operationId": "alerts_energy_harmonic-distortion_list", "summary": "GET /api/v1/alerts/energy/harmonic-distortion/", "description": "Harmonic distortion alerts paginated (5/page).\n\nQuery parameters (all optional, combinable):\n  device              Device ID\n  measurement_point   Measurement point ID\n  harmonic_subtype    individual_distortion | total_distortion  (repeatable)\n  phase_type          A | B | C                                 (repeatable)\n  status              new | acknowledged | resolved             (repeatable)\n  alert_status        moderate | critical                       (repeatable)\n  date_after          YYYY-MM-DD\n  date_before         YYYY-MM-DD\n  time_after          HH:MM\n  time_before         HH:MM", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "harmonic_subtype", "in": "query", "description": "harmonic_subtype", "required": false, "type": "string", "enum": ["individual_distortion", "total_distortion"]}, {"name": "phase_type", "in": "query", "description": "phase_type", "required": false, "type": "string", "enum": ["A", "B", "C"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/harmonic-distortion/latest-by-phase/": {"get": {"operationId": "alerts_energy_harmonic-distortion_latest-by-phase_list", "summary": "GET /api/v1/alerts/energy/harmonic-distortion/latest-by-phase/", "description": "Latest alert per (phase_type + fluctuation_subtype) combination plus\ntoday's total alert count.\n\nQuery parameters:\n  measurement_point   Measurement point ID\n  harmonic_subtype    individual_distortion | total_distortion\n  phase_type          A | B | C", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/harmonic-distortion/latest-by-phase/report/": {"get": {"operationId": "alerts_energy_harmonic-distortion_latest-by-phase_report_list", "summary": "GET /api/v1/alerts/energy/harmonic-distortion/latest-by-phase/report/", "description": "Excel with latest alert per (phase + subtype). Two sheets:\nDistorsión Individual | Distorsión Total\n\nQuery parameters: measurement_point, phase_type, harmonic_subtype", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/harmonic-distortion/report/": {"get": {"operationId": "alerts_energy_harmonic-distortion_report_list", "summary": "GET /api/v1/alerts/energy/harmonic-distortion/report/", "description": "Full history Excel. Two sheets: Distorsión Individual | Distorsión Total\n\nQuery parameters: measurement_point, date_after, date_before,\n                  phase_type, harmonic_subtype", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "harmonic_subtype", "in": "query", "description": "harmonic_subtype", "required": false, "type": "string", "enum": ["individual_distortion", "total_distortion"]}, {"name": "phase_type", "in": "query", "description": "phase_type", "required": false, "type": "string", "enum": ["A", "B", "C"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/power-demand/": {"get": {"operationId": "alerts_energy_power-demand_list", "summary": "GET /api/v1/alerts/energy/power-demand/", "description": "Power demand alerts for the authenticated user's enterprise, paginated (5/page).\n\nQuery parameters (all optional, combinable):\n  device              Device ID\n  measurement_point   Measurement point ID\n  power_subtype       max_demand_exceeded | contracted_power_exceeded |\n                      installed_power_exceeded | max_reactive_exceeded |\n                      min_reactive_subceeded  (repeatable)\n  status              new | acknowledged | resolved  (repeatable)\n  alert_status        moderate | critical            (repeatable)\n  date_after          YYYY-MM-DD\n  date_before         YYYY-MM-DD\n  time_after          HH:MM\n  time_before         HH:MM", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "power_subtype", "in": "query", "description": "power_subtype", "required": false, "type": "string", "enum": ["max_demand_exceeded", "contracted_power_exceeded", "installed_power_exceeded", "max_reactive_exceeded", "min_reactive_subceeded"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/power-demand/latest-by-subtype/": {"get": {"operationId": "alerts_energy_power-demand_latest-by-subtype_list", "summary": "GET /api/v1/alerts/energy/power-demand/latest-by-subtype/", "description": "Returns the latest alert per power_subtype (up to 5) plus the total alert\ncount for today. Equivalent to voltage's latest-by-phase but grouped by subtype.\n\nQuery parameters:\n  measurement_point   Measurement point ID\n  power_subtype       Filter by specific subtype", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/power-demand/latest-by-subtype/report/": {"get": {"operationId": "alerts_energy_power-demand_latest-by-subtype_report_list", "summary": "GET /api/v1/alerts/energy/power-demand/latest-by-subtype/report/", "description": "Downloads an Excel file with the latest alert per power subtype.\nOne sheet per subtype group: Potencia Activa | Potencia Reactiva\n\nQuery parameters:\n  measurement_point   Measurement point ID\n  power_subtype       Filter by specific subtype", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/power-demand/report/": {"get": {"operationId": "alerts_energy_power-demand_report_list", "summary": "GET /api/v1/alerts/energy/power-demand/report/", "description": "Downloads an Excel file with full history.\nTwo sheets: Potencia Activa | Potencia Reactiva\n\nQuery parameters (all optional):\n  measurement_point   Measurement point ID\n  date_after          YYYY-MM-DD\n  date_before         YYYY-MM-DD\n  power_subtype       Filter by specific subtype", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "power_subtype", "in": "query", "description": "power_subtype", "required": false, "type": "string", "enum": ["max_demand_exceeded", "contracted_power_exceeded", "installed_power_exceeded", "max_reactive_exceeded", "min_reactive_subceeded"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/voltage-fluctuation/": {"get": {"operationId": "alerts_energy_voltage-fluctuation_list", "summary": "GET /api/v1/alerts/energy/voltage-fluctuation/", "description": "Voltage fluctuation alerts for the authenticated user's enterprise, paginated (10/page).\n\nQuery parameters (all optional, combinable):\n  device                 Device ID\n  measurement_point      Measurement point ID\n  fluctuation_subtype    overvoltage | undervoltage | zero_voltage  (repeatable)\n  status                 new | acknowledged | resolved               (repeatable)\n  alert_status           moderate | critical                         (repeatable)\n  phase_type             A | B | C | AB | BC | AC                   (repeatable)\n  date_after             YYYY-MM-DD\n  date_before            YYYY-MM-DD\n  time_after             HH:MM\n  time_before            HH:MM", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "fluctuation_subtype", "in": "query", "description": "fluctuation_subtype", "required": false, "type": "string", "enum": ["overvoltage", "undervoltage", "zero_voltage"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "phase_type", "in": "query", "description": "phase_type", "required": false, "type": "string", "enum": ["A", "B", "C", "AB", "BC", "AC"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/voltage-fluctuation/latest-by-phase/": {"get": {"operationId": "alerts_energy_voltage-fluctuation_latest-by-phase_list", "summary": "GET /api/v1/alerts/energy/voltage-fluctuation/latest-by-phase/", "description": "Returns the latest alert per phase (up to 6: A, B, C, AB, BC, AC) plus the\ntotal alert count for today. Used for the summary table (one row per phase)\nand the \"Total de alertas registradas\" counter.\n\nQuery parameters:\n  measurement_point    Measurement point ID\n  fluctuation_subtype  overvoltage | undervoltage | zero_voltage", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyAlertTable"}}}}}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/voltage-fluctuation/latest-by-phase/report/": {"get": {"operationId": "alerts_energy_voltage-fluctuation_latest-by-phase_report_list", "summary": "GET /api/v1/alerts/energy/voltage-fluctuation/latest-by-phase/report/", "description": "Downloads an Excel file with the latest alert per phase (same logic as\nEnergyAlertsLatestByPhaseAPIView), one sheet per fluctuation subtype.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/energy/voltage-fluctuation/report/": {"get": {"operationId": "alerts_energy_voltage-fluctuation_report_list", "summary": "GET /api/v1/alerts/energy/voltage-fluctuation/report/", "description": "Downloads an Excel file with one sheet per fluctuation subtype.", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "measurement_point", "in": "query", "description": "measurement_point", "required": false, "type": "string"}, {"name": "fluctuation_subtype", "in": "query", "description": "fluctuation_subtype", "required": false, "type": "string", "enum": ["overvoltage", "undervoltage", "zero_voltage"]}, {"name": "status", "in": "query", "description": "status", "required": false, "type": "string", "enum": ["new", "acknowledged", "resolved"]}, {"name": "alert_status", "in": "query", "description": "alert_status", "required": false, "type": "string", "enum": ["moderate", "critical"]}, {"name": "phase_type", "in": "query", "description": "phase_type", "required": false, "type": "string", "enum": ["A", "B", "C", "AB", "BC", "AC"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "time_after", "in": "query", "description": "time_after", "required": false, "type": "string"}, {"name": "time_before", "in": "query", "description": "time_before", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["alerts"]}, "parameters": []}, "/alerts/{alert_id}/current-monitoring/readings/": {"get": {"operationId": "alerts_current-monitoring_readings_list", "summary": "GET /api/v1/alerts/<alert_id>/current-monitoring/readings/", "description": "All readings for the day the alert occurred (Ia, Ib, Ic).\nThe triggering reading is marked with is_alert_reading: true.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/CurrentAlertReadingRow"}}}}}}, "tags": ["alerts"]}, "parameters": [{"name": "alert_id", "in": "path", "required": true, "type": "string"}]}, "/alerts/{alert_id}/energy-monitoring/readings/": {"get": {"operationId": "alerts_energy-monitoring_readings_list", "summary": "GET /api/v1/alerts/<alert_id>/energy-monitoring/readings/", "description": "All readings for the day the alert occurred (EPpos, EPneg).\nThe triggering reading is marked with is_alert_reading: true.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyMonitoringAlertReadingRow"}}}}}}, "tags": ["alerts"]}, "parameters": [{"name": "alert_id", "in": "path", "required": true, "type": "string"}]}, "/alerts/{alert_id}/harmonic-distortion/readings/": {"get": {"operationId": "alerts_harmonic-distortion_readings_list", "summary": "GET /api/v1/alerts/<alert_id>/harmonic-distortion/readings/", "description": "All readings for the day the alert occurred (THDUa, THDUb, THDUc).\nThe triggering reading is marked with is_alert_reading: true.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/HarmonicAlertReadingRow"}}}}}}, "tags": ["alerts"]}, "parameters": [{"name": "alert_id", "in": "path", "required": true, "type": "string"}]}, "/alerts/{alert_id}/power-demand/readings/": {"get": {"operationId": "alerts_power-demand_readings_list", "summary": "GET /api/v1/alerts/<alert_id>/power-demand/readings/", "description": "Returns all readings for the day the alert occurred.\nThe triggering reading is marked with is_alert_reading: true.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/PowerAlertReadingRow"}}}}}}, "tags": ["alerts"]}, "parameters": [{"name": "alert_id", "in": "path", "required": true, "type": "string"}]}, "/alerts/{alert_id}/voltage-fluctuation/readings/": {"get": {"operationId": "alerts_voltage-fluctuation_readings_list", "summary": "GET /api/v1/alerts/<alert_id>/voltage-fluctuation/readings/", "description": "Returns the readings for the day the alert occurred (no backend pagination):\nthe triggering voltage series is filtered with the same 5-minute persistence,\none-point-per-minute and 0–1000 V rules as the alert trigger; the other\nseries remain as context. The triggering reading is marked with", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/AlertReadingRow"}}}}}}, "tags": ["alerts"]}, "parameters": [{"name": "alert_id", "in": "path", "required": true, "type": "string"}]}, "/coes/peak-demand-range/": {"get": {"operationId": "coes_peak-demand-range_list", "description": "Returns the date and 1-hour time range (±30 minutes) around the peak\nweekly programming demand value reported by COES for the current month.\n\nThe peak is calculated only within peak hours (18:00-23:00, excluding Sundays).", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["coes"]}, "parameters": []}, "/control-devices/data/": {"post": {"operationId": "control-devices_data_create", "description": "API view to create control device data.\nThis view handles the creation of control device data and updates the state\nof the associated control device. It also calculates and updates the time\nduration between state changes.", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/CreateControlDeviceData"}}], "responses": {"201": {"description": "", "schema": {"$ref": "#/definitions/CreateControlDeviceData"}}}, "tags": ["control-devices"]}, "parameters": []}, "/data/": {"post": {"operationId": "data_create", "description": "", "parameters": [], "responses": {"201": {"description": ""}}, "tags": ["data"]}, "parameters": []}, "/electrical-panel/{panel_id}/devices/measurement-points/": {"get": {"operationId": "electrical-panel_devices_measurement-points_list", "summary": "API view that lists all devices and their measurement points for a specific electrical panel.", "description": "This view retrieves all devices associated with a given electrical panel,\nincluding their related measurement points. The electrical panel must\nbelong to a headquarter that is associated with one of the enterprises \nthe requesting user has access to.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/DeviceMeasurementPoint"}}}}}}, "tags": ["electrical-panel"]}, "parameters": [{"name": "panel_id", "in": "path", "required": true, "type": "string"}]}, "/enterprise/{enterprise_id}/energy/consumption-yearly/": {"get": {"operationId": "enterprise_energy_consumption-yearly_list", "summary": "Yearly/monthly energy consumption history of a group of headquarters of an\nenterprise.", "description": "URL parameters:\n    - enterprise_id: ID of the Enterprise.\n\nQuery parameters:\n    - headquarter_ids: optional comma-separated IDs. When omitted, every\n      headquarter of the enterprise with energy billing cycles is used.\n    - year: optional four-digit year. Without it, every available year is\n      returned.\n\nThe active-energy rate is only returned when exactly one headquarter is\nselected. For two or more sites it is null in every month.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyConsumptionYearlyResponse"}}}}}}, "tags": ["enterprise"]}, "parameters": [{"name": "enterprise_id", "in": "path", "required": true, "type": "string"}]}, "/enterprise/{enterprise_id}/water/consumption-yearly/": {"get": {"operationId": "enterprise_water_consumption-yearly_list", "summary": "Yearly/monthly water consumption history of a group of headquarters of an\nenterprise.", "description": "URL parameters:\n    - enterprise_id: ID of the Enterprise.\n\nQuery parameters:\n    - headquarter_ids: optional comma-separated IDs. When omitted, every\n      headquarter of the enterprise with water billing cycles is used.\n    - year: optional four-digit year. Without it, every available year is\n      returned.\n\nThe potable rate is only returned when exactly one headquarter is selected.\nFor two or more sites it is null in every month.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/WaterConsumptionYearlyResponse"}}}}}}, "tags": ["enterprise"]}, "parameters": [{"name": "enterprise_id", "in": "path", "required": true, "type": "string"}]}, "/enterprises/control-devices/report-detail/{deviceId}/": {"get": {"operationId": "enterprises_control-devices_report-detail_read", "description": "API view to generate a detailed report of device on and off states.\nThis view allows authenticated users to retrieve a report of the on and off states\nof a specific device, identified by its `deviceId`. The report is generated in an\nExcel file format and includes the following columns:\n- Fecha: The date when the state was recorded.\n- Hora: The time when the state was recorded.\n- Estatus: The state of the device ('Encendido' or 'Apagado').\n- Duración: The duration of the state in minutes.", "parameters": [], "responses": {"200": {"description": ""}}, "tags": ["enterprises"]}, "parameters": [{"name": "deviceId", "in": "path", "required": true, "type": "string"}]}, "/enterprises/control-devices/report/{deviceId}/": {"get": {"operationId": "enterprises_control-devices_report_read", "description": "API view to generate a report of device on and off times.\nThis view allows authenticated users to retrieve a report of the total time \nand number of times a device has been turned on and off. The report is \ngenerated in an Excel file and returned as a downloadable response.", "parameters": [], "responses": {"200": {"description": ""}}, "tags": ["enterprises"]}, "parameters": [{"name": "deviceId", "in": "path", "required": true, "type": "string"}]}, "/enterprises/control-devices/{control_device_id}/action/": {"post": {"operationId": "enterprises_control-devices_action_create", "description": "API view to change the state of a control device.\nThis view handles POST requests to change the state of a control device. It ensures that the control device is active,\nvalidates the request data, and sends a request to the Home Assistant webhook to change the state of the device.", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/ChangeStateControlDevice"}}], "responses": {"201": {"description": "", "schema": {"$ref": "#/definitions/ChangeStateControlDevice"}}}, "tags": ["enterprises"]}, "parameters": [{"name": "control_device_id", "in": "path", "required": true, "type": "string"}]}, "/enterprises/control-devices/{control_device_id}/data/": {"get": {"operationId": "enterprises_control-devices_data_list", "description": "API view to list data by control device.\nThis view inherits from ListAPIView and provides a list of data entries\nfiltered by the control device ID passed in the URL.", "parameters": [{"name": "state", "in": "query", "description": "state", "required": false, "type": "string", "enum": ["AO", "AF", "MO", "MF"]}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "hour", "in": "query", "description": "hour", "required": false, "type": "string"}, {"name": "weekday", "in": "query", "description": "weekday", "required": false, "type": "string"}, {"name": "last_days", "in": "query", "description": "last_days", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/ControlDeviceData"}}}}}}, "tags": ["enterprises"]}, "parameters": [{"name": "control_device_id", "in": "path", "required": true, "type": "string"}]}, "/enterprises/control-devices/{id}/": {"get": {"operationId": "enterprises_control-devices_read", "description": "RetrieveControlDeviceAPIView is a view that handles the retrieval of a single ControlDevice instance.", "parameters": [], "responses": {"200": {"description": "", "schema": {"$ref": "#/definitions/RetrieveControlDevice"}}}, "tags": ["enterprises"]}, "parameters": [{"name": "id", "in": "path", "description": "A unique integer value identifying this control device.", "required": true, "type": "integer"}]}, "/enterprises/last-alert/": {"get": {"operationId": "enterprises_last-alert_list", "description": "Get the most recent alerts from today for the user's enterprises", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["enterprises"]}, "parameters": []}, "/enterprises/rotate-pinza/": {"post": {"operationId": "enterprises_rotate-pinza_create", "description": "API endpoint para rotar una pinza de un measurement point a otro", "parameters": [], "responses": {"201": {"description": ""}}, "tags": ["enterprises"]}, "parameters": []}, "/enterprises/{enterprise_id}/": {"get": {"operationId": "enterprises_read", "description": "API view to retrieve an Enterprise object.\nThis view returns detailed information about a specific Enterprise that the\nauthenticated user has access to. Access is determined by checking if the user\nhas any role associated with the enterprise.", "parameters": [], "responses": {"200": {"description": "", "schema": {"$ref": "#/definitions/Enterprise"}}}, "tags": ["enterprises"]}, "parameters": [{"name": "enterprise_id", "in": "path", "required": true, "type": "string"}]}, "/enterprises/{enterprise_id}/control-devices/": {"get": {"operationId": "enterprises_control-devices_list", "description": "ListControlDeviceAPIView is a view that provides a list of control devices filtered by enterprise ID.", "parameters": [{"name": "state", "in": "query", "description": "state", "required": false, "type": "string", "enum": ["AO", "AF", "MO", "MF"]}, {"name": "room", "in": "query", "description": "room", "required": false, "type": "string"}, {"name": "controlled_device", "in": "query", "description": "controlled_device", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/ControlDevice"}}}}}}, "tags": ["enterprises"]}, "parameters": [{"name": "enterprise_id", "in": "path", "required": true, "type": "string"}]}, "/enterprises/{enterprise_id}/controlled-devices/": {"get": {"operationId": "enterprises_controlled-devices_list", "summary": "API view to list all controlled devices.", "description": "This view inherits from ListAPIView and provides a read-only endpoint to retrieve\na list of all ControlledDevice instances. The queryset includes all ControlledDevice\nobjects, and the data is serialized using the ControlledDeviceSerializer. Access to\nthis view is restricted to authenticated users.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/ControlledDevice"}}}}}}, "tags": ["enterprises"]}, "parameters": [{"name": "enterprise_id", "in": "path", "required": true, "type": "string"}]}, "/enterprises/{enterprise_id}/headquarter/{headquarter_id}/": {"get": {"operationId": "enterprises_headquarter_read", "description": "API view for retrieving a specific Energy Headquarter.\nThis view allows retrieving a single EnergyHeadquarter instance associated with a specific enterprise.\nURL parameters:\n    - enterprise_id: ID of the enterprise to which the headquarter belongs\n    - headquarter_id: ID of the headquarter to retrieve", "parameters": [], "responses": {"200": {"description": "", "schema": {"$ref": "#/definitions/EnergyHeadquarter"}}}, "tags": ["enterprises"]}, "parameters": [{"name": "enterprise_id", "in": "path", "required": true, "type": "string"}, {"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/favorite-points/": {"get": {"operationId": "favorite-points_list", "description": "", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/FavoritePoint"}}}}}}, "tags": ["favorite-points"]}, "parameters": []}, "/headquarter/{headquarter_id}/billing-calculate/": {"get": {"operationId": "headquarter_billing-calculate_list", "summary": "Calculate billing values for the active concepts of a headquarter in a date range.", "description": "URL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.\n\nQuery parameters:\n    - start_date: Start date in YYYY-MM-DD format.\n    - end_date: End date in YYYY-MM-DD format.\n    - billing_cycle_id: optional. ID of a billing cycle of the headquarter.\n      When provided, its dates replace start_date/end_date and the concepts\n      and rates stored in its snapshot are used.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/BillingCalculationResult"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/billing-concepts/": {"get": {"operationId": "headquarter_billing-concepts_list", "summary": "List active billing concepts for a given headquarter.", "description": "URL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/BillingActive"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/billing-cycles/": {"get": {"operationId": "headquarter_billing-cycles_list", "summary": "List the full billing cycle history of a headquarter, most recent first.", "description": "URL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.\n\nQuery parameters:\n    - billing_type: optional. Filter by type of billing: 'energy' or 'water'.", "parameters": [], "responses": {"200": {"description": "", "schema": {"type": "array", "items": {"$ref": "#/definitions/BillingCycleList"}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/consumption-cycle/detail/": {"get": {"operationId": "headquarter_consumption-cycle_detail_list", "description": "Detail of the current billing cycle of a headquarter: energy provider,\nsupply number, contracted power, electrical panel type and cycle dates.\n\nURL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/RateConsumptionCycle"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/harmonic-distortion/graph": {"get": {"operationId": "headquarter_electrical_panel_harmonic-distortion_graph_list", "description": "", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "date_after", "in": "query", "description": "date_after", "required": false, "type": "string"}, {"name": "date_before", "in": "query", "description": "date_before", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "weekday", "in": "query", "description": "weekday", "required": false, "type": "string"}, {"name": "last_days", "in": "query", "description": "last_days", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/HarmonicDistortionItem"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/harmonic-distortion/list": {"get": {"operationId": "headquarter_electrical_panel_harmonic-distortion_list_list", "description": "List all Harmonic Distortion", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "date_after", "in": "query", "description": "date_after", "required": false, "type": "string"}, {"name": "date_before", "in": "query", "description": "date_before", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "weekday", "in": "query", "description": "weekday", "required": false, "type": "string"}, {"name": "last_days", "in": "query", "description": "last_days", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/HarmonicDistortionItem"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/harmonic-distortion/report": {"get": {"operationId": "headquarter_electrical_panel_harmonic-distortion_report_list", "description": "", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "date_after", "in": "query", "description": "date_after", "required": false, "type": "string"}, {"name": "date_before", "in": "query", "description": "date_before", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "weekday", "in": "query", "description": "weekday", "required": false, "type": "string"}, {"name": "last_days", "in": "query", "description": "last_days", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/most-three-unbalanced": {"get": {"operationId": "headquarter_electrical_panel_most-three-unbalanced_list", "description": "Top 3 measurement points con mayor desbalance (corriente + voltaje)\nen un rango de fechas (por defecto: hoy en zona horaria de Perú).\n\nOptimización: Una sola query SQL pura con CTE que calcula todo en una pasada,\nusando measurement_point_id__in para evitar JOINs y permitir el uso de índices.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/MostThreeUnbalancedResult"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/powers/all-exceeded": {"get": {"operationId": "headquarter_electrical_panel_powers_all-exceeded_list", "description": "Todos los minutos en que la potencia total superó algún umbral (paginado).\nLa paginación se ejecuta en SQL (LIMIT/OFFSET), no en memoria.", "parameters": [{"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/PowersReading"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/powers/graph": {"get": {"operationId": "headquarter_electrical_panel_powers_graph_list", "description": "Gráfico de potencia agregada por período.\nNo usa filtro de umbral — no aplica HAVING aquí.", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "date_after", "in": "query", "description": "date_after", "required": false, "type": "string"}, {"name": "date_before", "in": "query", "description": "date_before", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "weekday", "in": "query", "description": "weekday", "required": false, "type": "string"}, {"name": "last_days", "in": "query", "description": "last_days", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/PowersByElectricalPanelGraphResponse"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/powers/last-exceeded": {"get": {"operationId": "headquarter_electrical_panel_powers_last-exceeded_list", "description": "Los 3 minutos más recientes en que la potencia total superó algún umbral.\nSi no se proporcionan fechas, busca en los últimos 31 días por defecto.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/PowersReading"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/powers/report-exceeded": {"get": {"operationId": "headquarter_electrical_panel_powers_report-exceeded_list", "description": "Genera un Excel con todos los minutos excedidos en el rango de fechas.\nLimitado a MAX_REPORT_ROWS filas para evitar timeouts.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/consumption-distribution/": {"get": {"operationId": "headquarter_electrical_panel_consumption-distribution_list", "description": "Retrieve the consumption distribution for measurement points in the main electrical panel of a headquarter.\nThis endpoint returns the distribution of consumption across all measurement points in the main electrical panel\nof the specified headquarter based on the specified date range.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/devices/measurement-points/list/": {"get": {"operationId": "headquarter_electrical_panel_devices_measurement-points_list_list", "summary": "API view that lists all measurement points for a specific headquarter and electrical panel with pagination.", "description": "This view retrieves all measurement points from a specific electrical panel associated \nwith a given headquarter. The headquarter must belong to one of the enterprises \nthe requesting user has access to.", "parameters": [{"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/ListDeviceMeasurementPoint"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_point/{measurement_point_id}/current-imbalanced": {"get": {"operationId": "headquarter_electrical_panel_measurement_point_current-imbalanced_list", "description": "", "parameters": [{"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/LoadImbalanceCurrent"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_point/{measurement_point_id}/current-imbalanced/graph": {"get": {"operationId": "headquarter_electrical_panel_measurement_point_current-imbalanced_graph_list", "description": "", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/LoadImbalanceCurrent"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_point/{measurement_point_id}/report-imbalanced": {"get": {"operationId": "headquarter_electrical_panel_measurement_point_report-imbalanced_list", "description": "", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_point/{measurement_point_id}/unbalanced-current/counters-graph": {"get": {"operationId": "headquarter_electrical_panel_measurement_point_unbalanced-current_counters-graph_list", "description": "", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/GraphUnbalancedCounters"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_point/{measurement_point_id}/unbalanced-voltage/counters-graph": {"get": {"operationId": "headquarter_electrical_panel_measurement_point_unbalanced-voltage_counters-graph_list", "description": "", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/GraphUnbalancedCounters"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_point/{measurement_point_id}/voltage-imbalanced": {"get": {"operationId": "headquarter_electrical_panel_measurement_point_voltage-imbalanced_list", "description": "", "parameters": [{"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/LoadImbalanceVoltage"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_point/{measurement_point_id}/voltage-imbalanced/graph": {"get": {"operationId": "headquarter_electrical_panel_measurement_point_voltage-imbalanced_graph_list", "description": "", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/LoadImbalanceVoltage"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_points/{measurement_point_id}/readings": {"get": {"operationId": "headquarter_electrical_panel_measurement_points_readings_list", "description": "", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "date_after", "in": "query", "description": "date_after", "required": false, "type": "string"}, {"name": "date_before", "in": "query", "description": "date_before", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "weekday", "in": "query", "description": "weekday", "required": false, "type": "string"}, {"name": "last_days", "in": "query", "description": "last_days", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/GroupedReading"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_points/{measurement_point_id}/readings/graph": {"get": {"operationId": "headquarter_electrical_panel_measurement_points_readings_graph_list", "summary": "Gráfica de lecturas por indicador.", "description": "Para indicadores de voltaje, en series por minuto conserva un solo punto\npor minuto con el mayor valor válido (0–1000); si el mayor supera 1000\ntoma el siguiente y, si ninguno es válido, omite el minuto. En modos\nagregados descarta períodos con extremos negativos o > 1000 V.", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "date_after", "in": "query", "description": "date_after", "required": false, "type": "string"}, {"name": "date_before", "in": "query", "description": "date_before", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "weekday", "in": "query", "description": "weekday", "required": false, "type": "string"}, {"name": "last_days", "in": "query", "description": "last_days", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyGraphReading"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/measurement_points/{measurement_point_id}/readings/graph-especific": {"get": {"operationId": "headquarter_electrical_panel_measurement_points_readings_graph-especific_list", "summary": "Gráfica específica por día (comparación + perfil \"habitual\").", "description": "Para indicadores de voltaje, en series por minuto conserva un solo punto\npor minuto con el mayor valor válido (0–1000); si el mayor supera 1000\ntoma el siguiente y, si ninguno es válido, omite el minuto. En modos\nagregados descarta períodos con extremos negativos o > 1000 V.", "parameters": [{"name": "device", "in": "query", "description": "device", "required": false, "type": "string"}, {"name": "date_after", "in": "query", "description": "date_after", "required": false, "type": "string"}, {"name": "date_before", "in": "query", "description": "date_before", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "weekday", "in": "query", "description": "weekday", "required": false, "type": "string"}, {"name": "last_days", "in": "query", "description": "last_days", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyGraphReadingsEspecificResult"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/electrical_panel/{electrical_panel_id}/readings/report": {"get": {"operationId": "headquarter_electrical_panel_readings_report_list", "description": "", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "electrical_panel_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/energy/consumption-yearly/": {"get": {"operationId": "headquarter_energy_consumption-yearly_list", "summary": "Yearly/monthly energy consumption history of a single headquarter.", "description": "URL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.\n\nQuery parameters:\n    - year: optional four-digit year. Without it, every available year is\n      returned.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyConsumptionYearlyResponse"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/measurement-point/{measurement_point_id}/historical-alerts": {"get": {"operationId": "headquarter_measurement-point_historical-alerts_list", "description": "Get all alerts for the user's enterprises with pagination", "parameters": [{"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/Alert"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/measurement-points/": {"get": {"operationId": "headquarter_measurement-points_list", "description": "API view that lists all measurement points for a specific headquarter.\nThis view retrieves all electrical panels associated with a given headquarter,\nincluding their related devices and measurement points. The headquarter must\nbelong to one of the enterprises the requesting user has access to.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/ElectricalPanelHierarchy"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/tariff-pdfs/": {"get": {"operationId": "headquarter_tariff-pdfs_list", "description": "API view that lists all tariff PDFs for a specific energy headquarter.\nThe headquarter must belong to one of the enterprises the requesting user\nhas access to. The response follows the custom format:\n    {\"data\": [...]}", "parameters": [], "responses": {"200": {"description": "", "schema": {"type": "array", "items": {"$ref": "#/definitions/HeadquarterTariffPdf"}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water/billing-calculate/": {"get": {"operationId": "headquarter_water_billing-calculate_list", "summary": "Calculate the water billing values for the active concepts of a\nheadquarter in a date range.", "description": "URL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.\n\nQuery parameters:\n    - start_date: Start date in YYYY-MM-DD format.\n    - end_date: End date in YYYY-MM-DD format.\n    - billing_cycle_id: optional. ID of a water billing cycle of the\n      headquarter. When provided, its dates replace start_date/end_date and\n      the concepts, rates and discharge factor stored in its snapshot are\n      used.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/BillingCalculationResult"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water/billing-concepts/": {"get": {"operationId": "headquarter_water_billing-concepts_list", "summary": "List active water billing concepts for a given headquarter.", "description": "URL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/BillingActive"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water/billing-cycles/": {"get": {"operationId": "headquarter_water_billing-cycles_list", "summary": "List the full water billing cycle history of a headquarter, most recent\nfirst.", "description": "URL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.", "parameters": [], "responses": {"200": {"description": "", "schema": {"type": "array", "items": {"$ref": "#/definitions/BillingCycleList"}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water/consumption-cycle/detail/": {"get": {"operationId": "headquarter_water_consumption-cycle_detail_list", "description": "Detail of the current water billing cycle of a headquarter: cycle dates,\nelapsed days, discharge factor and the water pipes of the headquarter.\n\nURL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/WaterRateConsumptionCycle"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water/consumption-yearly/": {"get": {"operationId": "headquarter_water_consumption-yearly_list", "summary": "Yearly/monthly water consumption history of a single headquarter.", "description": "URL parameters:\n    - headquarter_id: ID of the EnergyHeadquarter.\n\nQuery parameters:\n    - year: optional four-digit year. Without it, every available year is\n      returned.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/WaterConsumptionYearlyResponse"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water_pipe/{water_pipe_id}/measurement_point_water/{measurement_point_water_id}/readings": {"get": {"operationId": "headquarter_water_pipe_measurement_point_water_readings_list", "description": "Lista paginada de lecturas de agua crudas de un punto de medición,\nequivalente en agua a ListReadingByMeasurePointAPI (energía).\n\nQuery params:\n  - date_after / date_before / hour_after / hour_before / weekday /\n    last_days: vía ReadingWaterFilter.\n  - indicador: un campo de WATER_FIELDS; por defecto los incluye todos.", "parameters": [{"name": "date_after", "in": "query", "description": "date_after", "required": false, "type": "string"}, {"name": "date_before", "in": "query", "description": "date_before", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "weekday", "in": "query", "description": "weekday", "required": false, "type": "string"}, {"name": "last_days", "in": "query", "description": "last_days", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/GroupedReadingWater"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "water_pipe_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_water_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water_pipe/{water_pipe_id}/measurement_point_water/{measurement_point_water_id}/readings/graph": {"get": {"operationId": "headquarter_water_pipe_measurement_point_water_readings_graph_list", "summary": "Return consumption graph data for one water measurement point.", "description": "Acepta `?indicador=<campo>` para elegir la métrica; si se omite se usa\nconsumo_litros (comportamiento original).", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/WaterGraphReading"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "water_pipe_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_water_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water_pipe/{water_pipe_id}/measurement_point_water/{measurement_point_water_id}/readings/graph-especific": {"get": {"operationId": "headquarter_water_pipe_measurement_point_water_readings_graph-especific_list", "description": "Datos de consumo de agua (litros) agrupados por fecha y hora, equivalente\nen agua a EnergyReadingsGraphEspecificAPI, sin lógica de tarifas.\n\n El indicador es fijo: consumo_litros. La respuesta es una lista de\ndicts {YYYY-MM-DD: [entries ordenadas por hora]} y, cuando last_by=hour y\nhay 2+ fechas con datos, un dict final {'habitual': [promedios por hora]}.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/WaterGraphEspecificResult"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "water_pipe_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_water_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water_pipe/{water_pipe_id}/measurement_point_water/{measurement_point_water_id}/readings/report": {"get": {"operationId": "headquarter_water_pipe_measurement_point_water_readings_report_list", "summary": "Descarga de lecturas de agua crudas de un punto de medición, equivalente\nen agua a EnergyReadingsReportAPI (energía).", "description": "Exporta Fecha, Hora, Punto de Medición, Consumo (L) y Consumo (m3).\n\nQuery params:\n  - date_after / date_before: rango de fechas (YYYY-MM-DD); al menos uno\n    es obligatorio. date_before es exclusivo (incluye el día completo).\n  - file_format: 'csv' (default) o 'xlsx'. No se usa 'format' porque es\n    un query param reservado de DRF (URL_FORMAT_OVERRIDE).", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "water_pipe_id", "in": "path", "required": true, "type": "string"}, {"name": "measurement_point_water_id", "in": "path", "required": true, "type": "string"}]}, "/headquarter/{headquarter_id}/water_pipe/{water_pipe_id}/measurement_points_water/list/": {"get": {"operationId": "headquarter_water_pipe_measurement_points_water_list_list", "description": "API view that lists all water measurement points for a specific water pipe with pagination.\nWater module mirror of ListDevicesMeasurementPointsByHeadquarterAPI. The headquarter\nand its water pipe must belong to one of the enterprises the requesting user has\naccess to.", "parameters": [{"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/ListMeasurementPointWater"}}}}}}, "tags": ["headquarter"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}, {"name": "water_pipe_id", "in": "path", "required": true, "type": "string"}]}, "/nodered/control-devices/hook/": {"post": {"operationId": "nodered_control-devices_hook_create", "description": "API view to ensure the state of a control device.", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/EnsureControlDeviceState"}}], "responses": {"201": {"description": "", "schema": {"$ref": "#/definitions/EnsureControlDeviceState"}}}, "tags": ["nodered"]}, "parameters": []}, "/room/{room_id}/alert/{alert_id}/comments": {"get": {"operationId": "room_alert_comments_list", "description": "", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/CommentAlert"}}}}}}, "tags": ["room"]}, "post": {"operationId": "room_alert_comments_create", "description": "", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/CommentAlert"}}], "responses": {"201": {"description": "", "schema": {"$ref": "#/definitions/CommentAlert"}}}, "tags": ["room"]}, "parameters": [{"name": "room_id", "in": "path", "required": true, "type": "string"}, {"name": "alert_id", "in": "path", "required": true, "type": "string"}]}, "/room/{room_id}/alerts/": {"get": {"operationId": "room_alerts_list", "description": "", "parameters": [{"name": "indicator", "in": "query", "description": "indicator", "required": true, "type": "string", "enum": ["CO2", "TVOC", "HCHO", "OZONE", "PM2_5", "PM10"]}, {"name": "unit", "in": "query", "description": "unit", "required": false, "type": "string"}, {"name": "level", "in": "query", "description": "level", "required": false, "type": "string"}, {"name": "resolved", "in": "query", "description": "resolved", "required": false, "type": "string"}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "page", "in": "query", "description": "A page number within the paginated result set.", "required": false, "type": "integer"}, {"name": "page_size", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/LimitAlert"}}}}}}, "tags": ["room"]}, "parameters": [{"name": "room_id", "in": "path", "required": true, "type": "string"}]}, "/room/{room_id}/report/": {"get": {"operationId": "room_report_list", "description": "", "parameters": [{"name": "indicator", "in": "query", "description": "indicator", "required": true, "type": "string", "enum": ["CO2", "TVOC", "HCHO", "OZONE", "PM2_5", "PM10"]}, {"name": "unit", "in": "query", "description": "unit", "required": false, "type": "string"}, {"name": "level", "in": "query", "description": "level", "required": false, "type": "string"}, {"name": "resolved", "in": "query", "description": "resolved", "required": false, "type": "string"}, {"name": "date", "in": "query", "description": "date", "required": false, "type": "string"}, {"name": "hour_after", "in": "query", "description": "hour_after", "required": false, "type": "string"}, {"name": "hour_before", "in": "query", "description": "hour_before", "required": false, "type": "string"}, {"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["room"]}, "parameters": [{"name": "room_id", "in": "path", "required": true, "type": "string"}]}, "/user/headquarter/{headquarter_id}/general-electrical-panel/": {"get": {"operationId": "user_headquarter_general-electrical-panel_list", "description": "API view to retrieve the main electrical panel of a headquarter.\nThis view returns the electrical panel that is marked as the main one for a specific headquarter.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/ElectricalPanel"}}}}}}, "tags": ["user"]}, "parameters": [{"name": "headquarter_id", "in": "path", "required": true, "type": "string"}]}, "/user/headquarters/": {"get": {"operationId": "user_headquarters_list", "description": "API endpoint that lists all headquarters a user has access to.\nThis view returns all headquarters associated with enterprises where the user\nhas a role (UserEnterpriseRole). It filters the headquarters based on the\nuser's enterprise permissions.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyHeadquarterPowersCompact"}}}}}}, "tags": ["user"]}, "parameters": []}, "/user/me/": {"get": {"operationId": "user_me_read", "description": "", "parameters": [], "responses": {"200": {"description": "", "schema": {"$ref": "#/definitions/UserMe"}}}, "tags": ["user"]}, "parameters": []}, "/user/water-headquarters/": {"get": {"operationId": "user_water-headquarters_list", "description": "API endpoint that lists all headquarters a user has access to, including their water pipes.\nWater module mirror of UserHeadquartersListAPI: it returns the headquarters associated\nwith enterprises where the user has a role (UserEnterpriseRole), each one with its\nwater pipes nested (main pipe first).", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": "", "schema": {"required": ["count", "results"], "type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": "string", "format": "uri", "x-nullable": true}, "previous": {"type": "string", "format": "uri", "x-nullable": true}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyHeadquarterWaterPipes"}}}}}}, "tags": ["user"]}, "parameters": []}, "/water/readings/data/": {"post": {"operationId": "water_readings_data_create", "summary": "Endpoint de ingesta para dispositivos/gateways IoT de agua.", "description": "No requiere token de usuario. La autenticación tiene dos capas:\n  1. Header `Authorization: Token <token>` validado contra la variable\n     de entorno WATER_GATEWAY_TOKEN (token de integración).\n  2. devEUI + password del body, validados contra MeasurementPointWater\n     (credencial específica de cada gateway).", "parameters": [{"name": "data", "in": "body", "required": true, "schema": {"$ref": "#/definitions/CreateReadingWater"}}, {"name": "Authorization", "in": "header", "description": "Token de integración del gateway. Formato: Token <token>", "required": true, "type": "string"}], "responses": {"201": {"description": "Lectura de agua registrada correctamente."}, "400": {"description": "Datos inválidos."}, "401": {"description": "Token de integración inválido o faltante."}, "403": {"description": "Credenciales del dispositivo inválidas."}}, "tags": ["water"]}, "parameters": []}, "/water_pipe/{water_pipe_id}/consumption-distribution/": {"get": {"operationId": "water_pipe_consumption-distribution_list", "description": "Retrieve the water consumption distribution for measurement points in a water pipe.\nThis endpoint returns the distribution of consumption across all measurement points\nin the specified water pipe based on the specified date range.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["water_pipe"]}, "parameters": [{"name": "water_pipe_id", "in": "path", "required": true, "type": "string"}]}, "/water_pipe/{water_pipe_id}/consumption-summary/": {"get": {"operationId": "water_pipe_consumption-summary_list", "summary": "Return today's and current month water consumption for a water pipe.", "description": "The month period is based on the actual first and last reading registered\nwithin the current month instead of always using the 1st day of the month\nand the current moment as boundaries.", "parameters": [{"name": "limit", "in": "query", "description": "Number of results to return per page.", "required": false, "type": "integer"}, {"name": "offset", "in": "query", "description": "The initial index from which to return the results.", "required": false, "type": "integer"}], "responses": {"200": {"description": ""}}, "tags": ["water_pipe"]}, "parameters": [{"name": "water_pipe_id", "in": "path", "required": true, "type": "string"}]}}, "definitions": {"RetrieveUser": {"required": ["first_name", "last_name"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "enterprise_name": {"title": "Enterprise name", "type": "string", "readOnly": true}, "email": {"title": "Email address", "type": "string", "format": "email", "readOnly": true, "minLength": 1}, "first_name": {"title": "First name", "type": "string", "maxLength": 100, "minLength": 1}, "last_name": {"title": "Last name", "type": "string", "maxLength": 100, "minLength": 1}, "phone": {"title": "Phone", "type": "string", "maxLength": 30, "x-nullable": true}, "gender": {"title": "Gender", "type": "string", "enum": ["MALE", "FEMALE"], "x-nullable": true}, "created_at": {"title": "Created at", "type": "string", "format": "date-time", "readOnly": true}, "modified_at": {"title": "Modified at", "type": "string", "format": "date-time", "readOnly": true}, "age": {"title": "Age", "type": "integer", "maximum": 2147483647, "minimum": -2147483648, "x-nullable": true}, "document_number": {"title": "ID number", "type": "string", "maxLength": 8, "x-nullable": true}, "admission_date": {"title": "Fecha de ingreso", "type": "string", "format": "date", "x-nullable": true}, "departure_date": {"title": "Fecha de salida", "type": "string", "format": "date", "x-nullable": true}, "is_active": {"title": "Is active", "type": "boolean"}, "is_staff": {"title": "Is staff", "type": "boolean"}, "is_user_energy_monitoring": {"title": "User Energy Monitoring", "type": "boolean"}, "energy_modules": {"title": "Energy modules", "type": "string", "readOnly": true}, "is_user_quality_air_auto": {"title": "User Quality Air Auto", "type": "boolean"}, "is_user_thermal_comfort": {"title": "User Thermal Comfort", "type": "boolean"}}}, "Login": {"required": ["email", "password"], "type": "object", "properties": {"email": {"title": "Email", "type": "string", "format": "email", "minLength": 1}, "password": {"title": "Password", "type": "string", "minLength": 1}}}, "EnergyAlertTable": {"required": ["id", "indicator_name", "subindicator_name", "origin", "date", "time", "limit", "value", "device_id", "device_name", "measurement_point_id", "measurement_point_name", "status", "alert_status", "notes"], "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "indicator_name": {"title": "Indicator name", "type": "string", "minLength": 1}, "subindicator_name": {"title": "Subindicator name", "type": "string", "minLength": 1}, "origin": {"title": "Origin", "type": "string", "minLength": 1}, "date": {"title": "Date", "type": "string", "minLength": 1}, "time": {"title": "Time", "type": "string", "minLength": 1}, "limit": {"title": "Limit", "type": "number", "x-nullable": true}, "value": {"title": "Value", "type": "number", "x-nullable": true}, "device_id": {"title": "Device id", "type": "integer"}, "device_name": {"title": "Device name", "type": "string", "minLength": 1}, "measurement_point_id": {"title": "Measurement point id", "type": "integer"}, "measurement_point_name": {"title": "Measurement point name", "type": "string", "minLength": 1}, "status": {"title": "Status", "type": "string", "minLength": 1}, "alert_status": {"title": "Alert status", "type": "string", "minLength": 1}, "notes": {"title": "Notes", "type": "string", "x-nullable": true}}}, "CurrentAlertReadingRow": {"required": ["id", "date", "time", "Ia_value", "Ib_value", "Ic_value", "is_alert_reading"], "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "date": {"title": "Date", "type": "string", "minLength": 1}, "time": {"title": "Time", "type": "string", "minLength": 1}, "Ia_value": {"title": "Ia value", "type": "number", "x-nullable": true}, "Ib_value": {"title": "Ib value", "type": "number", "x-nullable": true}, "Ic_value": {"title": "Ic value", "type": "number", "x-nullable": true}, "is_alert_reading": {"title": "Is alert reading", "type": "boolean"}}}, "EnergyMonitoringAlertReadingRow": {"required": ["id", "date", "time", "EPpos_value", "EPneg_value", "is_alert_reading"], "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "date": {"title": "Date", "type": "string", "minLength": 1}, "time": {"title": "Time", "type": "string", "minLength": 1}, "EPpos_value": {"title": "Eppos value", "type": "number", "x-nullable": true}, "EPneg_value": {"title": "Epneg value", "type": "number", "x-nullable": true}, "is_alert_reading": {"title": "Is alert reading", "type": "boolean"}}}, "HarmonicAlertReadingRow": {"required": ["id", "date", "time", "THDUa_value", "THDUb_value", "THDUc_value", "is_alert_reading"], "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "date": {"title": "Date", "type": "string", "minLength": 1}, "time": {"title": "Time", "type": "string", "minLength": 1}, "THDUa_value": {"title": "Thdua value", "type": "number", "x-nullable": true}, "THDUb_value": {"title": "Thdub value", "type": "number", "x-nullable": true}, "THDUc_value": {"title": "Thduc value", "type": "number", "x-nullable": true}, "is_alert_reading": {"title": "Is alert reading", "type": "boolean"}}}, "PowerAlertReadingRow": {"required": ["id", "date", "time", "P_value", "Q_value", "is_alert_reading"], "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "date": {"title": "Date", "type": "string", "minLength": 1}, "time": {"title": "Time", "type": "string", "minLength": 1}, "P_value": {"title": "P value", "type": "number", "x-nullable": true}, "Q_value": {"title": "Q value", "type": "number", "x-nullable": true}, "is_alert_reading": {"title": "Is alert reading", "type": "boolean"}}}, "AlertReadingRow": {"required": ["id", "date", "time", "Ua_value", "Ub_value", "Uc_value", "Uab_value", "Ubc_value", "Uac_value", "P_value", "is_alert_reading"], "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "date": {"title": "Date", "type": "string", "minLength": 1}, "time": {"title": "Time", "type": "string", "minLength": 1}, "Ua_value": {"title": "Ua value", "type": "number", "x-nullable": true}, "Ub_value": {"title": "Ub value", "type": "number", "x-nullable": true}, "Uc_value": {"title": "Uc value", "type": "number", "x-nullable": true}, "Uab_value": {"title": "Uab value", "type": "number", "x-nullable": true}, "Ubc_value": {"title": "Ubc value", "type": "number", "x-nullable": true}, "Uac_value": {"title": "Uac value", "type": "number", "x-nullable": true}, "P_value": {"title": "P value", "type": "number", "x-nullable": true}, "is_alert_reading": {"title": "Is alert reading", "type": "boolean"}}}, "CreateControlDeviceData": {"required": ["dev_uid"], "type": "object", "properties": {"voltage": {"title": "Voltage", "type": "number", "x-nullable": true}, "active_power": {"title": "Active power", "type": "number", "x-nullable": true}, "power_factor": {"title": "Power factor", "type": "number", "x-nullable": true}, "power_consumed": {"title": "Power consumed", "type": "number", "x-nullable": true}, "current": {"title": "Current", "type": "number", "x-nullable": true}, "state": {"title": "State", "type": "string", "enum": ["AO", "AF", "MO", "MF"]}, "dev_uid": {"title": "Dev uid", "type": "string", "minLength": 1}}}, "DeviceMeasurementPoint": {"required": ["name", "dev_eui", "model", "phase_type"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 255, "minLength": 1}, "dev_eui": {"title": "Dev eui", "type": "string", "maxLength": 22, "minLength": 1}, "model": {"title": "Model", "type": "string", "maxLength": 50, "minLength": 1}, "phase_type": {"title": "Phase type", "type": "string", "enum": ["single_phase", "three_phase"]}, "number_of_channels": {"title": "Number of channels", "type": "integer", "maximum": 2147483647, "minimum": 0}, "measurement_points": {"title": "Measurement points", "type": "string", "readOnly": true}}}, "WaterConsumptionYearlyCoverage": {"required": ["selected_headquarters", "headquarters_with_cycle", "headquarters_with_totals"], "type": "object", "properties": {"selected_headquarters": {"title": "Selected headquarters", "type": "integer"}, "headquarters_with_cycle": {"title": "Headquarters with cycle", "type": "integer"}, "headquarters_with_totals": {"title": "Headquarters with totals", "type": "integer"}}}, "WaterConsumptionYearlyPeriod": {"required": ["headquarter_id", "headquarter_name", "billing_cycle_id", "period_start", "period_end", "is_current", "consumption", "total_amount", "currency", "totals_by_currency"], "type": "object", "properties": {"headquarter_id": {"title": "Headquarter id", "type": "integer"}, "headquarter_name": {"title": "Headquarter name", "type": "string", "x-nullable": true}, "billing_cycle_id": {"title": "Billing cycle id", "type": "integer"}, "period_start": {"title": "Period start", "type": "string", "format": "date"}, "period_end": {"title": "Period end", "type": "string", "format": "date"}, "is_current": {"title": "Is current", "type": "boolean"}, "consumption": {"title": "Consumption", "type": "number", "x-nullable": true}, "total_amount": {"title": "Total amount", "type": "number", "x-nullable": true}, "currency": {"title": "Currency", "type": "string", "x-nullable": true}, "totals_by_currency": {"title": "Totals by currency", "type": "object", "additionalProperties": {"type": "number"}}}}, "EnergyConsumptionYearlyMonth": {"required": ["month", "has_cycle", "has_totals", "consumption", "total_amount", "currency", "currency_symbol", "totals_by_currency", "active_energy_rate", "active_energy_rate_currency", "active_energy_rate_unit", "coverage", "is_partial", "partial_reasons", "period_start", "period_end", "totals_period_end", "totals_calculated_at"], "type": "object", "properties": {"month": {"title": "Month", "type": "integer", "maximum": 12, "minimum": 1}, "has_cycle": {"title": "Has cycle", "type": "boolean"}, "has_totals": {"title": "Has totals", "type": "boolean"}, "consumption": {"title": "Consumption", "type": "number", "x-nullable": true}, "total_amount": {"title": "Total amount", "type": "number", "x-nullable": true}, "currency": {"title": "Currency", "type": "string", "x-nullable": true}, "currency_symbol": {"title": "Currency symbol", "type": "string", "x-nullable": true}, "totals_by_currency": {"title": "Totals by currency", "type": "object", "additionalProperties": {"type": "number"}}, "active_energy_rate": {"title": "Active energy rate", "type": "number", "x-nullable": true}, "active_energy_rate_currency": {"title": "Active energy rate currency", "type": "string", "x-nullable": true}, "active_energy_rate_unit": {"title": "Active energy rate unit", "type": "string", "x-nullable": true}, "coverage": {"$ref": "#/definitions/WaterConsumptionYearlyCoverage"}, "is_partial": {"title": "Is partial", "type": "boolean"}, "partial_reasons": {"type": "array", "items": {"type": "string", "minLength": 1}}, "period_start": {"title": "Period start", "type": "string", "format": "date", "x-nullable": true}, "period_end": {"title": "Period end", "type": "string", "format": "date", "x-nullable": true}, "totals_period_end": {"title": "Totals period end", "type": "string", "format": "date", "x-nullable": true}, "totals_calculated_at": {"title": "Totals calculated at", "type": "string", "format": "date-time", "x-nullable": true}, "periods": {"type": "array", "items": {"$ref": "#/definitions/WaterConsumptionYearlyPeriod"}}}}, "EnergyConsumptionYearlyYear": {"required": ["year", "consumption", "total_amount", "currency", "currency_symbol", "totals_by_currency", "months_with_cycle", "is_partial", "partial_reasons", "months"], "type": "object", "properties": {"year": {"title": "Year", "type": "integer"}, "consumption": {"title": "Consumption", "type": "number", "x-nullable": true}, "total_amount": {"title": "Total amount", "type": "number", "x-nullable": true}, "currency": {"title": "Currency", "type": "string", "x-nullable": true}, "currency_symbol": {"title": "Currency symbol", "type": "string", "x-nullable": true}, "totals_by_currency": {"title": "Totals by currency", "type": "object", "additionalProperties": {"type": "number"}}, "months_with_cycle": {"title": "Months with cycle", "type": "integer"}, "is_partial": {"title": "Is partial", "type": "boolean"}, "partial_reasons": {"type": "array", "items": {"type": "string", "minLength": 1}}, "months": {"type": "array", "items": {"$ref": "#/definitions/EnergyConsumptionYearlyMonth"}}}}, "EnergyConsumptionYearlyResponse": {"required": ["enterprise_id", "headquarter_ids", "unit", "available_years", "results"], "type": "object", "properties": {"enterprise_id": {"title": "Enterprise id", "type": "integer"}, "headquarter_ids": {"type": "array", "items": {"type": "integer"}}, "unit": {"title": "Unit", "type": "string", "minLength": 1}, "available_years": {"type": "array", "items": {"type": "integer"}}, "results": {"type": "array", "items": {"$ref": "#/definitions/EnergyConsumptionYearlyYear"}}}}, "WaterConsumptionYearlyMonth": {"required": ["month", "has_cycle", "has_totals", "consumption", "total_amount", "currency", "currency_symbol", "totals_by_currency", "potable_rate", "potable_rate_currency", "coverage", "is_partial", "partial_reasons", "period_start", "period_end", "totals_period_end", "totals_calculated_at"], "type": "object", "properties": {"month": {"title": "Month", "type": "integer", "maximum": 12, "minimum": 1}, "has_cycle": {"title": "Has cycle", "type": "boolean"}, "has_totals": {"title": "Has totals", "type": "boolean"}, "consumption": {"title": "Consumption", "type": "number", "x-nullable": true}, "total_amount": {"title": "Total amount", "type": "number", "x-nullable": true}, "currency": {"title": "Currency", "type": "string", "x-nullable": true}, "currency_symbol": {"title": "Currency symbol", "type": "string", "x-nullable": true}, "totals_by_currency": {"title": "Totals by currency", "type": "object", "additionalProperties": {"type": "number"}}, "potable_rate": {"title": "Potable rate", "type": "number", "x-nullable": true}, "potable_rate_currency": {"title": "Potable rate currency", "type": "string", "x-nullable": true}, "coverage": {"$ref": "#/definitions/WaterConsumptionYearlyCoverage"}, "is_partial": {"title": "Is partial", "type": "boolean"}, "partial_reasons": {"type": "array", "items": {"type": "string", "minLength": 1}}, "period_start": {"title": "Period start", "type": "string", "format": "date", "x-nullable": true}, "period_end": {"title": "Period end", "type": "string", "format": "date", "x-nullable": true}, "totals_period_end": {"title": "Totals period end", "type": "string", "format": "date", "x-nullable": true}, "totals_calculated_at": {"title": "Totals calculated at", "type": "string", "format": "date-time", "x-nullable": true}, "periods": {"type": "array", "items": {"$ref": "#/definitions/WaterConsumptionYearlyPeriod"}}}}, "WaterConsumptionYearlyYear": {"required": ["year", "consumption", "total_amount", "currency", "currency_symbol", "totals_by_currency", "months_with_cycle", "is_partial", "partial_reasons", "months"], "type": "object", "properties": {"year": {"title": "Year", "type": "integer"}, "consumption": {"title": "Consumption", "type": "number", "x-nullable": true}, "total_amount": {"title": "Total amount", "type": "number", "x-nullable": true}, "currency": {"title": "Currency", "type": "string", "x-nullable": true}, "currency_symbol": {"title": "Currency symbol", "type": "string", "x-nullable": true}, "totals_by_currency": {"title": "Totals by currency", "type": "object", "additionalProperties": {"type": "number"}}, "months_with_cycle": {"title": "Months with cycle", "type": "integer"}, "is_partial": {"title": "Is partial", "type": "boolean"}, "partial_reasons": {"type": "array", "items": {"type": "string", "minLength": 1}}, "months": {"type": "array", "items": {"$ref": "#/definitions/WaterConsumptionYearlyMonth"}}}}, "WaterConsumptionYearlyResponse": {"required": ["enterprise_id", "headquarter_ids", "unit", "available_years", "results"], "type": "object", "properties": {"enterprise_id": {"title": "Enterprise id", "type": "integer"}, "headquarter_ids": {"type": "array", "items": {"type": "integer"}}, "unit": {"title": "Unit", "type": "string", "minLength": 1}, "available_years": {"type": "array", "items": {"type": "integer"}}, "results": {"type": "array", "items": {"$ref": "#/definitions/WaterConsumptionYearlyYear"}}}}, "ChangeStateControlDevice": {"required": ["state"], "type": "object", "properties": {"state": {"title": "State", "type": "string", "enum": ["MO", "MF"]}}}, "ControlDeviceData": {"type": "object", "properties": {"created_at": {"title": "Created at", "type": "string", "format": "date-time", "readOnly": true}, "state": {"title": "State", "type": "string", "enum": ["AO", "AF", "MO", "MF"]}, "time": {"title": "Time", "type": "number"}}}, "RetrieveControlDevice": {"type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "state": {"title": "State", "type": "string", "enum": ["AO", "AF", "MO", "MF"]}}}, "ElectricalPanel": {"required": ["name"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 255, "minLength": 1}, "is_active": {"title": "Is active", "type": "boolean"}, "type": {"title": "Tipo", "type": "string", "enum": ["monofasico", "trifasico"]}, "threads": {"title": "Hilos", "type": "integer", "maximum": 2147483647, "minimum": -2147483648, "x-nullable": true}}}, "EnergyHeadquarter": {"type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 50, "minLength": 1, "x-nullable": true}, "is_active": {"title": "Is active", "type": "boolean"}, "electrical_panels": {"type": "array", "items": {"$ref": "#/definitions/ElectricalPanel"}, "readOnly": true}}}, "Enterprise": {"type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 50, "x-nullable": true}, "energy_headquarters": {"type": "array", "items": {"$ref": "#/definitions/EnergyHeadquarter"}, "readOnly": true}}}, "ControlledDevice": {"required": ["name"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 100, "minLength": 1}}}, "ControlDevice": {"required": ["room_name", "dev_uid", "name", "total_time_on", "total_times_on", "controlled_device"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "room_name": {"title": "Room name", "type": "string", "minLength": 1}, "dev_uid": {"title": "Dev uid", "type": "string", "maxLength": 24, "minLength": 1}, "name": {"title": "Name", "type": "string", "maxLength": 100, "minLength": 1}, "state": {"title": "State", "type": "string", "enum": ["AO", "AF", "MO", "MF"]}, "total_time_on": {"title": "Total time on", "type": "number"}, "total_times_on": {"title": "Total times on", "type": "integer"}, "controlled_device": {"$ref": "#/definitions/ControlledDevice"}}}, "FavoritePoint": {"required": ["name", "measurement_point"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "description": "Custom name defined by the client for this favorite point", "type": "string", "maxLength": 255, "minLength": 1}, "measurement_point": {"title": "Measurement point", "type": "integer"}, "enterprise_id": {"title": "Enterprise id", "type": "integer", "readOnly": true}, "energy_headquarter_id": {"title": "Energy headquarter id", "type": "integer", "readOnly": true}, "electrical_panel_id": {"title": "Electrical panel id", "type": "integer", "readOnly": true}}}, "BillingCalculationResult": {"required": ["code", "name", "value", "currency"], "type": "object", "properties": {"code": {"title": "Code", "type": "string", "minLength": 1}, "name": {"title": "Name", "type": "string", "minLength": 1}, "value": {"title": "Value", "type": "number", "x-nullable": true}, "currency": {"title": "Currency", "type": "string", "minLength": 1, "x-nullable": true}, "details": {"title": "Details", "type": "object", "additionalProperties": {"type": "string", "x-nullable": true}, "x-nullable": true}}}, "BillingPermission": {"required": ["name"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "code": {"title": "Code", "description": "Technical identifier used to select the billing formula", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", "readOnly": true, "minLength": 1}, "name": {"title": "Name", "type": "string", "maxLength": 255, "minLength": 1}, "billing_type": {"title": "Billing Type", "description": "Indicates whether the concept belongs to water or energy billing.", "type": "string", "enum": ["energy", "water"]}, "is_active": {"title": "Is active", "type": "boolean"}}}, "BillingActive": {"type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "billing_permission": {"$ref": "#/definitions/BillingPermission"}, "currency": {"title": "Currency", "description": "Monetary currency for this charge. If empty, the headquarter Billing Data currency is used.", "type": "string", "enum": ["PEN", "USD", "EUR"], "x-nullable": true}, "rate": {"title": "Rate", "description": "Valor del concepto de tarifa asignado a esta sede.", "type": "number", "x-nullable": true}, "is_active": {"title": "Is active", "type": "boolean"}, "created_at": {"title": "Created at", "type": "string", "format": "date-time", "readOnly": true}, "modified_at": {"title": "Modified at", "type": "string", "format": "date-time", "readOnly": true}}}, "BillingCycleList": {"required": ["energy_headquarter", "start_date", "end_date"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "energy_headquarter": {"title": "Energy headquarter", "type": "integer"}, "name": {"title": "Name", "description": "Nombre del ciclo de facturación. Si se deja vacío se genera automáticamente con el mes de la fecha de fin (ej. \"Octubre 2026\").", "type": "string", "maxLength": 50}, "start_date": {"title": "Start Date", "type": "string", "format": "date"}, "end_date": {"title": "End Date", "type": "string", "format": "date"}, "is_current": {"title": "Is Current Cycle", "type": "boolean"}, "billing_type": {"title": "Billing Type", "description": "Indicates whether the cycle belongs to water or energy billing.", "type": "string", "enum": ["energy", "water"], "default": "energy"}}}, "RateConsumptionCycle": {"required": ["power_contracted", "electrical_panel_type", "energy_provider", "supply_number", "billing_cycle_start", "billing_cycle_end", "ratedays", "totalratedays"], "type": "object", "properties": {"power_contracted": {"title": "Power contracted", "type": "number", "x-nullable": true}, "electrical_panel_type": {"title": "Electrical panel type", "type": "string", "x-nullable": true}, "energy_provider": {"title": "Energy provider", "type": "string", "x-nullable": true}, "supply_number": {"title": "Supply number", "type": "string", "x-nullable": true}, "billing_cycle_start": {"title": "Billing cycle start", "type": "string", "x-nullable": true}, "billing_cycle_end": {"title": "Billing cycle end", "type": "string", "x-nullable": true}, "ratedays": {"title": "Ratedays", "type": "integer", "x-nullable": true}, "totalratedays": {"title": "Totalratedays", "type": "integer", "x-nullable": true}}}, "HarmonicDistortionCurrent": {"required": ["THDIr", "THDIs", "THDIt"], "type": "object", "properties": {"THDIr": {"title": "Thdir", "type": "number", "x-nullable": true}, "THDIs": {"title": "Thdis", "type": "number", "x-nullable": true}, "THDIt": {"title": "Thdit", "type": "number", "x-nullable": true}}}, "HarmonicDistortionVoltage": {"required": ["THDVr", "THDVs", "THDVt"], "type": "object", "properties": {"THDVr": {"title": "Thdvr", "type": "number", "x-nullable": true}, "THDVs": {"title": "Thdvs", "type": "number", "x-nullable": true}, "THDVt": {"title": "Thdvt", "type": "number", "x-nullable": true}}}, "HarmonicDistortionItem": {"required": ["id", "date", "time"], "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "date": {"title": "Date", "type": "string", "minLength": 1}, "time": {"title": "Time", "type": "string", "minLength": 1}, "current": {"$ref": "#/definitions/HarmonicDistortionCurrent"}, "voltage": {"$ref": "#/definitions/HarmonicDistortionVoltage"}}}, "TopUnbalancedMeasurementPoint": {"required": ["measurement_point_id", "measurement_point_name", "total_readings", "current_unbalanced", "voltage_unbalanced", "total_unbalanced"], "type": "object", "properties": {"measurement_point_id": {"title": "Measurement point id", "type": "integer"}, "measurement_point_name": {"title": "Measurement point name", "type": "string", "minLength": 1}, "total_readings": {"title": "Total readings", "type": "integer"}, "current_unbalanced": {"title": "Current unbalanced", "type": "integer", "x-nullable": true}, "voltage_unbalanced": {"title": "Voltage unbalanced", "type": "integer", "x-nullable": true}, "total_unbalanced": {"title": "Total unbalanced", "type": "integer"}}}, "MostThreeUnbalancedResult": {"required": ["date", "top_unbalanced_measurement_points"], "type": "object", "properties": {"date": {"title": "Date", "type": "string", "minLength": 1}, "top_unbalanced_measurement_points": {"type": "array", "items": {"$ref": "#/definitions/TopUnbalancedMeasurementPoint"}}}}, "PowersReading": {"required": ["created_at", "device", "indicators"], "type": "object", "properties": {"created_at": {"title": "Created at", "type": "string", "format": "date-time"}, "device": {"title": "Device", "type": "object"}, "indicators": {"title": "Indicators", "type": "object"}}}, "PowerThresholds": {"required": ["power_max", "power_contracted", "power_installed"], "type": "object", "properties": {"power_max": {"title": "Power max", "type": "number", "x-nullable": true}, "power_contracted": {"title": "Power contracted", "type": "number", "x-nullable": true}, "power_installed": {"title": "Power installed", "type": "number", "x-nullable": true}}}, "ValuesPerChannel": {"required": ["measurement_point_name"], "type": "object", "properties": {"measurement_point_name": {"title": "Measurement point name", "type": "string", "minLength": 1, "x-nullable": true}, "power": {"title": "Power", "type": "number", "x-nullable": true}, "power_avg": {"title": "Power avg", "type": "number", "x-nullable": true}, "power_peak": {"title": "Power peak", "type": "number", "x-nullable": true}}}, "PowerGraphResultItem": {"required": ["created_at", "values_per_channel", "unit"], "type": "object", "properties": {"created_at": {"title": "Created at", "type": "string", "format": "date-time"}, "values_per_channel": {"type": "array", "items": {"$ref": "#/definitions/ValuesPerChannel"}}, "unit": {"title": "Unit", "type": "string", "minLength": 1}, "device": {"title": "Device", "type": "string", "minLength": 1}}}, "PowersByElectricalPanelGraphResponse": {"required": ["power_thresholds", "results"], "type": "object", "properties": {"power_thresholds": {"$ref": "#/definitions/PowerThresholds"}, "results": {"type": "array", "items": {"$ref": "#/definitions/PowerGraphResultItem"}}}}, "ListDeviceMeasurementPoint": {"required": ["name", "capacity_voltage"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 255, "minLength": 1}, "is_active": {"title": "Is active", "type": "boolean"}, "channel": {"title": "Channel", "type": "string", "readOnly": true}, "type": {"title": "Type", "type": "string", "enum": ["monofasico", "trifasico"]}, "key": {"title": "Key", "description": "Unique identifier for the measurement point, used for integration with external systems", "type": "string", "maxLength": 50, "x-nullable": true}, "capacity": {"title": "Capacity", "description": "Capacity of the measurement point, e.g., 220v/220A", "type": "string", "maxLength": 50, "x-nullable": true}, "capacity_voltage": {"title": "Capacity Voltage", "description": "Voltage capacity of the measurement point in V", "type": "integer", "maximum": 2147483647, "minimum": -2147483648}, "monitoring_topology": {"title": "Monitoring topology", "description": "Define el conjunto de parámetros esperados en lecturas (1F / 3F / 3F+N)", "type": "string", "enum": ["mono_1f", "three_phase_3w", "three_phase_4w"]}, "hardware": {"title": "Hardware", "type": "string", "readOnly": true}, "device": {"title": "Device", "type": "string", "readOnly": true}, "electrical_panel": {"title": "Electrical panel", "type": "string", "readOnly": true, "minLength": 1}, "location_reference": {"title": "Location Reference", "description": "Descriptive reference about the physical location of the measurement point", "type": "string", "x-nullable": true}, "thresholds": {"title": "Thresholds", "type": "string", "readOnly": true}}}, "LoadImbalanceCurrent": {"required": ["created_at", "device", "balance_status", "cuf_percentage"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "created_at": {"title": "Created at", "type": "string", "format": "date-time"}, "device": {"title": "Device", "type": "object"}, "values_per_channel": {"title": "Values per channel", "type": "string", "readOnly": true}, "balance_status": {"title": "Balance status", "type": "string", "minLength": 1}, "cuf_percentage": {"title": "Cuf percentage", "type": "integer"}}}, "UnbalancedCountersDateRange": {"required": ["date_after", "date_before"], "type": "object", "properties": {"date_after": {"title": "Date after", "type": "string", "format": "date", "x-nullable": true}, "date_before": {"title": "Date before", "type": "string", "format": "date", "x-nullable": true}}}, "UnbalancedCountersItem": {"required": ["date", "unbalanced_count"], "type": "object", "properties": {"date": {"title": "Date", "type": "string", "minLength": 1}, "unbalanced_count": {"title": "Unbalanced count", "type": "integer"}}}, "GraphUnbalancedCounters": {"required": ["date_range", "results"], "type": "object", "properties": {"date_range": {"$ref": "#/definitions/UnbalancedCountersDateRange"}, "results": {"type": "array", "items": {"$ref": "#/definitions/UnbalancedCountersItem"}}}}, "LoadImbalanceVoltage": {"required": ["created_at", "device", "balance_status", "vuf_percentage"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "created_at": {"title": "Created at", "type": "string", "format": "date-time"}, "device": {"title": "Device", "type": "object"}, "values_per_channel": {"title": "Values per channel", "type": "string", "readOnly": true}, "balance_status": {"title": "Balance status", "type": "string", "minLength": 1}, "vuf_percentage": {"title": "Vuf percentage", "type": "integer"}}}, "GroupedReading": {"required": ["created_at", "indicators"], "type": "object", "properties": {"created_at": {"title": "Created at", "type": "string", "format": "date-time"}, "indicators": {"title": "Indicators", "type": "object"}}}, "EnergyGraphReading": {"required": ["period", "first_reading", "last_reading", "indicator", "unit", "first_value", "last_value", "difference", "measurement_point"], "type": "object", "properties": {"period": {"title": "Period", "type": "string", "format": "date-time"}, "first_reading": {"title": "First reading", "type": "string", "format": "date-time"}, "last_reading": {"title": "Last reading", "type": "string", "format": "date-time"}, "indicator": {"title": "Indicator", "type": "string", "minLength": 1}, "unit": {"title": "Unit", "type": "string", "minLength": 1}, "first_value": {"title": "First value", "type": "number"}, "last_value": {"title": "Last value", "type": "number"}, "difference": {"title": "Difference", "type": "number"}, "measurement_point": {"title": "Measurement point", "type": "string", "minLength": 1}}}, "EnergyGraphReadingsEspecificResult": {"type": "object", "properties": {}}, "Alert": {"type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "timestamp": {"title": "Timestamp", "type": "string", "format": "date-time", "readOnly": true}, "status": {"title": "Status", "type": "string", "enum": ["new", "acknowledged", "resolved"]}, "alert_status": {"title": "Alert status", "type": "string", "enum": ["moderate", "critical"]}, "alert_threshold": {"title": "Alert threshold", "type": "string", "readOnly": true}, "reading": {"title": "Reading", "type": "string", "readOnly": true}, "reported": {"title": "Reported", "description": "Indicates if the alert has been reported via email", "type": "boolean"}, "reported_at": {"title": "Reported at", "type": "string", "format": "date-time", "x-nullable": true}, "notes": {"title": "Notes", "type": "string", "x-nullable": true}}}, "ElectricalPanelHierarchy": {"required": ["name"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 255, "minLength": 1}, "is_active": {"title": "Is active", "type": "boolean"}, "type": {"title": "Tipo", "type": "string", "enum": ["monofasico", "trifasico"]}, "threads": {"title": "Hilos", "type": "integer", "maximum": 2147483647, "minimum": -2147483648, "x-nullable": true}, "devices": {"title": "Devices", "type": "string", "readOnly": true}}}, "HeadquarterTariffPdf": {"required": ["title", "pdf_url"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "title": {"title": "Title", "type": "string", "maxLength": 255, "minLength": 1}, "pdf_url": {"title": "PDF URL", "type": "string", "format": "uri", "maxLength": 2000, "minLength": 1}}}, "WaterPipeCycleInfo": {"required": ["id", "name", "is_main", "measurement_points"], "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "name": {"title": "Name", "type": "string", "minLength": 1}, "is_main": {"title": "Is main", "type": "boolean"}, "measurement_points": {"title": "Measurement points", "type": "integer"}}}, "WaterRateConsumptionCycle": {"required": ["water_discharge_factor", "billing_cycle_start", "billing_cycle_end", "ratedays", "totalratedays", "water_pipes"], "type": "object", "properties": {"water_discharge_factor": {"title": "Water discharge factor", "type": "number", "x-nullable": true}, "billing_cycle_start": {"title": "Billing cycle start", "type": "string", "x-nullable": true}, "billing_cycle_end": {"title": "Billing cycle end", "type": "string", "x-nullable": true}, "ratedays": {"title": "Ratedays", "type": "integer", "x-nullable": true}, "totalratedays": {"title": "Totalratedays", "type": "integer", "x-nullable": true}, "water_pipes": {"type": "array", "items": {"$ref": "#/definitions/WaterPipeCycleInfo"}}}}, "GroupedReadingWater": {"required": ["created_at", "indicators"], "type": "object", "properties": {"created_at": {"title": "Created at", "type": "string", "format": "date-time"}, "indicators": {"title": "Indicators", "type": "object"}}}, "WaterGraphReading": {"required": ["period", "first_reading", "last_reading", "indicator", "unit", "first_value", "last_value", "difference", "measurement_point"], "type": "object", "properties": {"period": {"title": "Period", "type": "string", "format": "date-time", "x-nullable": true}, "first_reading": {"title": "First reading", "type": "string", "format": "date-time"}, "last_reading": {"title": "Last reading", "type": "string", "format": "date-time"}, "indicator": {"title": "Indicator", "type": "string", "minLength": 1}, "unit": {"title": "Unit", "type": "string", "minLength": 1}, "first_value": {"title": "First value", "type": "number"}, "last_value": {"title": "Last value", "type": "number"}, "difference": {"title": "Difference", "type": "number", "x-nullable": true}, "measurement_point": {"title": "Measurement point", "type": "string", "minLength": 1}}}, "WaterGraphEspecificResult": {"type": "object", "properties": {}}, "ListMeasurementPointWater": {"required": ["name"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 255, "minLength": 1}, "is_active": {"title": "Is active", "type": "boolean"}, "is_main": {"title": "Is Main", "description": "Indicates if this is the main measurement point for the main water pipe", "type": "boolean"}, "water_pipe": {"title": "Water pipe", "type": "string", "readOnly": true, "minLength": 1}}}, "EnsureControlDeviceState": {"required": ["state", "entity_id"], "type": "object", "properties": {"state": {"title": "State", "type": "string", "enum": ["MO", "MF", "AF", "AO"]}, "entity_id": {"title": "Entity id", "type": "string", "maxLength": 24, "minLength": 1}}}, "CommentAlert": {"required": ["content"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "created_at": {"title": "Created at", "type": "string", "format": "date-time", "readOnly": true}, "email": {"title": "Email", "type": "string", "readOnly": true, "minLength": 1}, "content": {"title": "Content", "type": "string", "minLength": 1}}}, "LimitAlert": {"required": ["indicator", "value", "level"], "type": "object", "properties": {"created_at": {"title": "Created at", "type": "string", "format": "date-time", "readOnly": true}, "indicator": {"title": "Indicador", "type": "string", "maxLength": 15, "minLength": 1}, "unit": {"title": "Unidad", "type": "string", "maxLength": 15}, "value": {"title": "Valor", "type": "string", "maxLength": 10, "minLength": 1}, "level": {"title": "Level", "type": "string", "minLength": 1}, "resolved": {"title": "Resuelto", "type": "boolean"}}}, "Department": {"required": ["name"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 100, "minLength": 1}}}, "EnergyHeadquarterPowersCompact": {"type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 50, "minLength": 1, "x-nullable": true}, "is_active": {"title": "Is active", "type": "boolean"}, "department": {"$ref": "#/definitions/Department"}, "electrical_panels": {"type": "array", "items": {"$ref": "#/definitions/ElectricalPanel"}, "readOnly": true}}}, "UserMe": {"required": ["email", "first_name", "last_name"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "email": {"title": "Email address", "type": "string", "format": "email", "maxLength": 254, "minLength": 1}, "first_name": {"title": "First name", "type": "string", "maxLength": 100, "minLength": 1}, "last_name": {"title": "Last name", "type": "string", "maxLength": 100, "minLength": 1}, "companies": {"title": "Companies", "type": "string", "readOnly": true}, "is_user_energy_monitoring": {"title": "User Energy Monitoring", "type": "boolean"}, "is_user_water_monitoring": {"title": "User Water Monitoring", "type": "boolean"}}}, "WaterPipe": {"required": ["name"], "type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 255, "minLength": 1}, "is_active": {"title": "Is active", "type": "boolean"}, "is_main": {"title": "Is Main", "description": "Indicates if this is the main water pipe for the headquarter", "type": "boolean"}}}, "EnergyHeadquarterWaterPipes": {"type": "object", "properties": {"id": {"title": "ID", "type": "integer", "readOnly": true}, "name": {"title": "Name", "type": "string", "maxLength": 50, "minLength": 1, "x-nullable": true}, "is_active": {"title": "Is active", "type": "boolean"}, "department": {"$ref": "#/definitions/Department"}, "water_pipes": {"type": "array", "items": {"$ref": "#/definitions/WaterPipe"}, "readOnly": true}}}, "CreateReadingWater": {"required": ["devEUI", "password"], "type": "object", "properties": {"devEUI": {"title": "Deveui", "type": "string", "maxLength": 22, "minLength": 1}, "password": {"title": "Password", "type": "string", "maxLength": 255, "minLength": 1}, "bateria_v": {"title": "Bateria v", "type": "number", "x-nullable": true}, "consumo_litros": {"title": "Consumo litros", "type": "number", "x-nullable": true}, "consumo_m3": {"title": "Consumo m3", "type": "number", "x-nullable": true}, "estado_bateria": {"title": "Estado bateria", "type": "string", "maxLength": 50, "x-nullable": true}, "estado_medicion": {"title": "Estado medicion", "type": "string", "maxLength": 50, "x-nullable": true}, "estado_tuberia": {"title": "Estado tuberia", "type": "string", "maxLength": 50, "x-nullable": true}, "estado_valvula": {"title": "Estado valvula", "type": "string", "maxLength": 50, "x-nullable": true}, "litros_por_pulso": {"title": "Litros por pulso", "type": "number", "x-nullable": true}, "rssi": {"title": "Rssi", "type": "number", "x-nullable": true}, "snr": {"title": "Snr", "type": "number", "x-nullable": true}}}}}