{
  "openapi": "3.1.1",
  "info": {
    "title": "Praysio Automation Public API's",
    "description": "Public API interface for the Praysio Platform",
    "contact": {
      "name": "Support",
      "url": "https://praysio.com/portal-help-centre",
      "email": "support@praysio.com"
    },
    "license": {
      "name": "Praysio API License",
      "url": "https://www.praysio.com/eula"
    },
    "version": "1.3"
  },
  "servers": [
    {
      "url": "https://automation.praysio.com/"
    }
  ],
  "paths": {
    "/api/v1.3/PraysioCore/MeterDetail": {
      "get": {
        "tags": [
          "PraysioCore"
        ],
        "summary": "Provides details on all meters and their associated channels available within the API Group as configured in the Praysio Portal.",
        "parameters": [
          {
            "name": "APIKey",
            "in": "header",
            "description": "Provides details on all meters and their associated channels available within the API Group as configured in the Praysio Portal.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "MeterReference",
            "in": "query",
            "description": "Provides details on all meters and their associated channels available within the API Group as configured in the Praysio Portal.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "default": {
            "description": "",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MeterDetailDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MeterDetailDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MeterDetailDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1.3/PraysioCore/MeterConsumption": {
      "get": {
        "tags": [
          "PraysioCore"
        ],
        "summary": "Provides meter consumption (usage) for a specific meter/channel over a time period.",
        "parameters": [
          {
            "name": "APIKey",
            "in": "header",
            "description": "Provides meter consumption (usage) for a specific meter/channel over a time period.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "MeterReference",
            "in": "query",
            "description": "Provides meter consumption (usage) for a specific meter/channel over a time period.",
            "schema": {
              "maxLength": 50,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "ChannelName",
            "in": "query",
            "description": "Provides meter consumption (usage) for a specific meter/channel over a time period.",
            "schema": {
              "maxLength": 30,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "PeriodStart",
            "in": "query",
            "description": "Provides meter consumption (usage) for a specific meter/channel over a time period.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "PeriodEnd",
            "in": "query",
            "description": "Provides meter consumption (usage) for a specific meter/channel over a time period.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "PeriodBase",
            "in": "query",
            "description": "Provides meter consumption (usage) for a specific meter/channel over a time period.",
            "schema": {
              "maximum": 31622400,
              "minimum": 1800,
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Multiplier",
            "in": "query",
            "description": "Provides meter consumption (usage) for a specific meter/channel over a time period.",
            "schema": {
              "maximum": 1000,
              "minimum": -1000,
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "float"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "default": {
            "description": "",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MeterConsumptionDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MeterConsumptionDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MeterConsumptionDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1.3/PraysioCore/MeterReadings": {
      "get": {
        "tags": [
          "PraysioCore"
        ],
        "summary": "Provides meter readings for a specific meter/channel over a time period.",
        "parameters": [
          {
            "name": "APIKey",
            "in": "header",
            "description": "Provides meter readings for a specific meter/channel over a time period.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "MeterReference",
            "in": "query",
            "description": "Provides meter readings for a specific meter/channel over a time period.",
            "schema": {
              "maxLength": 50,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "ChannelName",
            "in": "query",
            "description": "Provides meter readings for a specific meter/channel over a time period.",
            "schema": {
              "maxLength": 30,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "PeriodStart",
            "in": "query",
            "description": "Provides meter readings for a specific meter/channel over a time period.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "PeriodEnd",
            "in": "query",
            "description": "Provides meter readings for a specific meter/channel over a time period.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "PeriodBase",
            "in": "query",
            "description": "Provides meter readings for a specific meter/channel over a time period.",
            "schema": {
              "maximum": 527040,
              "minimum": 1800,
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Multiplier",
            "in": "query",
            "description": "Provides meter readings for a specific meter/channel over a time period.",
            "schema": {
              "maximum": 1000,
              "minimum": -1000,
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "float"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "default": {
            "description": "",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MeterReadingsDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MeterReadingsDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MeterReadingsDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1.3/PraysioCore/GroupMeterReadings": {
      "get": {
        "tags": [
          "PraysioCore"
        ],
        "summary": "Provides a meter reading for a specific or each meter in the API Group at either a specific date/time or ‘live’ if no date/time is provided. A channel type can also optionally be passed returning readings for only that meter type.",
        "parameters": [
          {
            "name": "APIKey",
            "in": "header",
            "description": "Provides a meter reading for a specific or each meter in the API Group at either a specific date/time or ‘live’ if no date/time is provided. A channel type can also optionally be passed returning readings for only that meter type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "MeterReference",
            "in": "query",
            "description": "Provides a meter reading for a specific or each meter in the API Group at either a specific date/time or ‘live’ if no date/time is provided. A channel type can also optionally be passed returning readings for only that meter type.",
            "schema": {
              "maxLength": 50,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "ChannelName",
            "in": "query",
            "description": "Provides a meter reading for a specific or each meter in the API Group at either a specific date/time or ‘live’ if no date/time is provided. A channel type can also optionally be passed returning readings for only that meter type.",
            "schema": {
              "maxLength": 30,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "name": "DateTime",
            "in": "query",
            "description": "Provides a meter reading for a specific or each meter in the API Group at either a specific date/time or ‘live’ if no date/time is provided. A channel type can also optionally be passed returning readings for only that meter type.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "Multiplier",
            "in": "query",
            "description": "Provides a meter reading for a specific or each meter in the API Group at either a specific date/time or ‘live’ if no date/time is provided. A channel type can also optionally be passed returning readings for only that meter type.",
            "schema": {
              "maximum": 1000,
              "minimum": -1000,
              "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
              "type": [
                "number",
                "string"
              ],
              "format": "float"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "default": {
            "description": "",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupMeterReadingsDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupMeterReadingsDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupMeterReadingsDto"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GroupMeterReadingsChannelsDto": {
        "type": "object",
        "properties": {
          "channelName": {
            "maxLength": 30,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "Channel name. E.g. \"kWh: Import - Export\""
          },
          "dateTime": {
            "type": [
              "null",
              "string"
            ],
            "description": "DateTime of Meter Readings",
            "format": "date-time"
          },
          "data": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Data with a precision of 12 and a scale of 2 (12,2). Virtual Meters return 0.",
            "format": "float"
          },
          "quality": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Data quality 0 (Bad) to 255 (Good). Virtual Meters return 0.",
            "format": "uint8"
          }
        },
        "description": "List of available meter channels"
      },
      "GroupMeterReadingsDto": {
        "type": "object",
        "properties": {
          "meterReference": {
            "maxLength": 50,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "MeterReference as set within the Praysio Portal API Group."
          },
          "channelCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The number of Channels available for this meter.",
            "format": "int32"
          },
          "channels": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/GroupMeterReadingsChannelsDto"
            },
            "description": "List of all available Channels associated with the meter"
          }
        },
        "description": "List of meters with associated channels"
      },
      "MeterConsumptionDto": {
        "type": "object",
        "properties": {
          "startDateTime": {
            "type": "string",
            "description": "Start of data period (Exclusive)",
            "format": "date-time"
          },
          "endDateTime": {
            "type": "string",
            "description": "End of data period (Inclusive)",
            "format": "date-time"
          },
          "data": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Data with a precision of 12 and a scale of 2 (12,2).",
            "format": "float"
          },
          "quality": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Data quality 0 (Bad) to 255 (Good).",
            "format": "uint8"
          }
        },
        "description": "Consumption values for a meter channel based on the period data provided."
      },
      "MeterDetailChannelsDto": {
        "type": "object",
        "properties": {
          "channelName": {
            "maxLength": 30,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "Channel name. E.g. \"kWh: Import - Export\""
          },
          "utilityType": {
            "maxLength": 20,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "Utility Type. E.g. \"Electricity\""
          },
          "units": {
            "maxLength": 30,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "Units. E.g. \"kWh\""
          },
          "virtual": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "If the channel is Virtual. Virtual channels do not have meter readings and are instead calculated consumption only"
          },
          "recorded": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "If the channel is recorded"
          },
          "recordInterval": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Record rate in Seconds (starting at 00h00) that the channel values are recorded at when 'Recorded' is true. E.g. the default value of '1800' = Half-Hourly",
            "format": "int32"
          }
        },
        "description": "List of channels associated with the meter"
      },
      "MeterDetailDto": {
        "type": "object",
        "properties": {
          "meterReference": {
            "maxLength": 50,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "MeterReference as set within the Praysio Portal API Group."
          },
          "meterName": {
            "maxLength": 30,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "The meter name as configured within the Praysio Portal."
          },
          "meterDescription": {
            "maxLength": 120,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "The meters description as configured within the Praysio Portal."
          },
          "meterSerialNumber": {
            "maxLength": 30,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "The meters serial number if assigned/noted within the praysio portal."
          },
          "meterMpanMprnSpid": {
            "maxLength": 30,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "The Meter MPAN/MPRN/SPID if assigned within the praysio portal. These are assigned if the meter is a statutory meter or a private check meter directly in line with a statutory meter."
          },
          "meterParents": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "MeterReferences of all upstream meters: the parent meter within the meter tree (listed first) followed by any meters this meter is fed from."
          },
          "meterType": {
            "maxLength": 30,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "Meter Type. E.g. \"Electricity\", \"Water\", \"Gas\", \"Heat\" etc."
          },
          "siteName": {
            "maxLength": 30,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "The site name that the meter is allocated to within the Praysio Portal."
          },
          "siteReference": {
            "maxLength": 20,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "The site reference is a type of user defined ID attached to the site name within the Praysio Portal."
          },
          "channelCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The number of Channels available for this meter.",
            "format": "int32"
          },
          "channels": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/MeterDetailChannelsDto"
            },
            "description": "List of all available Channels associated with the meter"
          },
          "assignedDemiseReference": {
            "maxLength": 20,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ],
            "description": "The reference of the Demise this meter is assigned to within the Praysio Portal, if any."
          },
          "customFields": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "description": "List of all Custom Fields associated with the meter. String lengths - Field(30):Value(30)"
          }
        },
        "description": "Meter details as configured within the Praysio Portal"
      },
      "MeterReadingsDto": {
        "type": "object",
        "properties": {
          "dateTime": {
            "type": "string",
            "description": "DateTime of Meter Readings",
            "format": "date-time"
          },
          "data": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Data with a precision of 12 and a scale of 2 (12,2). Virtual Meters return 0.",
            "format": "float"
          },
          "quality": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Data quality 0 (Bad) to 255 (Good). Virtual Meters return 0.",
            "format": "uint8"
          }
        },
        "description": "Meter reading values for a meter channel based on the period data provided."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "PraysioCore"
    }
  ]
}