{"openapi":"3.0.0","info":{"version":"3.0.2","title":"API for Edge Commercial","description":"### Note: These APIs support **API token-based requests**\n\nPlease enter your API key by clicking on the **Authorize** button above. Once authorized, you can access all available APIs.\n\nFor large datasets, we recommend using tools like **Postman** or **cURL** to avoid browser performance issues, as recent Swagger UI updates may cause the page to freeze when displaying large amounts of data.\n\n### v3.0.0 Updates:\n- Introduced data versioning and change logs for updated records and APIs.\n- Added support for the Transformer Configuration field.\n- Included Company Name in device-level metadata.\n- Returned Electrical System details for each device.\n- Enabled 15-minute granularity support for interval data.\n- Added `UTC`, local device time, and `timezone` fields in applicable endpoints.\n- Added aggregate endpoint for the dashboard aggregate representation.\n\n### v3.0.1 Updates:\n- Introduced `config` on the `/devices` API to capture `channel_label`, `ct_rating`, and `polarity` for each device.\n\n### v3.0.2 Updates:\n- Added `mv_enabled` flag at the device level to indicate medium voltage transformer presence.\n- Added `primary_v` and `secondary_v` per channel to support MV potential transformer (PT) ratio calculation.\n- Added `ct_factor` per channel — pre-calculated as `ct_rating / 60` for client-side current transformer scaling.\n- Added `pt_ratio` per channel — pre-calculated as `primary_v / secondary_v` when `mv_enabled = Y`, otherwise `null`.\n- Watt/power fields are now returned **raw** (unscaled). Clients must apply scaling factors independently.\n- Added `ct_factor`, `mv_enabled`, `primary_v`, `secondary_v`, and `pt_ratio` to `/powerquality/live` and `/powerquality/interval` responses.\n\n### Client-side Scaling Formula\nAll watt/power values returned by the API are **raw and unscaled**. Apply the following formula to obtain the true scaled value:\n\n```\nscaled_value = raw_value\n             × (polarity === \"Negative\" ? -1 : 1)\n             × (ct_factor ?? 1)\n             × (pt_ratio ?? 1)\n```\n"},"servers":[{"description":"Edge API","url":"https://api.edgeapi-v1.com/ees/"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"ChannelConfig":{"type":"object","description":"Per-channel configuration and scaling metadata.","properties":{"channel":{"type":"integer","description":"Channel number.","example":1},"ct_rating":{"type":"number","nullable":true,"description":"Current transformer primary rating in amps (e.g. 200 for a 200:5A CT). Null if not configured.","example":200},"ct_factor":{"type":"number","nullable":true,"description":"Pre-calculated current transformer scaling factor (`ct_rating / 60`).\nMultiply raw watt/power values by this factor client-side.\nNull if `ct_rating` is not configured.\n","example":3.333333},"config_channel_polarity":{"type":"string","enum":["Positive","Negative"],"description":"Direction of current flow for this channel.","example":"Positive"},"channel_label":{"type":"string","description":"Custom label for the circuit (e.g. \"Solar\", \"Grid\", \"NIU\").","example":"Main Incomer"},"primary_v":{"type":"number","nullable":true,"description":"Primary voltage of the potential transformer (MV side). Null if not configured.","example":11000},"secondary_v":{"type":"number","nullable":true,"description":"Secondary voltage of the potential transformer (LV side). Null if not configured.","example":110},"pt_ratio":{"type":"number","nullable":true,"description":"Pre-calculated potential transformer ratio (`primary_v / secondary_v`).\nOnly populated when `mv_enabled = Y` and both `primary_v` and `secondary_v` are set.\nMultiply raw watt/power values by this factor client-side.\nNull otherwise.\n","example":100.0}}},"PowerQualityMeta":{"type":"object","description":"Scaling metadata fields included on every power quality record.","properties":{"polarity":{"type":"string","enum":["Positive","Negative"],"description":"Direction of current for this channel. Apply as a ×1 or ×−1 factor client-side.","example":"Positive"},"ct_rating":{"type":"number","nullable":true,"description":"Current transformer primary rating in amps. Null if not configured.","example":200},"ct_factor":{"type":"number","nullable":true,"description":"Pre-calculated CT scaling factor (`ct_rating / 60`).\nNull if `ct_rating` is not configured.\n","example":3.333333},"mv_enabled":{"type":"string","enum":["Y","N"],"description":"Whether this device is connected to a medium voltage transformer.","example":"N"},"primary_v":{"type":"number","nullable":true,"description":"Primary voltage of the PT (MV side). Null if not applicable.","example":11000},"secondary_v":{"type":"number","nullable":true,"description":"Secondary voltage of the PT (LV side). Null if not applicable.","example":110},"pt_ratio":{"type":"number","nullable":true,"description":"Pre-calculated PT ratio (`primary_v / secondary_v`).\nPopulated only when `mv_enabled = Y`. Null otherwise.\n","example":100.0}}}}},"paths":{"/devices":{"get":{"security":[{"ApiKeyAuth":[]}],"summary":"Returns device details based on the API Key","description":"**The below table defines the output response this API returns**\n\n| Name                  | Description                                                                                         |\n| --------------------- | ----------------------------------------------------------------------------------------------------|\n| device_serialid       | Unique ID of the device.                                                                            |\n| circuit_config_name   | Transformer configuration of the device.                                                            |\n| customer              | Denotes the owner of the site.                                                                      |\n| site_label            | Custom label for site identification.                                                               |\n| site_address          | Address where the device is installed.                                                              |\n| lat                   | Latitude.                                                                                           |\n| lng                   | Longitude.                                                                                          |\n| site_type             | `C` = Commercial, `R` = Residential.                                                                |\n| partner               | Company the device was purchased from.                                                              |\n| inactive              | Whether the device is active.                                                                       |\n| install_date          | When the device was installed (epoch format).                                                       |\n| product               | Type of product installed.                                                                          |\n| mv_enabled            | `Y` if the device is connected to a medium voltage (MV) transformer, `N` otherwise.                |\n| config                | Per-channel configuration array. See schema below.                                                  |\n\n**`config` array — per-channel fields:**\n\n| Field                    | Description                                                                                      |\n| ------------------------ | -------------------------------------------------------------------------------------------------|\n| channel                  | Channel number.                                                                                  |\n| ct_rating                | Current transformer primary rating in amps (e.g. 200 for a 200:5A CT). Null if not configured.  |\n| ct_factor                | Pre-calculated CT scaling factor (`ct_rating / 60`). Null if `ct_rating` is not configured.     |\n| config_channel_polarity  | Direction of current flow: `Positive` or `Negative`.                                            |\n| channel_label            | Custom label for the circuit (e.g. \"NIU\", \"Solar\", \"Main Incomer\").                             |\n| primary_v                | Primary voltage of the potential transformer (MV side). Null if not applicable.                  |\n| secondary_v              | Secondary voltage of the potential transformer (LV side). Null if not applicable.                |\n| pt_ratio                 | Pre-calculated PT ratio (`primary_v / secondary_v`). Populated only when `mv_enabled = Y`.      |\n","parameters":[{"in":"query","name":"device_serialid","schema":{"type":"string"},"description":"(Optional) Filter by device serial ID. Omit to list all devices in your fleet.","example":"EXXXXXXXXXXXX"}],"responses":{"200":{"description":"OK"},"406":{"description":"Invalid device request"},"404":{"description":"Contact our support"}}}},"/events/interval/{device_serialid}":{"get":{"security":[{"ApiKeyAuth":[]}],"summary":"Returns event details based on the device_serialid provided within the time stamps","description":"**The below table defines the output response this API returns**\n\n| Name       | Description                                                                                                   |\n| ---------- | --------------------------------------------------------------------------------------------------------------|\n| epochtime  | Unix timestamp in seconds of the date/time when data was received.                                            |\n| type       | An enum describing the type of monitoring data sent by the device.                                            |\n| value      | List of JSON objects, each representing a device channel or phase with key-value pairs of monitoring params.  |\n\n**Event type codes:**\n\n| Tag | Description                                                                 |\n| --- | ----------------------------------------------------------------------------|\n| 34  | Frequency, voltage, and current is out of range or static reading           |\n| 97  | Voltage reading has exceeded under voltage warning threshold event           |\n| 99  | Voltage reading has exceeded over voltage warning threshold event            |\n| 101 | Voltage reading has exceeded vsag threshold event                           |\n| 102 | Voltage reading has exceeded vswell threshold event                         |\n| 103 | Voltage reading has exceeded vflicker threshold event                       |\n| 104 | Voltage reading has exceeded no voltage threshold event                     |\n| 105 | Voltage reading has exceeded imbalance threshold with other phase voltage    |\n| 106 | VTHD reading has exceeded max VTHD threshold event                          |\n| 108 | Lower RVC event                                                             |\n| 109 | Upper RVC event                                                             |\n| 129 | Current reading has exceeded no current threshold event                     |\n| 130 | Current reading has exceeded over current warning threshold event            |\n| 132 | Negative current is detected                                                |\n| 134 | Power good is detected                                                      |\n| 136 | Peak demand alert detected                                                  |\n| 137 | Current reading has exceeded imbalance threshold with other phase current    |\n| 138 | ITHD reading has exceeded max ITHD threshold event                          |\n| 161 | PF reading has exceeded under PF warning threshold event                    |\n| 163 | Power reading has exceeded power overload warning threshold event            |\n| 166 | Confirmed Power Outage (30sec power confirmation check)                     |\n| 167 | Power Interruption (Loss of Supply)                                         |\n| 193 | Frequency reading has exceeded under frequency warning threshold event       |\n| 195 | Frequency reading has exceeded over frequency warning threshold event        |\n| 111 | Loss of phase voltage                                                       |\n| 112 | Partial voltage loss                                                        |\n","parameters":[{"in":"path","name":"device_serialid","required":true,"schema":{"type":"string"},"description":"Returns events based on the device serial provided.","example":"EXXXXXXXXXXXX"},{"in":"query","name":"starttime","required":true,"schema":{"type":"integer"},"description":"Start of the search time range in epoch seconds.","example":1687183200},{"in":"query","name":"endtime","required":true,"schema":{"type":"integer"},"description":"End of the search time range in epoch seconds.","example":1687269600}],"responses":{"200":{"description":"OK"},"406":{"description":"Invalid device request"},"404":{"description":"Contact our support"}}}},"/powerquality/live/{device_serialid}":{"get":{"security":[{"ApiKeyAuth":[]}],"summary":"Returns live power quality based on the serialid provided","description":"**The below table defines the output response this API returns**\n\n| Name          | Description                                                                                              |\n| ------------- | ---------------------------------------------------------------------------------------------------------|\n| sampledate    | Unix timestamp in seconds of the date/time when data was received.                                       |\n| phase         | Channel readout (phase0 = Channel 1; phase1 = Channel 2; phase2 = Channel 3; phase3 = General Params).   |\n| watt          | Active power from the channel — **raw, unscaled**. Apply scaling formula below.                         |\n| va            | Apparent power from the channel.                                                                         |\n| var           | Reactive power from the channel.                                                                         |\n| voltage/vrms  | VAVE = 30-second average of the voltage RMS reading.                                                     |\n| current/irms  | IAVE = 30-second average of the current RMS reading.                                                     |\n| pf            | Power factor = 30-second average.                                                                        |\n| imax          | Max current RMS reading (Gridlogger only).                                                               |\n| imin          | Min current RMS reading (Gridlogger only).                                                               |\n| vmax          | Max voltage RMS reading (Gridlogger only).                                                               |\n| vmin          | Min voltage RMS reading (Gridlogger only).                                                               |\n| ithd          | Current harmonic distortion.                                                                             |\n| vthd          | Voltage harmonic distortion.                                                                             |\n| channel_label | Custom label for the circuit.                                                                            |\n| polarity      | Direction of current (`Positive` / `Negative`). Use as ×1 or ×−1 in scaling formula.                    |\n| ct_rating     | Current transformer primary rating in amps. Null if not configured.                                      |\n| ct_factor     | Pre-calculated CT scaling factor (`ct_rating / 60`). Null if not configured.                             |\n| mv_enabled    | `Y` if device is on a medium voltage transformer, `N` otherwise.                                         |\n| primary_v     | Primary voltage of the PT (MV side). Null if not applicable.                                             |\n| secondary_v   | Secondary voltage of the PT (LV side). Null if not applicable.                                           |\n| pt_ratio      | Pre-calculated PT ratio (`primary_v / secondary_v`). Null if `mv_enabled ≠ Y`.                           |\n\n**Client-side scaling formula for watt/power fields:**\n```\nscaled_value = raw_value\n             × (polarity === \"Negative\" ? -1 : 1)\n             × (ct_factor ?? 1)\n             × (pt_ratio ?? 1)\n```\n","parameters":[{"in":"path","name":"device_serialid","required":true,"schema":{"type":"string"},"example":"EXXXXXXXXXXXX"}],"responses":{"200":{"description":"OK"},"406":{"description":"Invalid device request"},"404":{"description":"Contact our support"}}}},"/powerquality/interval/{device_serialid}":{"get":{"security":[{"ApiKeyAuth":[]}],"summary":"Returns power quality data based on the provided serialid and time stamps","description":"**The below table defines the output response this API returns**\n\n| Name                      | Description                                                                                              |\n| ------------------------- | ---------------------------------------------------------------------------------------------------------|\n| sampledate_utc            | UTC timestamp in epoch format.                                                                           |\n| sampledate                | Local timestamp based on the device's location (epoch seconds).                                          |\n| timezone                  | Timezone the device belongs to.                                                                          |\n| phase                     | Channel readout (phase0 = Channel 1; phase1 = Channel 2; etc.).                                          |\n| realpower_ave             | Active power from the channel — **raw, unscaled**. Apply scaling formula below.                         |\n| apparent_power            | Apparent power from the channel.                                                                         |\n| reactivepower_ave         | Reactive power from the channel.                                                                         |\n| voltage_ave               | VAVE = 30-second average of the voltage RMS reading.                                                     |\n| current_ave               | IAVE = 30-second average of the current RMS reading.                                                     |\n| pf_ave                    | Power factor = 30-second average.                                                                        |\n| ithd_ave                  | Current harmonic distortion average.                                                                     |\n| vthd_ave                  | Voltage harmonic distortion average.                                                                     |\n| fundamental_voltage_ave   | Nominal/standard voltage level average.                                                                  |\n| total_harmonic_voltage    | Ratio of harmonic component power to fundamental frequency power (voltage).                              |\n| fundamental_current_ave   | Nominal/standard current level average.                                                                  |\n| total_harmonic_current    | Ratio of harmonic component power to fundamental frequency power (current).                              |\n| harm_current_ave 3–21     | Individual current harmonics.                                                                            |\n| harm_voltage_ave 3–21     | Individual voltage harmonics.                                                                            |\n| channel_label             | Custom label for the circuit.                                                                            |\n| polarity                  | Direction of current (`Positive` / `Negative`). Use as ×1 or ×−1 in scaling formula.                    |\n| ct_rating                 | Current transformer primary rating in amps. Null if not configured.                                      |\n| ct_factor                 | Pre-calculated CT scaling factor (`ct_rating / 60`). Null if not configured.                             |\n| mv_enabled                | `Y` if device is on a medium voltage transformer, `N` otherwise.                                         |\n| primary_v                 | Primary voltage of the PT (MV side). Null if not applicable.                                             |\n| secondary_v               | Secondary voltage of the PT (LV side). Null if not applicable.                                           |\n| pt_ratio                  | Pre-calculated PT ratio (`primary_v / secondary_v`). Null if `mv_enabled ≠ Y`.                           |\n\n**Client-side scaling formula for watt/power fields:**\n```\nscaled_value = raw_value\n             × (polarity === \"Negative\" ? -1 : 1)\n             × (ct_factor ?? 1)\n             × (pt_ratio ?? 1)\n```\n","parameters":[{"in":"path","name":"device_serialid","required":true,"schema":{"type":"string"},"example":"EXXXXXXXXXXXX"},{"in":"query","name":"starttime","required":true,"schema":{"type":"integer"},"example":1687317720,"description":"Start of the time range in epoch seconds."},{"in":"query","name":"endtime","required":true,"schema":{"type":"integer"},"example":1687317720,"description":"End of the time range in epoch seconds."},{"in":"query","name":"granularity","required":true,"schema":{"type":"string","enum":["1m","5m","15m","1h","daily"]},"description":"Granularity of the time range.\n\n- For **1 day**: All granularities are allowed (1m, 5m, 15m, 1h, daily).\n- For **1 day to 1 week**: Only 15m, 1h, and daily are allowed.\n- For **more than 1 week**: Only 1h and daily are allowed.\n\nIf the payload size exceeds 5 MB the data will be truncated and a granularity suggestion will be provided.\n","example":"15m"}],"responses":{"200":{"description":"OK"},"406":{"description":"Invalid device request"},"404":{"description":"Contact our support"}}}},"/powerquality/aggregated/{device_serialid}":{"get":{"security":[{"ApiKeyAuth":[]}],"summary":"Returns aggregated power quality data based on the provided serialid and time stamps","description":"**The below table defines the output response this API returns**\n\n| Name                | Description                                                                                 |\n| ------------------- | --------------------------------------------------------------------------------------------|\n| sampledate_utc      | UTC timestamp in epoch format (seconds).                                                    |\n| sampledate          | Local timestamp based on the device's location (epoch seconds).                             |\n| timezone            | Timezone the device belongs to (e.g. `Australia/Sydney`).                                   |\n| channel_label       | Custom label for the circuit or device channel (e.g. Solar, Grid, Load).                    |\n| phases_included     | Array of phase indices included in this aggregated record (e.g. `[\"1\", \"3\"]`).              |\n| phase_count         | Number of unique phases present in this record.                                             |\n| total_voltage_thd   | Average voltage harmonic distortion (THD) across all phases.                                |\n| total_current_thd   | Average current harmonic distortion (THD) across all phases.                                |\n| frequency           | Frequency in Hz (averaged across phases).                                                   |\n| power_factor        | Overall power factor (weighted average by power magnitude, 0–1 range).                      |\n| total_kvar          | Total reactive power in kVAR (sum across phases, converted from VAR).                       |\n| power               | Total real/active power in kW (sum across phases).                                          |\n| consumption         | Energy consumption in kW — equivalent to `power` at the sample interval.                   |\n| total_va            | Total apparent power in kVA (sum across phases, converted from VA).                         |\n\n> **Note:** NIU-labelled channels are excluded from aggregation.\n\n> **Note:** Aggregated values are derived from **raw unscaled** interval data.\n> The same client-side scaling formula applies if you need true physical values:\n> ```\n> scaled_value = raw_value\n>              × (polarity === \"Negative\" ? -1 : 1)\n>              × (ct_factor ?? 1)\n>              × (pt_ratio ?? 1)\n> ```\n","parameters":[{"in":"path","name":"device_serialid","required":true,"schema":{"type":"string"},"example":"EXXXXXXXXXXXX"},{"in":"query","name":"starttime","required":true,"schema":{"type":"integer"},"example":1687317720,"description":"Start of the time range in epoch seconds."},{"in":"query","name":"endtime","required":true,"schema":{"type":"integer"},"example":1687317720,"description":"End of the time range in epoch seconds."},{"in":"query","name":"granularity","required":true,"schema":{"type":"string","enum":["1m","5m","15m","1h","daily"]},"description":"Granularity of the time range.\n\n- For **1 day**: All granularities are allowed (1m, 5m, 15m, 1h, daily).\n- For **1 day to 1 week**: Only 15m, 1h, and daily are allowed.\n- For **more than 1 week**: Only 1h and daily are allowed.\n\nIf the payload size exceeds 5 MB the data will be truncated and a granularity suggestion will be provided.\n","example":"15m"}],"responses":{"200":{"description":"OK"},"406":{"description":"Invalid device request"},"404":{"description":"Contact our support"}}}}}}