{"openapi":"3.0.0","info":{"title":"3rd party interface","version":"1.0","contact":{"name":"Enervalis","url":"http://www.enervalis.com","email":"support@enervalis.com"},"description":"Interface for trading with 3rd party devices"},"servers":[{"url":"https://portal.enervalis.com/api/v3","description":"Enervalis Portal"}],"paths":{"/devices/{dev_id}/availability":{"parameters":[{"schema":{"type":"integer"},"name":"dev_id","in":"path","required":true,"description":"Device ID"}],"get":{"summary":"Get device availability","tags":["Device API"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reserved":{"type":"array","items":{"$ref":"#/components/schemas/AvailabilityPowerReservation"}},"exceptions":{"type":"array","items":{"$ref":"#/components/schemas/AvailabilityException"}}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"operationId":"get-devices-dev_id-availability","description":"Fetches the availability information of a device. This includes the base power reservation at certain points in time and the exceptions","parameters":[{"schema":{"type":"integer"},"in":"query","name":"from","description":"Unix epoch timestamp"},{"schema":{"type":"integer"},"in":"query","name":"to","description":"Unix epoch timestamp"}]}},"/devices/{dev_id}/availability/reserved":{"parameters":[{"schema":{"type":"integer"},"name":"dev_id","in":"path","required":true,"description":"Device ID"}],"post":{"summary":"Update reserved base power","operationId":"post-devices-dev_id-availability-reserved","responses":{"200":{"description":"OK"},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"description":"Sets the reserved power to the specified value. This will go into effect immediately & the logged timestamp will be the current time.","tags":["Device API"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"power":{"type":"number","description":"New reserved power setting. The value should not exceed the max power of the device"}},"required":["power"]}}},"description":""}}},"/devices/{dev_id}/availability/exception":{"parameters":[{"schema":{"type":"integer"},"name":"dev_id","in":"path","required":true,"description":"Device ID"}],"post":{"summary":"Add availability exception","operationId":"post-devices-dev_id-availability-exception","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"ID of the exception"}}}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"tags":["Device API"],"description":"Add an availability exception to the device. The exception can be either a 'power_override', temporarily overriding the reserved power, or an 'unavailable' exception, which indicates that the device won't be available for the specified period.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityException"}}}}},"delete":{"summary":"Delete availability exception","operationId":"delete-devices-dev_id-availability-exception","responses":{"200":{"description":"OK"},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"description":"Delete an availability exception. Only future exceptions can be deleted, not exceptions in the present or past.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"ID of the exception to be deleted"}},"required":["id"]}}}},"tags":["Device API"]}},"/devices/{dev_id}/dispatch":{"parameters":[{"schema":{"type":"integer"},"name":"dev_id","in":"path","required":true,"description":"Device ID"}],"get":{"summary":"Get dispatch volume","tags":["Device API"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeviceDispatch"}}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"operationId":"get-devices-dev_id-ordered_volume","description":"Get the volume that needs to be dispatched for the coming slots. This call is implemented as a Server-Sent Event","parameters":[]}},"/device/{dev_id}/data":{"parameters":[{"schema":{"type":"integer"},"name":"dev_id","in":"path","required":true,"description":"Device ID"}],"put":{"summary":"Upload device measurement","operationId":"put-device-dev_id-data","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeviceMeasurement"}}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"description":"Upload device measurements","requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"tags":["Device API"]}},"/devices/{dev_id}/parameters":{"parameters":[{"schema":{"type":"integer"},"name":"dev_id","in":"path","required":true,"description":"Device ID"}],"put":{"summary":"Update device parameters","operationId":"put-devices-dev_id-parameters","responses":{"200":{"description":"OK"}},"tags":["Device API"],"description":"Updates device parameters. This call will only update the properties which are present in the JSON object. Other parameters are left untouched. Therefore not all properties need to be present","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceParameters"}}},"description":""}},"get":{"summary":"Get device parameters","operationId":"get-devices-dev_id-parameters","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceParameters"}}}}},"description":"Get the currently configured device parameters.","tags":["Device API"]}}},"components":{"schemas":{"AvailabilityException":{"title":"AvailabilityException","type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string","enum":["unavailable","power_override"],"description":"Type of unavailability"},"from":{"type":"integer","description":"Unix epoch timestamp defining the start of the interval"},"to":{"type":"integer","description":"Unix epoch timestamp defining the end of the interval"}},"required":["type","from","to"]},"AvailabilityPowerReservation":{"title":"AvailabilityPowerReservation","type":"object","properties":{"timestamp":{"type":"integer","description":"Unix epoch timestamp setting the start of the power reservation"},"value":{"type":"number"}}},"DeviceDispatch":{"title":"DeviceDispatchSlot","type":"object","description":"","properties":{"start":{"type":"integer","description":"Unix epoch timestamp defining the start of the dispatch slot"},"end":{"type":"integer","description":"Unix epoch timestamp defining the end of the dispatch slot"},"volume":{"type":"number","description":"The volume that needs to be dispatch. The unit depends on the type of dispatch. For FCR, this is kW"},"type":{"type":"string","enum":["fcr"],"description":"Type of service that needs to be dispatched"}},"required":["start","end","volume","type"]},"DeviceMeasurement":{"title":"DeviceMeasurement","type":"object","properties":{"timestamp":{"type":"integer","description":"Unix epoch timestamp of the measurement"},"total_energy_in":{"type":"number","description":"Energy meter reading"},"power":{"type":"number","description":"Value in W indicating the current power. Positive values"}},"required":["timestamp"]},"DeviceParameters":{"title":"DeviceParameters","type":"object","properties":{"Capacity":{"type":"number","description":"Capacity of the device (in kWh)"},"MaxPower":{"type":"number","description":"Maximum power in Watt"},"MinPower":{"type":"number","description":"Minimum power in Watt"}}}},"securitySchemes":{"API Key":{"name":"x-api-key","type":"apiKey","in":"header"}}}}