{"openapi":"3.0.0","paths":{"/flessibili/accounts/authenticate":{"post":{"tags":["Authentication"],"operationId":"User Authentication","description":"Authenticates a user with their credentials","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"Bearer token to be used in subsequent requests"},"account":{"$ref":"#/components/schemas/Accounts"}}}}}},"400":{"$ref":"#/components/responses/BadRequestResponse"},"401":{"$ref":"#/components/responses/UnauthorizedResponse"}}}},"/flessibili/projects/{projectId}/flexibilityrequests":{"get":{"tags":["Flexibility Requests"],"operationId":"Get Flexibility Requests","description":"Returns a list of the most recent flexibility requests forwarded to the resources owned by the current user.","parameters":[{"in":"header","name":"authorization","schema":{"type":"string","example":"SECRET"},"required":true},{"in":"path","name":"projectId","description":"uuid of the project to which the device belongs to","required":true,"schema":{"type":"string"}},{"in":"query","name":"pod","description":"Filter requests by POD","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"HTTP Status 200","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/FlexibilityRequest"}}}}}}},"400":{"$ref":"#/components/responses/BadRequestResponse"}}}},"/flessibili/projects/romeflex/energy/hourly":{"get":{"tags":["Energy Monitoring"],"operationId":"Get Hourly Energy","parameters":[{"in":"header","name":"authorization","schema":{"type":"string","example":"SECRET"},"required":true},{"in":"query","name":"from","schema":{"type":"string","description":"ISO8601 formatted date string.","example":"2024-10-26"},"required":true},{"in":"query","name":"to","schema":{"type":"string","description":"ISO8601 formatted date string.","example":"2024-10-28"},"required":true},{"in":"query","name":"pod","description":"Specify the POD that generated the requested measurements","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"HTTP Status 200","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"data":{"type":"object","properties":{"absorbedActiveEnergy":{"type":"array","items":{"type":"object","description":"Datapoint of absorbed active energy in the requested period of time. Timestamp is formatted as ISO8601 date string. [string, Wh]","example":[["2025-01-25T23:00:00.000Z",1002400]]}},"injectedActiveEnergy":{"type":"array","items":{"description":"Datapoint of injected active energy in the requested period of time. Timestamp is formatted as ISO8601 date string. [string, Wh]","type":"object","example":[["2025-01-25T23:00:00.000Z",100]]}},"totalAbsorbedActiveEnergy":{"type":"number","description":"Total amount of absorbed active energy in the requested period of time [Wh]","example":100},"totalInjectedActiveEnergy":{"type":"number","description":"Total amount of injected active energy in the requested period of time [Wh]","example":100},"timestampMinConsumption":{"type":"string","example":"2024-10-26T10:30:00.000Z"},"timestampMaxConsumption":{"type":"string","example":"2024-10-26T17:30:00.000Z"},"timestampMinInjection":{"type":"string","example":"2024-10-25T22:00:00.000Z"},"timestampMaxInjection":{"type":"string","example":"2024-10-25T22:00:00.000Z"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequestResponse"}}}},"/flessibili/projects/romeflex/energy/daily":{"get":{"tags":["Energy Monitoring"],"operationId":"Get Daily Energy","parameters":[{"in":"header","name":"authorization","schema":{"type":"string","example":"SECRET"},"required":true},{"in":"query","name":"from","schema":{"type":"string","description":"ISO8601 formatted date string.","example":"2024-10-26"},"required":true},{"in":"query","name":"to","schema":{"type":"string","description":"ISO8601 formatted date string.","example":"2024-10-28"},"required":true},{"in":"query","name":"pod","description":"Specify the POD that generated the requested measurements","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"HTTP Status 200","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"data":{"type":"object","properties":{"absorbedActiveEnergy":{"type":"array","items":{"type":"object","description":"Datapoint of absorbed active energy in the requested period of time. Timestamp is formatted as ISO8601 date string. [string, Wh]","example":[["2025-01-25T23:00:00.000Z",1002400]]}},"injectedActiveEnergy":{"type":"array","items":{"description":"Datapoint of injected active energy in the requested period of time. Timestamp is formatted as ISO8601 date string. [string, Wh]","type":"object","example":[["2025-01-25T23:00:00.000Z",100]]}},"totalAbsorbedActiveEnergy":{"type":"number","description":"Total amount of absorbed active energy in the requested period of time [Wh]","example":100},"totalInjectedActiveEnergy":{"type":"number","description":"Total amount of injected active energy in the requested period of time [Wh]","example":100},"timestampMinConsumption":{"type":"string","example":"2024-10-26T10:30:00.000Z"},"timestampMaxConsumption":{"type":"string","example":"2024-10-26T17:30:00.000Z"},"timestampMinInjection":{"type":"string","example":"2024-10-25T22:00:00.000Z"},"timestampMaxInjection":{"type":"string","example":"2024-10-25T22:00:00.000Z"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequestResponse"}}}},"/flessibili/projects/romeflex/energy/monthly":{"get":{"tags":["Energy Monitoring"],"operationId":"Get Montly Energy","parameters":[{"in":"header","name":"authorization","schema":{"type":"string","example":"SECRET"},"required":true},{"in":"query","name":"from","schema":{"type":"string","description":"ISO8601 formatted date string.","example":"2024-10-26"},"required":true},{"in":"query","name":"to","schema":{"type":"string","description":"ISO8601 formatted date string.","example":"2024-10-28"},"required":true},{"in":"query","name":"pod","description":"Specify the POD that generated the requested measurements","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"HTTP Status 200","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","example":true},"data":{"type":"object","properties":{"absorbedActiveEnergy":{"type":"array","items":{"type":"object","description":"Datapoint of absorbed active energy in the requested period of time. Timestamp is formatted as ISO8601 date string. [string, Wh]","example":[["2025-01-25T23:00:00.000Z",1002400]]}},"injectedActiveEnergy":{"type":"array","items":{"description":"Datapoint of injected active energy in the requested period of time. Timestamp is formatted as ISO8601 date string. [string, Wh]","type":"object","example":[["2025-01-25T23:00:00.000Z",100]]}},"totalAbsorbedActiveEnergy":{"type":"number","description":"Total amount of absorbed active energy in the requested period of time [Wh]","example":100},"totalInjectedActiveEnergy":{"type":"number","description":"Total amount of injected active energy in the requested period of time [Wh]","example":100},"timestampMinConsumption":{"type":"string","example":"2024-10-26T10:30:00.000Z"},"timestampMaxConsumption":{"type":"string","example":"2024-10-26T17:30:00.000Z"},"timestampMinInjection":{"type":"string","example":"2024-10-25T22:00:00.000Z"},"timestampMaxInjection":{"type":"string","example":"2024-10-25T22:00:00.000Z"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequestResponse"}}}}},"components":{"securitySchemes":{},"responses":{"BadRequestResponse":{"description":"Bad input was provided. Response might contain more information about what was wrong"},"NotFoundResponse":{"description":"The resource could not be found"},"AuthenticationSuccessfulResponse":{"description":"Credentials were accepted and an authentication token is provided in the response"},"OKResponse":{"description":"Everything fine"},"UnauthorizedResponse":{"description":"Invalid credentials"},"UnauthorizedActivationResponse":{"description":"Wrong activation code"},"ForbiddenResponse":{"description":"Account has not the permission to complete the operation"},"ConflictResponse":{"description":"Account as already been activated"}},"parameters":{"filterParameter":{"in":"query","name":"filter","description":"pass an optional search json object for filtering results","required":false,"schema":{"type":"string"}},"skipParameter":{"in":"query","name":"skip","description":"number of records to skip for pagination","schema":{"type":"integer","format":"int32","minimum":0}},"limitParameter":{"in":"query","name":"limit","description":"maximum number of records to return","schema":{"type":"integer","format":"int32","minimum":0,"maximum":50}},"uuid":{"in":"path","name":"uuid","description":"The unique identifier of the requested resource","required":true,"schema":{"type":"string"}},"projectId":{"in":"path","name":"projectId","description":"The unique identifier of the project","required":true,"schema":{"type":"string"}},"bearerAuthHeader":{"in":"header","name":"Authorization","required":true,"description":"The Bearer token","example":"Bearer W5wwSsJwJwco3tZ0","schema":{"type":"string"}},"apiKeyAuthHeader":{"in":"header","name":"Authorization","required":true,"description":"The API Key","example":"APIKey zaCELgL.0imfnc8mVLWwsAawjYr4Rx-Af50DDqtlx","schema":{"type":"string"}},"timeFrom":{"in":"query","name":"timeFrom","description":"Limit the time frame for the query, to be used with `timeTo`. The default timewindow is the last hour","required":true,"schema":{"oneOf":[{"type":"string","description":"A ISO 8601 date, like `2020-11-06T15:58:21.254Z`"},{"type":"number","description":"A unix timestamp, to milliseconds, like `1604678323985`"}]}},"timeTo":{"in":"query","name":"timeTo","description":"Limit the time frame for the query, to be used with `timeFrom`. The default timewindow is the last hour","required":true,"schema":{"oneOf":[{"type":"string","description":"A ISO 8601 date, like `2020-11-06T15:58:21.254Z`"},{"type":"number","description":"A unix timestamp, to milliseconds, like `1604678323985`"}]}}},"schemas":{"BaseErrorResponse":{"type":"object","description":"A HTTP Error response","properties":{"status":{"type":"boolean"},"error":{"type":"object","properties":{"name":{"type":"string"},"statusCode":{"type":"integer","minimum":400,"maximum":599},"message":{"type":"string"},"type":{"type":"string"}}}},"example":{"status":false,"error":{"name":"Unauthorized","statusCode":401,"message":"Missing authorization header.","type":"Unauthorized"}}},"BaseResource":{"type":"object","properties":{"uuid":{"example":"046ae7f2-a3eb-4c4f-ac92-16d7abc56c7e","type":"string","description":"The unique identifier for the resource. It can be provided at creation, otherwise it will be generated by the api."},"createdAt":{"type":"string","format":"date-time","description":"The date (and time) at which the resource was created."},"updatedAt":{"type":"string","format":"date-time","description":"The date (and time) at which the resource was updated last time."},"metadata":{"type":"object","description":"A map of strings with custom content","additionalProperties":{"type":"string"},"example":{"key":"value","hello":"world"}}}},"ResourceWithLifecycle":{"type":"object","properties":{"lifecycleStatus":{"type":"string","enum":["created","provisioned","active","maintenance","suspended","decommissioned"]},"lifecycleEvents":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"authorId":{"type":"string"},"type":{"type":"string","enum":["created","provisioned","active","maintenance","suspended","decommissioned"]}}}}}},"LocationPoint":{"type":"object","properties":{"type":{"type":"string","enum":["point"]},"coordinates":{"$ref":"#/components/schemas/CoordinatesPoint"}},"required":["type","coordinates"]},"CoordinatesPoint":{"type":"array","minLength":2,"maxLength":2,"items":{"type":"number"}},"LocationPolygon":{"type":"object","properties":{"type":{"type":"string","enum":["polygon"]},"coordinates":{"type":"array","items":{"$ref":"#/components/schemas/CoordinatesPoint"}}},"required":["type","coordinates"]},"Accounts":{"type":"object","properties":{"status":{"example":"active","enum":["active","inactive","deleted"],"type":"string","description":"Account status."},"fullName":{"example":"John Doe","type":"string","description":"Account full name."},"email":{"example":"example@example.org","type":"string","description":"Login email."},"mustResetPassword":{"example":false,"type":"boolean","description":"Whether or not the account must reset the password."}}},"Roles":{"type":"object","properties":{"uuid":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Unique id of the resource"},"projectId":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Reference to Project UUID."},"name":{"example":"My Role","type":"string","description":"Role name."},"description":{"example":"This Role let actions X, Y and Z to be performed.","type":"string","description":"Role description."},"permissions":{"type":"array","items":{"type":"string","example":"apio.core.nodes.list","description":"List of Role permissions."}}}},"ACLRules":{"type":"object","properties":{"uuid":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Unique id of the resource"},"projectId":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Reference to Project UUID."},"roleId":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Reference to Role UUID."},"accountId":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Reference to Account UUID."}}},"Groups":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"projectId":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Reference to Project UUID."},"name":{"example":"My Group","type":"string","description":"Name of the group"},"description":{"example":"My Group Description","type":"string","description":"Description of the group"},"resources":{"example":["/projects/myProject/devices/myDeviceId"],"type":"array","items":{"type":"string"},"description":"Array of resources assigned to this group"}}}]},"Groupmemberships":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"projectId":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Reference to Project UUID."},"groupId":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Uuid of the group"},"accountId":{"example":"ffe78f86-56a0-405b-816a-b3b04021b844","type":"string","description":"Uuid of the account"}}}]},"BSPSetpoint":{"type":"object","properties":{"index":{"type":"number"},"bspPUp":{"type":"number"},"bspPDown":{"type":"number"},"bspQUp":{"type":"number"},"bspQDown":{"type":"number"},"dateTime":{}},"required":["timeSlot","index","bspPUp","bspPDown","bspQUp","bspQDown","dateTime"]},"MarketSetpoint":{"type":"object","properties":{"index":{"type":"number"},"marketPUp":{"type":"number"},"marketPDown":{"type":"number"},"marketQUp":{"type":"number"},"marketQDown":{"type":"number"},"dateTime":{}},"required":["index","marketPUp","marketPDown","marketQUp","marketQDown","dateTime"]},"FlexibilityRequest":{"title":"Flexibility Request","type":"object","properties":{"projectId":{"type":"string"},"type":{"type":"string","enum":["technical","bsp","market"]},"pod":{"type":"string"},"dataTime":{"type":"string","format":"date-time"},"startTime":{"type":"string","format":"date-time"},"sessionType":{"type":"string","enum":["dayAhead","realTime"]},"interval":{"type":"number","example":0.25},"setpoints":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/BSPSetpoint"}},{"type":"array","items":{"$ref":"#/components/schemas/MarketSetpoint"}}]},"marketOutcomeId":{"type":"string"},"baselineId":{"type":"string"},"status":{"type":"string"},"uuid":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"planningStatus":{"type":"string"}},"required":["projectId","type","pod","dataTime","startTime","sessionType","interval","setpoints","marketOutcomeId","baselineId","status","uuid","createdAt","updatedAt","planningStatus"]}}},"tags":[],"x-tagGroups":[{"name":"Energy Monitoring","tags":["Energy Monitoring"]},{"name":"Flexibility Requests","tags":["Flexibility Requests"]},{"name":"Authentication","tags":["Authentication"]}],"info":{"title":"Flessibili API","version":"latest","description":"# Introduction\n\nThe Flessibili API is based on HTTP and [REST](https://en.wikipedia.org/wiki/Representational_state_transfer), it exposes resource-oriented URLs, accepts [JSON-encoded](https://www.json.org/json-en.html) bodies (with a few documented exceptions), returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs, such as `POST`, `GET` and `PUT`.\n\nThis means you can use any HTTP/REST client or library to interact with it, as long as you provide the correct parameters described in this documentation.\n\n# Authentication\n\nMost of the functionalities requires authentication, which comes in two forms:\n\n- **Bearer Tokens**: Users can provide their credentials at the [authenticate endpoint](/api#tag/Accounts/operation/authenticateAccount) and, if those credentials are correct, the API will provide in return a bearer token which can be used to authenticate further requests.\n- **API Keys**: applications and devices can provide API Keys created by users.\n\n### Bearer Token\n\nOnce an authentication token was obtained by the [authenticate endpoint](/api#tag/Accounts/operation/authenticateAccount), the token can be used to authenticate subsequent requests.\n\nThe token must be provided in the Authorization header using the following syntax and replacing `<mytoken>` with the actual token.\n\n```http\nAuthorization: bearer <token>\n```\n\n### API Key\n\nAPI Keys can be created using the [API Key endpoint](/api#tag/API-Keys/operation/createAPIKey), remember that the value of the apikey is showed to you only in the response of this endpoint, after that you have no way to retrieve it, since we do not store its value in clear.\n\nThe API key must be provided in the Authorization header using the following syntax and replacing `<mykey>` with the actual api key.\n\n```http\nAuthorization: apikey <mykey>\n```\n\n# Errors\nErrors are reported using conventional HTTP status codes, hence any response with a HTTP status in the `4xx` or `5xx` range is an error response, while responses in the `2xx` range indicate success.\n\nError responses also include a response body with the following form:\n\n```json\n{\n  \"status\":false,\n  \"error\":{\n    \"name\":\"Unauthorized\",\n    \"statusCode\":401,\n    \"message\":\"Missing authorization header.\",\n    \"type\":\"Unauthorized\"\n  }\n}\n```\n\nSome errors might provide additional context in the form of a `code` attribute, in the `error` struct.\n\n# Pagination\n\nAll API resources have methods for fetching lists of items, for example you can list devices, list plants and so on. All these endpoints allow to paginate the results by using two parameters: `skip` and `limit`.\n\n`limit` is used to set the number of items that should be returned in the response, while `skip` tells the API how many items should be skipped in the result set.\n\nFor example, passing `skip=20` and `limit=20` returns the items from number 21 to 40 in the collection (depending on the chosen sorting).\n\n# Sorting\n\nAs for pagination parameters, all list methods support sorting by arbitrary attributes.\n\nThe `sortby` parameter tells the api which field should be used for sorting, while `sortorder` can have only two possible values: `ASC` for ascending sorting and `DESC` for descending sorting.\n\n# Request IDs\n\nEach API response has a request identifier. This identifier can be found in the response headers under the header `X-Request-Id`. This can be useful when contacting support for easier issue identification."},"servers":[{"url":"https://api.prod.romeflex.apio.network"}]}