{"openapi":"3.0.0","info":{"contact":{"email":"contact@ijenko.com","name":"IJENKO","url":"http://developers.ijenko.com/"},"title":"IoE² IoT API - to create end-user applications","version":"3.0.0","x-apisguru-categories":["iot"],"x-logo":{"backgroundColor":"#383D41","url":"https://pbs.twimg.com/profile_images/1706275304/_0_logo_carr__fd_gris_400x400.png"},"x-origin":[{"format":"swagger","url":"http://developers.ijenko.com/swagger.json","version":"2.0"}],"x-providerName":"ijenko.net"},"security":[{"Token_in_query":[]},{"Token_in_Access-Token_header":[]}],"tags":[{"name":"Entry points"},{"name":"Authentication"},{"name":"Account"},{"name":"User"},{"name":"Place"},{"name":"Device"},{"name":"Functionality"},{"name":"Action"},{"name":"Program"},{"name":"Notification"},{"name":"Electricity"}],"paths":{"/account/change-password":{"post":{"description":"Set a new password for the account.\n\n**Note**: requires full access to the *Account*.\n","operationId":"Account.changePassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthChangePassword"}}},"description":"Old and new password","required":true},"responses":{"204":{"description":"Change successful."},"403":{"$ref":"#/components/responses/ErrorAccessAccount"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Change the password","tags":["Account"]}},"/account/places":{"get":{"description":"List the *Places* of the account.\n\n**Note:** requires full access to the *Account*.\n","operationId":"Account.places","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PlaceItem"},"type":"array","uniqueItems":true}}}},"403":{"$ref":"#/components/responses/ErrorAccessAccount"}},"summary":"List Places of the Account","tags":["Account"]},"parameters":[],"post":{"description":"Create a new *Place*.\n\nA *Device* (`class`: `MINT`, `address`: `0`) is automatically created and attached to the new *Place*.\n\n**Note:** requires full access to the *Account*.\n","operationId":"Account.newPlace","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceNew"}}}},"responses":{"201":{"description":"*Place* successfully created.","headers":{"Location":{"description":"Path of the Place created (`/places/{id}`)","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceCreated"}}}},"403":{"$ref":"#/components/responses/ErrorAccessAccount"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Create a Place","tags":["Account"]}},"/account/tokens":{"get":{"description":"List the active *Tokens* on the account.\n\n**Note:** requires full access to the *Account*.\n","operationId":"Account.tokens","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/UserTokenItem"},"type":"array","uniqueItems":true}}}},"403":{"$ref":"#/components/responses/ErrorAccessAccount"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List active Tokens of the Account","tags":["Account"]},"parameters":[]},"/account/tokens/{tokenId}":{"delete":{"description":"Revoke the given *Token*.\n\n**Note:** requires full access to the *Account*.\n","operationId":"Account.revokeToken","responses":{"204":{"$ref":"#/components/responses/DeleteOK"},"403":{"$ref":"#/components/responses/ErrorAccessAccount"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Revoke a Token","tags":["Account"]},"parameters":[{"$ref":"#/components/parameters/tokenId"}]},"/account/users":{"get":{"description":"Get the list of *Users* of this *Account*.","operationId":"Account.users","parameters":[{"$ref":"#/components/parameters/embedMetadata"}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/UserItem"},"type":"array","uniqueItems":true}}}}},"summary":"List Users of the Account","tags":["Account"]},"parameters":[],"post":{"description":"Add a *User*.\n\n**Note**: requires full access to the *Account*.\n","operationId":"Account.newUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserNew"}}},"required":true},"responses":{"201":{"description":"*User* successfully created.","headers":{"Location":{"description":"Path of the User created","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreated"}}}},"403":{"$ref":"#/components/responses/ErrorAccessAccount"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"New User","tags":["Account"]}},"/account/users/{userId}":{"delete":{"description":"Delete a *User* from this *Account*, and revoke all his/her *Tokens*.\n\n**Note**: requires full access to the *Account*.\n","operationId":"Account.deleteUser","responses":{"204":{"$ref":"#/components/responses/DeleteOK"},"403":{"$ref":"#/components/responses/ErrorAccessAccount"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Delete a User","tags":["Account"]},"get":{"description":"Get information about a *User* in the same *Account*.","operationId":"Account.getUser","responses":{"200":{"description":"*User* information.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Information about a User","tags":["Account"]},"parameters":[{"$ref":"#/components/parameters/userId"}],"patch":{"description":"Modify a *User*.\n\n**Note**: requires full access to the *Account*.\n","operationId":"Account.patchUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatch"}}},"required":true},"responses":{"204":{"$ref":"#/components/responses/PatchOK"},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessAccount"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify a User","tags":["Account"]}},"/account/users/{userId}/metadata":{"get":{"description":"Get the metadata.","operationId":"User.getMetadata","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List metadata","tags":["Account"]},"parameters":[{"$ref":"#/components/parameters/userId"}],"patch":{"description":"Modify the metadata.\nKeys are limited to the same format as tags (up to 21 characters, [a-z0-9], starting with [a-z]). Values can be any JSON value.\n","operationId":"User.patchMetadata","requestBody":{"$ref":"#/components/requestBodies/MetadataPatch"},"responses":{"200":{"description":"Successful. The new metadata is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessUser"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify metadata","tags":["Account"]}},"/auth/login":{"post":{"description":"Get an access+refresh tokens pair from login and password information.\n\nThe *access token* obtained with this request can then be used in\nan `Access-Token` HTTP header or in a `token` URL query parameter\nin requests that require authentication.\n\nThe *refresh token* can be used with `/auth/refresh` when the *access\ntoken* expires to retrieve a new *access token*. The lifetime of the\nrefresh token is the maximum lifetime of this authentication request.\n\nThe default lifetime of the *refresh token* is defined by the `appId`\nused. The `ttl` input parameter allows to request a *refresh token*\nwith a shorter lifetime.\n\nTo implement *logout*, use `/auth/revoke`.\n","operationId":"AuthAccountLogin","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthLogin"}}},"description":"Login information.","required":true},"responses":{"200":{"description":"Login successful. The access token is given to use the API. The refresh token must be stored in a safe place.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthTokens"}}}},"401":{"description":"Authentication failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"security":[],"summary":"Get a token using login+password","tags":["Authentication","Entry points"]}},"/auth/refresh":{"post":{"description":"Get a new *access token* using a valid *refresh token*.\n\nThis is a **replacement** of the *access token*: if an existing *access\ntoken* was still not expired, it is invalidated.\n","operationId":"AuthRefreshToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthRefresh"}}},"description":"Refresh token information.","required":true},"responses":{"200":{"description":"Refresh successful. A new access token is given to use the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthTokens"}}}},"401":{"description":"Authentication failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"security":[],"summary":"Refresh a token","tags":["Authentication"]}},"/auth/reset-password":{"post":{"description":"Trigger the request of a new password.\n\nThe account administrator will receive an e-mail with an URL pointing to a form\nto allow him/her to enter a new password.\nThe old password is still functional until a new one is submitted.\n\nEither the login or e-mail of the account must be given.\n","operationId":"AuthResetPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResetPassword"}}},"description":"Account identification information","required":true},"responses":{"204":{"description":"As this request is not authenticated, response is always successful to not reveal (in)existence of accounts."},"default":{"$ref":"#/components/responses/DefaultError"}},"security":[],"summary":"Ask for a new password","tags":["Authentication"]}},"/auth/revoke":{"post":{"description":"Invalidate the authentication used for the request. The access token and the refresh token will be invalid after this request.\nThis request is typically called to implement logout.\n","operationId":"AuthRevokeToken","responses":{"204":{"description":"Revocation successful. The token used for the request is now invalid."},"401":{"description":"Authentication failure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Revoke a token","tags":["Authentication"]}},"/devices/{deviceId}":{"get":{"description":"Get information about a *Device*.","operationId":"Devices.get","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Information about a Device","tags":["Device"]},"parameters":[{"$ref":"#/components/parameters/deviceId"}],"patch":{"description":"Modify information about a *Device*: its name.\n","operationId":"Devices.patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevicePatch"}}},"required":true},"responses":{"204":{"$ref":"#/components/responses/PatchOK"},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessDevice"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Update a Device","tags":["Device"]}},"/devices/{deviceId}/functionalities":{"post":{"description":"Add a *Functionality* to the device.\n\nRequired parameters are :\n- functionality class\n- endpoint\n\nEach device class has its own restrictions on which Functionality classes can be added and on which endpoints.\nOnly a few devices allow to add Functionalities.\n\n|Device class|Functionality class|Endpoints|\n|------------|-------------------|---------|\n|MINT        |CurrentPeriod      |1,2,3    |\n|MINT        |ElectricityRates   |1,2,3    |\n|MINT        |GenericRate        |1,2,3    |\n\n**Note**: requires full access to the *Account*.\n","operationId":"Device.addFunctionality","parameters":[{"$ref":"#/components/parameters/deviceId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionalityNew"}}},"required":true},"responses":{"201":{"description":"*Functionality* successfully created.","headers":{"Location":{"description":"Path of the Functionality created","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionalityCreated"}}}},"403":{"$ref":"#/components/responses/ErrorAccessDevice"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Add dynamically a functionality","tags":["Device","Functionality"]}},"/devices/{deviceId}/metadata":{"get":{"description":"Get the metadata.","operationId":"Device.getMetadata","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List metadata","tags":["Device"]},"parameters":[{"$ref":"#/components/parameters/deviceId"}],"patch":{"description":"Modify the metadata.\nKeys are limited to the same format as tags (up to 21 characters, [a-z0-9], starting with [a-z]). Values can be any JSON value.\n","operationId":"Device.patchMetadata","requestBody":{"$ref":"#/components/requestBodies/MetadataPatch"},"responses":{"200":{"description":"Successful. The new metadata is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessDevice"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify metadata","tags":["Device"]}},"/devices/{deviceId}/run/{action}":{"post":{"description":"Run an *Action* on zero, one or multiple Functionalities selected with tags.\n","operationId":"Device.run","parameters":[{"$ref":"#/components/parameters/deviceId"},{"$ref":"#/components/parameters/action"},{"$ref":"#/components/parameters/functionalitiesSelector.Req"}],"requestBody":{"$ref":"#/components/requestBodies/ActionArgs"},"responses":{"200":{"$ref":"#/components/responses/ActionMultiResultOK"},"450":{"$ref":"#/components/responses/ErrorGatewayUnreachable"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Run actions","tags":["Action"]}},"/devices/{deviceId}/tags":{"get":{"description":"Get the tags of a *Device*.","operationId":"Device.getTags","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tags"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List tags","tags":["Device"]},"parameters":[{"$ref":"#/components/parameters/deviceId"}],"patch":{"description":"Modify the tags of a *Device*.","operationId":"Device.patchTags","requestBody":{"$ref":"#/components/requestBodies/TagsPatch"},"responses":{"200":{"description":"Successful. The new list of tags is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tags"}}}},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessDevice"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify tags","tags":["Device"]}},"/functionalities/{functionalityId}":{"get":{"description":"Get the *Functionality*.","operationId":"Functionalities.get","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Functionality"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Information about a Functionality","tags":["Functionality"]},"parameters":[{"$ref":"#/components/parameters/functionalityId"}],"patch":{"description":"Modify information about a *Functionality*: its name.\n","operationId":"Functionality.patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionalityPatch"}}},"required":true},"responses":{"204":{"$ref":"#/components/responses/PatchOK"},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessFunctionality"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify a Functionality","tags":["Functionality"]}},"/functionalities/{functionalityId}/attributes":{"get":{"description":"Get the values of multiple *Attributes* and their history.\n\nIf the `names` parameter is not given, all the attributes of the *Functionality*\nare returned. As the list may be huge, this must be avoided.\n\nIf the `to` parameter is set, `from` must also be set.\n\nIf `from` is not set, only the last value is returned.\n\nThe `surround` parameter allows to ask also for one value beyond each interval boundaries.\n\nThe request may fail if too many values are asked.\n","operationId":"Functionality.values","parameters":[{"$ref":"#/components/parameters/attributesNames"},{"$ref":"#/components/parameters/from.Opt"},{"$ref":"#/components/parameters/to"},{"description":"If true, return also one value before from and one value after to","in":"query","name":"surround","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributesValues"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Get history of multiple attributes","tags":["Functionality"]},"parameters":[{"$ref":"#/components/parameters/functionalityId"}]},"/functionalities/{functionalityId}/attributes/{attributeName}":{"get":{"description":"Get the *Attribute* value and the last time when it changed.","operationId":"Functionality.value","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeValue"}}}},"204":{"description":"No value has yet been set on this attribute."},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Get an Attribute value","tags":["Functionality"]},"parameters":[{"$ref":"#/components/parameters/functionalityId"},{"$ref":"#/components/parameters/attributeName"}],"put":{"description":"Modify the value of the *Attribute*.","operationId":"Functionality.set","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnyJSON"}}},"description":"New value for the *Attribute*.","required":true},"responses":{"204":{"description":"Successful."},"405":{"$ref":"#/components/responses/ErrorWriteAttribute"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify an Attribute value","tags":["Functionality"]}},"/functionalities/{functionalityId}/metadata":{"get":{"description":"Get the metadata.","operationId":"Functionality.getMetadata","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List metadata","tags":["Functionality"]},"parameters":[{"$ref":"#/components/parameters/functionalityId"}],"patch":{"description":"Modify the metadata.\nKeys are limited to the same format as tags (up to 21 characters, [a-z0-9], starting with [a-z]). Values can be any JSON value.\n","operationId":"Functionality.patchMetadata","requestBody":{"$ref":"#/components/requestBodies/MetadataPatch"},"responses":{"200":{"description":"Successful. The new metadata is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessFunctionality"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify metadata","tags":["Functionality"]}},"/functionalities/{functionalityId}/run/{action}":{"post":{"description":"Run an action on the Functionality.\n","operationId":"Functionality.run","parameters":[{"$ref":"#/components/parameters/functionalityId"},{"$ref":"#/components/parameters/action"}],"requestBody":{"$ref":"#/components/requestBodies/ActionArgs"},"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionResult"}}}},"450":{"$ref":"#/components/responses/ErrorGatewayUnreachable"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Run an action","tags":["Action"]}},"/functionalities/{functionalityId}/tags":{"get":{"description":"Get the tags of a *Functionality*.","operationId":"Functionality.getTags","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tags"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List tags","tags":["Functionality"]},"parameters":[{"$ref":"#/components/parameters/functionalityId"}],"patch":{"description":"Modify the tags of a *Functionality*.","operationId":"Functionality.patchTags","requestBody":{"$ref":"#/components/requestBodies/TagsPatch"},"responses":{"200":{"description":"Successful. The new list of tags is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tags"}}}},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessFunctionality"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify tags","tags":["Functionality"]}},"/me":{"get":{"description":"Get information on the authenticated *User* who does the request.\n\nThe *login* property is returned only if the *User* is the administrator of\nthe *Account*.\n","operationId":"Me.get","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMe"}}}}},"summary":"Information about the User","tags":["Entry points"]},"patch":{"description":"Update *User* information (locale).\n","operationId":"Me.patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMePatch"}}},"description":"Updated user info.","required":true},"responses":{"204":{"$ref":"#/components/responses/PatchOK"},"304":{"$ref":"#/components/responses/PatchNotModified"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Update User information","tags":["Entry points"]}},"/notifications/{notificationId}":{"delete":{"description":"Delete a *Notification*.\n","operationId":"Notification.delete","responses":{"204":{"$ref":"#/components/responses/DeleteOK"},"403":{"$ref":"#/components/responses/ErrorAccessNotification"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Delete a Notification","tags":["Notification"]},"get":{"description":"Get information about a *Notification*.\n","operationId":"Notifications.get","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notification"}}}},"403":{"$ref":"#/components/responses/ErrorAccessNotification"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Information about a Notification","tags":["Notification"]},"parameters":[{"$ref":"#/components/parameters/notificationId"}],"patch":{"description":"Modify a *Notification*.\n","operationId":"Notification.patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPatch"}}},"required":true},"responses":{"204":{"$ref":"#/components/responses/PatchOK"},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessNotification"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify a Notification","tags":["Notification"]}},"/notifications/{notificationId}/metadata":{"get":{"description":"Get the metadata of the *Notification*.","operationId":"Notification.getMetadata","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List metadata","tags":["Notification"]},"parameters":[{"$ref":"#/components/parameters/notificationId"}],"patch":{"description":"Modify the metadata of a *Notification*.\nKeys are limited to the same format as tags (up to 21 characters, [a-z0-9], starting with [a-z]). Values can be any JSON value.\n","operationId":"Notification.patchMetadata","requestBody":{"$ref":"#/components/requestBodies/MetadataPatch"},"responses":{"200":{"description":"Successful. The new metadata is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessNotification"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify metadata of a Notification","tags":["Notification"]}},"/places":{"get":{"description":"List the *Places* to which the *Token* has access.","operationId":"Me.places","parameters":[{"$ref":"#/components/parameters/embedMetadata"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PlaceItem"},"type":"array","uniqueItems":true}}}}},"summary":"List accessible Places","tags":["Entry points"]}},"/places/{placeId}":{"get":{"description":"Get information about a *Place*.","operationId":"Places.get","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Place"}}}},"400":{"$ref":"#/components/responses/ErrorAccessPlace"}},"summary":"Information about a Place","tags":["Place"]},"parameters":[{"$ref":"#/components/parameters/placeId"}],"patch":{"description":"Change information about a *Place*.\n\n**Note**: requires full access to the *Account*.\n","operationId":"Place.patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlacePatch"}}},"required":true},"responses":{"204":{"$ref":"#/components/responses/PatchOK"},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessAccount"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Update a Place","tags":["Place"]}},"/places/{placeId}/buses":{"get":{"description":"Get the list of *Buses* available on the gateway of this *Place*.\nIf `withPairing` is `true`, return only buses that allow device pairing (see `/places/{placeId}/buses/{busId}/pairing`).","operationId":"Place.buses","parameters":[{"description":"Filter out buses that have no pairing window","in":"query","name":"withPairing","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BusItem"},"type":"array","uniqueItems":true}}}},"403":{"$ref":"#/components/responses/ErrorAccessBus"}},"summary":"List Buses","tags":["Place"]},"parameters":[{"$ref":"#/components/parameters/placeId"}]},"/places/{placeId}/buses/{busId}/pairing":{"get":{"description":"Get the state of the pairing window of the *Bus*.\n\n**Note**: requires full access to the *Account*.\n","operationId":"Place.pairing","responses":{"200":{"description":"State information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusPairing"}}}},"403":{"$ref":"#/components/responses/ErrorAccessBus"}},"summary":"State of the pairing window","tags":["Place"]},"parameters":[{"$ref":"#/components/parameters/placeId"},{"$ref":"#/components/parameters/busId"}],"put":{"description":"Open/Close the pairing window.\n\n**Note**: requires full access to the *Account*.\n","operationId":"Place.openPairing","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusPairing"}}},"required":true},"responses":{"200":{"description":"State information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusPairing"}}}},"403":{"$ref":"#/components/responses/ErrorAccessBus"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Open/Close the pairing window","tags":["Place"]}},"/places/{placeId}/devices":{"get":{"description":"Get the list of *Devices* available in this *Place*.","operationId":"Place.devices","parameters":[{"$ref":"#/components/parameters/devicesSelector.Opt"},{"$ref":"#/components/parameters/embedMetadata"}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DeviceItem"},"type":"array","uniqueItems":true}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List of Devices","tags":["Device"]},"parameters":[{"$ref":"#/components/parameters/placeId"}]},"/places/{placeId}/electricity/autonomy":{"get":{"description":"Compute the autonomy rate of the *Place* on a time period.\n\n`autonomy = 1 - (elec_drawn / elec_total_usage)`\n","operationId":"Place.Electricity.autonomy","parameters":[{"$ref":"#/components/parameters/when.Req"},{"$ref":"#/components/parameters/span.Req"}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElectricityAutonomy"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Get autonomy rate of the place","tags":["Electricity"]},"parameters":[{"$ref":"#/components/parameters/placeId"}]},"/places/{placeId}/electricity/flows":{"get":{"description":"Get the mapping of virtual electricity flows to functionalities.\n\nSome rules are applied to expand the virtual flows using the concrete\nflows available.\n\nThe `factor` tells how each energy value coming from a functionality\nmust be added with values from other functionality to compute the\nenergy of the virtual flow. Factors are usually `1` or `-1`.\n\nThe `code` property gives the result which may be partial:\n- If all flows are available, `200000` is returned.\n- If no flows are available (indicating that the place has no\n  electricity functionality or that no functionality has been attached\n  to a flow), the `code` is `200001`. The `missing` property contains\n  all the requested flows.\n- If some flows are missing, the `code` is `200002` and the `missing`\n  property lists them.\n","operationId":"Place.Electricity.getFlows","parameters":[{"description":"Names of the flows requested","in":"query","name":"flows","required":true,"style":"form","explode":false,"schema":{"type":"array","items":{"enum":["battery_charge","battery_discharge","battery_grid","elec_total_gen","elec_total_usage","elec_feed_in","elec_drawn","elec_local","elec_from_household","elec_to_pv","elec_usage"],"type":"string"}}}],"responses":{"200":{"description":"Place is available. `code` gives the functional result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElectricityFlows"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Get electricity virtual flows","tags":["Electricity"]},"parameters":[{"$ref":"#/components/parameters/placeId"}]},"/places/{placeId}/electricity/flows/setup":{"get":{"description":"Get the mapping of functionalities to electricity flows.\n\nA functionality is attached to *at most* one flow.\n","operationId":"Place.Electricity.getFlowsSetup","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElectricityFlowsSetup"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Get electricity flows setup","tags":["Electricity"]},"parameters":[{"$ref":"#/components/parameters/placeId"}]},"/places/{placeId}/electricity/self-consumption":{"get":{"description":"Compute the self-consumption rate of the *Place* on a time period.\n\n`selfConsumption = 1 - (elec_feed_in / elec_total_usage)`\n","operationId":"Place.Electricity.selfConsumption","parameters":[{"$ref":"#/components/parameters/when.Req"},{"$ref":"#/components/parameters/span.Req"}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElectricitySelfConsumption"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Get self-consumption rate of the place","tags":["Electricity"]},"parameters":[{"$ref":"#/components/parameters/placeId"}]},"/places/{placeId}/functionalities":{"get":{"description":"Get the list of *Functionalities* available in this *Place*.","operationId":"Place.functionalities","parameters":[{"$ref":"#/components/parameters/embedMetadata"}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FunctionalityItem"},"type":"array","uniqueItems":true}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List Functionalities","tags":["Functionality"]},"parameters":[{"$ref":"#/components/parameters/placeId"},{"$ref":"#/components/parameters/devicesSelector.Opt"},{"$ref":"#/components/parameters/functionalitiesSelector.Opt"}]},"/places/{placeId}/metadata":{"get":{"description":"Get the metadata.","operationId":"Place.getMetadata","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List metadata","tags":["Place"]},"parameters":[{"$ref":"#/components/parameters/placeId"}],"patch":{"description":"Modify the metadata.\nKeys are limited to the same format as tags (up to 21 characters, [a-z0-9], starting with [a-z]). Values can be any JSON value.\n","operationId":"Place.patchMetadata","requestBody":{"$ref":"#/components/requestBodies/MetadataPatch"},"responses":{"200":{"description":"Successful. The new metadata is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessPlace"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify metadata","tags":["Place"]}},"/places/{placeId}/notifications":{"get":{"description":"Get the list of *Notifications* available in this *Place*.","operationId":"Place.notifications","parameters":[{"$ref":"#/components/parameters/embedMetadata"}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/NotificationItem"},"type":"array","uniqueItems":true}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List Notifications","tags":["Notification"]},"parameters":[{"$ref":"#/components/parameters/placeId"}],"post":{"description":"Create a new *Notification*.","operationId":"Place.newNotification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationNew"}}},"required":true},"responses":{"201":{"description":"*Notification* successfully created.","headers":{"Location":{"description":"Path of the Notification created (`/notifications/{id}`)","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationCreated"}}}},"403":{"$ref":"#/components/responses/ErrorAccessPlace"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Create a Notification","tags":["Notification"]}},"/places/{placeId}/programs":{"get":{"description":"Get the list of *Programs* available in this *Place*.","operationId":"Place.programs","parameters":[{"$ref":"#/components/parameters/embedMetadata"}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProgramItem"},"type":"array","uniqueItems":true}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List Programs","tags":["Program"]},"parameters":[{"$ref":"#/components/parameters/placeId"}],"post":{"description":"Create a new *Program*.\n\n**Note**: requires full access to the *Account*.\n","operationId":"Place.newProgram","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramNew"}}},"required":true},"responses":{"201":{"description":"*Program* successfully created.","headers":{"Location":{"description":"Path of the Program created (`/programs/{id}`)","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramCreated"}}}},"403":{"$ref":"#/components/responses/ErrorAccessPlace"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Create a Program","tags":["Program"]}},"/places/{placeId}/run/{action}":{"post":{"description":"Run an *Action* on zero, one or multiple *Functionalities* selected with tags.\n\n*Device* and *Functionality* selection are combined with « AND ».\n\nIf no functionality is matched by the device/functionality selection, an empty array is returned.\n","operationId":"Place.run","parameters":[{"$ref":"#/components/parameters/placeId"},{"$ref":"#/components/parameters/action"},{"$ref":"#/components/parameters/devicesSelector.Req"},{"$ref":"#/components/parameters/functionalitiesSelector.Req"}],"requestBody":{"$ref":"#/components/requestBodies/ActionArgs"},"responses":{"200":{"$ref":"#/components/responses/ActionMultiResultOK"},"450":{"$ref":"#/components/responses/ErrorGatewayUnreachable"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Run actions","tags":["Action"]}},"/programs/{programId}":{"delete":{"description":"Delete a *Program*.\n\n**Note**: requires full access to the *Account*.\n","operationId":"Program.delete","responses":{"204":{"$ref":"#/components/responses/DeleteOK"},"403":{"$ref":"#/components/responses/ErrorAccessProgram"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Delete a Program","tags":["Program"]},"get":{"description":"Get information about a *Program*.\n","operationId":"Programs.get","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Program"}}}},"403":{"$ref":"#/components/responses/ErrorAccessProgram"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Information about a Program","tags":["Program"]},"parameters":[{"$ref":"#/components/parameters/programId"}],"patch":{"description":"Modify a *Program*:\n- name\n- status (enabled/disabled)\n- code\n\n**Note**: requires full access to the *Account*.\n","operationId":"Program.patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramPatch"}}},"required":true},"responses":{"204":{"$ref":"#/components/responses/PatchOK"},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessProgram"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify a Program","tags":["Program"]}},"/programs/{programId}/log":{"get":{"description":"Get the execution history list of this *Program*.","operationId":"Program.log","parameters":[{"$ref":"#/components/parameters/from.Req"},{"$ref":"#/components/parameters/to"}],"responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProgramLog"},"type":"array","uniqueItems":true}}}},"403":{"$ref":"#/components/responses/ErrorAccessProgram"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"History of executions of a Program","tags":["Program"]},"parameters":[{"$ref":"#/components/parameters/programId"}]},"/programs/{programId}/metadata":{"get":{"description":"Get the metadata of the *Program*.","operationId":"Program.getMetadata","responses":{"200":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"List metadata","tags":["Program"]},"parameters":[{"$ref":"#/components/parameters/programId"}],"patch":{"description":"Modify the metadata of a *Program*.\nKeys are limited to the same format as tags (up to 21 characters, [a-z0-9], starting with [a-z]). Values can be any JSON value.\n","operationId":"Program.patchMetadata","requestBody":{"$ref":"#/components/requestBodies/MetadataPatch"},"responses":{"200":{"description":"Successful. The new metadata is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metadata"}}}},"304":{"$ref":"#/components/responses/PatchNotModified"},"403":{"$ref":"#/components/responses/ErrorAccessProgram"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Modify metadata of a Program","tags":["Program"]}},"/programs/{programId}/run":{"parameters":[{"$ref":"#/components/parameters/programId"}],"post":{"description":"Launch the *Program*.\nThe result will be available later in the run history.","operationId":"Program.run","responses":{"204":{"description":"*Program* successfully launched."},"403":{"$ref":"#/components/responses/ErrorAccessProgram"},"default":{"$ref":"#/components/responses/DefaultError"}},"summary":"Run the Program","tags":["Program"]}}},"servers":[{"url":"https://ioe2api.ijenko.net"}],"components":{"parameters":{"accountId":{"description":"Unique identifier of an *Account*.","in":"path","name":"accountId","required":true,"schema":{"type":"string"}},"action":{"description":"Identifier of an *Action* inside a *Functionality*.","in":"path","name":"action","required":true,"schema":{"type":"string"}},"attributeName":{"description":"Identifier of an *Attribute* inside a *Functionality*.","in":"path","name":"attributeName","required":true,"schema":{"type":"string"}},"attributesNames":{"description":"One or multiple *Attribute* names separated by commas","in":"query","name":"names","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},"busId":{"description":"Unique identifier of a *Bus*.","in":"path","name":"busId","required":true,"schema":{"type":"string"}},"deviceId":{"description":"Unique identifier of a *Device*.","in":"path","name":"deviceId","required":true,"schema":{"type":"string"}},"devicesSelector.Opt":{"description":"Devices selector. Device tags or device classes or device ids or '*' for any. Multiple values are separated by '|' and interpreted as « OR ».","in":"query","name":"devices","required":false,"schema":{"type":"string","pattern":"^(?:\\\\*|(?:[A-Z][A-Z0-9]{3}|[a-z][a-z0-9_:]{0,20}|[A-Za-z0-9-_]{22})(?:\\\\|(?:[A-Z][A-Z0-9]{3}|[a-z][a-z0-9_:]{0,20}|[A-Za-z0-9-_]{22}))*)$"}},"devicesSelector.Req":{"description":"Devices selector. Device tags or device classes or device ids or '*' for any. Multiple values are separated by '|' and interpreted as « OR ».","in":"query","name":"devices","required":true,"schema":{"type":"string","pattern":"^(?:\\\\*|(?:[A-Z][A-Z0-9]{3}|[a-z][a-z0-9_:]{0,20}|[A-Za-z0-9-_]{22})(?:\\\\|(?:[A-Z][A-Z0-9]{3}|[a-z][a-z0-9_:]{0,20}|[A-Za-z0-9-_]{22}))*)$"}},"embedMetadata":{"description":"Request to include the given keys of metadata in the response. If a key doesn't exist on the resource it is ignored.\n**Note:** This only applies to the top level resources.\n","in":"query","name":"embed-metadata","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},"from.Opt":{"description":"Beginning of the time interval.","in":"query","name":"from","required":false,"schema":{"type":"string","format":"date-time"}},"from.Req":{"description":"Beginning of the time interval.","in":"query","name":"from","required":true,"schema":{"type":"string","format":"date-time"}},"functionalitiesSelector.Opt":{"description":"Functionality selector: Functionality tags or functionality class (optionally, '@' followed by a endpoint in decimal) or '*' for all. Multiple values are separated by '|' and are interpreted as « OR ».\n","in":"query","name":"functionalities","required":false,"schema":{"type":"string","pattern":"^(?:\\\\*|(?:[A-Z][A-Za-z0-9]+(?:@(?:0|1[0-9]{,2}|[3-9][0-9]?|2(?:[0-4][0-9]?|5[0-5]?|[6-9])?))?|[a-z][a-z0-9_:]{0,20}|[A-Za-z0-9-_]{22})(?:\\\\|(?:[A-Z][A-Za-z0-9]+(?:@(?:0|1[0-9]{,2}|[3-9][0-9]?|2(?:[0-4][0-9]?|5[0-5]?|[6-9])?))?|[a-z][a-z0-9_:]{0,20}|[A-Za-z0-9-_]{22}))*)$"}},"functionalitiesSelector.Req":{"description":"Functionality selector: Functionality tags or functionality class (optionally, '@' followed by a endpoint in decimal) or '*' for all. Multiple values are separated by '|' and are interpreted as « OR ».\n","in":"query","name":"functionalities","required":true,"schema":{"type":"string","pattern":"^(?:\\\\*|(?:[A-Z][A-Za-z0-9]+(?:@(?:0|1[0-9]{,2}|[3-9][0-9]?|2(?:[0-4][0-9]?|5[0-5]?|[6-9])?))?|[a-z][a-z0-9_:]{0,20}|[A-Za-z0-9-_]{22})(?:\\\\|(?:[A-Z][A-Za-z0-9]+(?:@(?:0|1[0-9]{,2}|[3-9][0-9]?|2(?:[0-4][0-9]?|5[0-5]?|[6-9])?))?|[a-z][a-z0-9_:]{0,20}|[A-Za-z0-9-_]{22}))*)$"}},"functionalityId":{"description":"Unique identifier of a *Functionality*.","in":"path","name":"functionalityId","required":true,"schema":{"type":"string"}},"notificationId":{"description":"Unique identifier of a *Notification*.","in":"path","name":"notificationId","required":true,"schema":{"type":"string"}},"placeId":{"description":"Unique identifier of a *Place*.","in":"path","name":"placeId","required":true,"schema":{"type":"string"}},"programId":{"description":"Unique identifier of a *Program*.","in":"path","name":"programId","required":true,"schema":{"type":"string"}},"span.Req":{"description":"Timespan: H (hour), D (day), Wmo (week starting on Monday), Wsu (week starting on Sunday), M (month), Y (year)","in":"query","name":"span","required":true,"schema":{"type":"string","enum":["H","D","Wmo","Wsu","M","Y"]}},"to":{"description":"End of the interval. Default: now.\n","in":"query","name":"to","required":false,"schema":{"type":"string","format":"date-time"}},"tokenId":{"description":"Identifier of the token","in":"path","name":"tokenId","required":true,"schema":{"type":"string"}},"userId":{"description":"Unique identifier of a *User*.","in":"path","name":"userId","required":true,"schema":{"type":"string"}},"when.Req":{"description":"A time part of the time span.","in":"query","name":"when","required":true,"schema":{"type":"string","format":"date-time"}}},"responses":{"ActionMultiResultOK":{"description":"Successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionMultiResult"}}}},"DefaultError":{"description":"Other error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}}},"DeleteOK":{"description":"Resource successfully deleted."},"ErrorAccessAccount":{"description":"The authentication token doesn't allow to modify the *Account*.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEntity"}}}},"ErrorAccessBus":{"description":"*Bus* doesn't exist or the requester doesn't have appropriate access to the *Place*.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSubEntity"}}}},"ErrorAccessDevice":{"description":"*Device* doesn't exist or the requester doesn't have appropriate access to the *Place*.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEntity"}}}},"ErrorAccessFunctionality":{"description":"*Functionality* doesn't exist or the requester doesn't have appropriate access to the *Place*.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEntity"}}}},"ErrorAccessNotification":{"description":"*Notification* doesn't exist or the requester doesn't have appropriate access to the *Place*.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEntity"}}}},"ErrorAccessPlace":{"description":"*Place* doesn't exist or the requester doesn't have access.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEntity"}}}},"ErrorAccessProgram":{"description":"*Program* doesn't exist or the requester doesn't have appropriate access to the *Place*.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEntity"}}}},"ErrorAccessUser":{"description":"*User* doesn't exist in this *Account* or the requester doesn't have access to a *Place* on which this *User* has access.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEntity"}}}},"ErrorGatewayUnreachable":{"description":"The gateway of the Place is not reachable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorGatewayUnreachable"}}}},"ErrorWriteAttribute":{"description":"*Attribute* is not writable.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSubEntity"}}}},"PatchNotModified":{"description":"Successful, but nothing changed."},"PatchOK":{"description":"Modification successful."}},"requestBodies":{"ActionArgs":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionArgs"}}},"required":true},"MetadataPatch":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetadataPatch"}}},"description":"Modifications to apply to the metadata of the resource.\n","required":true},"TagsPatch":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagsPatch"}}},"description":"Modifications to apply to the tags list of the resource.\n","required":true}},"securitySchemes":{"Token_in_Access-Token_header":{"description":"Token in Access-Token header","in":"header","name":"Access-Token","type":"apiKey"},"Token_in_query":{"description":"Token in query","in":"query","name":"token","type":"apiKey"}},"schemas":{"AccountId":{"description":"Unique identifier of the *Account*","example":"t1hqYcQITCFX-AObjs_t4Q","maxLength":22,"minLength":22,"pattern":"^[A-Za-z0-9-_]{22}$","readOnly":true,"type":"string"},"AccountLogin":{"minLength":1,"type":"string"},"ActionArgs":{"example":[true,1,"hello"],"items":{"$ref":"#/components/schemas/AnyJSON"},"type":"array"},"ActionMultiResult":{"items":{"$ref":"#/components/schemas/ActionResult"},"type":"array"},"ActionName":{"minLength":1,"readOnly":true,"type":"string"},"ActionResult":{"example":{"functionality":"RnVuY3Rpb25hbGl0eTAwMA","result":[],"status":200},"properties":{"functionality":{"$ref":"#/components/schemas/FunctionalityId"},"result":{"items":{"$ref":"#/components/schemas/AnyJSON"},"type":"array"},"status":{"description":"Return code (HTTP status code)","example":200,"maximum":599,"minimum":200,"type":"integer"}},"required":["status"],"type":"object","x-links":[{"href":"/functionalities/{functionality}","rel":"functionality"}]},"AnyJSON":{"description":"null/boolean/integer/number/string/object/array","x-type":"any"},"AppId":{"minLength":1,"type":"string"},"AttributeName":{"minLength":1,"readOnly":true,"type":"string"},"AttributeValue":{"example":{"value":0,"when":"2025-06-15T13:47:07.619Z"},"properties":{"value":{"$ref":"#/components/schemas/AnyJSON"},"when":{"format":"date-time","type":"string"}},"required":["when","value"],"type":"object"},"AttributesValues":{"additionalProperties":{"items":{"$ref":"#/components/schemas/AttributeValue"},"type":"array"},"description":"Keys are attribute ids","example":{"Counter":[{"value":0,"when":"2025-06-15T13:47:07.619Z"}],"Schedule":[{"value":[{"DTSTAMP":"20120101T000000Z","DTSTART":{"":"20120101T063000","TZID":"Europe/Paris"},"RRULE":{"FREQ":"DAILY"},"SUMMARY":"2","UID":"HP-06h30@si.ijenko.net"},{"DTSTAMP":"20120101T000000Z","DTSTART":{"":"20120101T223000","TZID":"Europe/Paris"},"RRULE":{"FREQ":"DAILY"},"SUMMARY":"3","UID":"HC-22h30@si.ijenko.net"}],"when":"2025-06-15T13:47:07.619Z"}]},"type":"object"},"AuthChangePassword":{"properties":{"newPassword":{"$ref":"#/components/schemas/Password"},"oldPassword":{"$ref":"#/components/schemas/Password"}},"required":["oldPassword","newPassword"],"type":"object"},"AuthLogin":{"properties":{"appId":{"$ref":"#/components/schemas/AppId"},"login":{"minLength":1,"type":"string"},"password":{"$ref":"#/components/schemas/Password"},"ttl":{"description":"Desired maximum life-time in seconds for the refresh token","example":1800,"minimum":0,"type":"integer"}},"required":["login","password","appId"],"type":"object"},"AuthRefresh":{"properties":{"appId":{"$ref":"#/components/schemas/AppId"},"refreshToken":{"minLength":1,"type":"string"}},"required":["refreshToken","appId"],"type":"object"},"AuthResetPassword":{"properties":{"appId":{"$ref":"#/components/schemas/AppId"},"email":{"$ref":"#/components/schemas/UserEmail"},"login":{"minLength":1,"type":"string"}},"required":["appId"],"type":"object"},"AuthTokens":{"properties":{"accessToken":{"minLength":1,"type":"string"},"accessTokenExpires":{"format":"date-time","type":"string"},"refreshToken":{"minLength":1,"type":"string"},"refreshTokenExpires":{"format":"date-time","type":"string"}},"required":["accessToken","refreshToken","accessTokenExpires","refreshTokenExpires"],"type":"object"},"BusId":{"minLength":3,"type":"string"},"BusItem":{"properties":{"functionality":{"$ref":"#/components/schemas/FunctionalityId"},"id":{"$ref":"#/components/schemas/BusId"},"protocol":{"$ref":"#/components/schemas/BusProtocol"}},"readOnly":true,"required":["id","functionality","protocol"],"type":"object"},"BusPairing":{"properties":{"duration":{"description":"Duration of the pairing window.","type":"integer"},"enabled":{"type":"boolean"}},"required":["enabled"],"type":"object"},"BusProtocol":{"minLength":1,"type":"string"},"CountryCode":{"description":"Country code (ISO 3166-1 alpha-2)","example":"FR","maxLength":2,"minLength":2,"pattern":"^[A-Z][A-Z]$","type":"string"},"DefaultError":{"description":"Any error.","properties":{"code":{"type":"integer"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"Device":{"properties":{"address":{"$ref":"#/components/schemas/DeviceAddress"},"attributes":{"additionalProperties":{"additionalProperties":{"$ref":"#/components/schemas/AnyJSON"},"description":"Each key is an attribute name","type":"object"},"description":"Each key is <FunctionalityClass>@<Endpoint>","type":"object"},"class":{"$ref":"#/components/schemas/DeviceClass"},"functionalities":{"items":{"$ref":"#/components/schemas/FunctionalityItem"},"readOnly":true,"type":"array","uniqueItems":true},"isOnline":{"readOnly":true,"type":"boolean"},"manufacturer":{"readOnly":true,"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"model":{"readOnly":true,"type":"string"},"name":{"description":"Name of the device. User defined.","minLength":2,"type":"string"},"place":{"$ref":"#/components/schemas/PlaceId"},"protocol":{"$ref":"#/components/schemas/BusProtocol"},"tags":{"items":{"$ref":"#/components/schemas/DeviceTag"},"type":"array","uniqueItems":true}},"required":["place","class","address","isOnline","functionalities","tags"],"type":"object","x-links":[{"href":"/places/{place}","rel":"place"}]},"DeviceAddress":{"minLength":1,"pattern":"^[A-Z0-9]{1,32}$","type":"string"},"DeviceClass":{"maxLength":4,"minLength":4,"pattern":"^[A-Z][A-Z0-9]{3}$","type":"string"},"DeviceId":{"description":"Unique identifier of the *Device*","example":"RGV2aWNlMDAwMDAwMDAwMA","maxLength":22,"minLength":22,"pattern":"^[A-Za-z0-9-_]{22}$","readOnly":true,"type":"string"},"DeviceItem":{"properties":{"address":{"$ref":"#/components/schemas/DeviceAddress"},"class":{"$ref":"#/components/schemas/DeviceClass"},"id":{"$ref":"#/components/schemas/DeviceId"},"isOnline":{"type":"boolean"},"metadata":{"$ref":"#/components/schemas/MetadataSelected"},"name":{"description":"Name of the *Device* as defined by the user. Can be used for user interfaces.","minLength":2,"type":"string"},"place":{"$ref":"#/components/schemas/PlaceId"},"tags":{"items":{"$ref":"#/components/schemas/DeviceTag"},"type":"array","uniqueItems":true}},"readOnly":true,"required":["id","place","class","address","isOnline","tags"],"type":"object","x-links":[{"href":"/devices/{id}","rel":"full"},{"href":"/places/{place}","rel":"place"}]},"DevicePatch":{"properties":{"name":{"description":"Name of the *Device* as defined by the user. Can be used for user interfaces.","minLength":2,"type":"string"}},"type":"object"},"DeviceTag":{"maxLength":21,"minLength":1,"pattern":"^[a-z](?:[a-z0-9_]{0,20}|[a-z0-9_]:[a-z0-9_]{1,18}|[a-z0-9_]{2}:[a-z0-9_]{1,17}|[a-z0-9_]{3}:[a-z0-9_]{1,16}|[a-z0-9_]{4}:[a-z0-9_]{1,15})$","type":"string"},"ElectricityAutonomy":{"example":{"autonomy":0.4,"code":200000,"from":"2025-06-15T13:47:07.619Z","to":"2025-06-15T13:47:07.619Z"},"properties":{"autonomy":{"description":"Average electricity autonomy in % (value in range [0, 1], rounded)","example":0.4,"maximum":1,"minimum":0,"type":"number"},"code":{"$ref":"#/components/schemas/ElectricityStatusCode"},"from":{"format":"date-time","type":"string"},"message":{"description":"Message for cases where computation is not possible (codes 200001, 200002)","minLength":1,"type":"string"},"to":{"format":"date-time","type":"string"}},"required":["code"],"type":"object"},"ElectricityFlow":{"items":{"$ref":"#/components/schemas/ElectricityFunctionality"},"type":"array","uniqueItems":true},"ElectricityFlowFormula":{"items":{"$ref":"#/components/schemas/ElectricityFlowFunctionality"},"type":"array","uniqueItems":true},"ElectricityFlowFunctionality":{"example":{"class":"ElecMetering","factor":1,"flow":"elec_total_gen","id":"RnVuY3Rpb25hbGl0eTAwMA"},"properties":{"class":{"$ref":"#/components/schemas/FunctionalityClass"},"factor":{"type":"integer"},"flow":{"$ref":"#/components/schemas/ElectricityFlowName"},"id":{"$ref":"#/components/schemas/FunctionalityId"}},"required":["id","class","flow","factor"],"type":"object","x-links":[{"href":"/functionalities/{id}","rel":"full"}]},"ElectricityFlowName":{"description":"Name of an electricity flow","enum":["battery_charge","battery_discharge","battery_grid","elec_total_gen","elec_total_usage","elec_feed_in","elec_drawn","elec_local","elec_from_household","elec_to_pv","elec_usage"],"minLength":1,"type":"string"},"ElectricityFlows":{"example":{"code":200000,"flows":{"elec_local":[{"class":"ElecMetering","factor":1,"id":"SF4_y4SoTCpYXgGODJplJQ"}],"elec_total_usage":[{"class":"ElecMetering","factor":1,"flow":"elec_total_gen","id":"SF4_y4SoTCpYXgGODJplJQ"},{"class":"ElecSmartMetering","factor":1,"flow":"elec_drawn","id":"lvxvQ9SqXCpYSqHOJI7tIA"},{"class":"ElecSmartMetering","factor":-1,"flow":"elec_feed_in","id":"d1xvwdWKWCpYH6GPjovnLg"}]}},"properties":{"code":{"$ref":"#/components/schemas/ElectricityStatusCode"},"flows":{"$ref":"#/components/schemas/ElectricityVirtualFlows"},"message":{"$ref":"#/components/schemas/ElectricityStatusMessage"},"missing":{"$ref":"#/components/schemas/ElectricityMissingFlows"}},"required":["code"],"type":"object"},"ElectricityFlowsSetup":{"example":{"elec_drawn":[{"class":"ElecSmartMetering","id":"lvxvQ9SqXCpYSqHOJI7tIA"}],"elec_feed_in":[{"class":"ElecSmartMetering","id":"d1xvwdWKWCpYH6GPjovnLg"}],"elec_total_gen":[{"class":"ElecMetering","id":"SF4_y4SoTCpYXgGODJplJQ"}]},"properties":{"battery_charge":{"$ref":"#/components/schemas/ElectricityFlow"},"battery_discharge":{"$ref":"#/components/schemas/ElectricityFlow"},"battery_grid":{"$ref":"#/components/schemas/ElectricityFlow"},"elec_drawn":{"$ref":"#/components/schemas/ElectricityFlow"},"elec_feed_in":{"$ref":"#/components/schemas/ElectricityFlow"},"elec_from_household":{"$ref":"#/components/schemas/ElectricityFlow"},"elec_local":{"$ref":"#/components/schemas/ElectricityFlow"},"elec_to_pv":{"$ref":"#/components/schemas/ElectricityFlow"},"elec_total_gen":{"$ref":"#/components/schemas/ElectricityFlow"},"elec_total_usage":{"$ref":"#/components/schemas/ElectricityFlow"},"elec_usage":{"$ref":"#/components/schemas/ElectricityFlow"}},"type":"object"},"ElectricityFunctionality":{"example":{"class":"ElecMetering","id":"RnVuY3Rpb25hbGl0eTAwMA"},"properties":{"class":{"$ref":"#/components/schemas/FunctionalityClass"},"id":{"$ref":"#/components/schemas/FunctionalityId"}},"required":["id","class"],"type":"object","x-links":[{"href":"/functionalities/{id}","rel":"full"}]},"ElectricityMissingFlows":{"description":"List of missing flows (not available either directly or indirectly)","properties":{"battery_charge":{"enum":[true],"type":"boolean"},"battery_discharge":{"enum":[true],"type":"boolean"},"battery_grid":{"enum":[true],"type":"boolean"},"elec_drawn":{"enum":[true],"type":"boolean"},"elec_feed_in":{"enum":[true],"type":"boolean"},"elec_from_household":{"enum":[true],"type":"boolean"},"elec_local":{"enum":[true],"type":"boolean"},"elec_to_pv":{"enum":[true],"type":"boolean"},"elec_total_gen":{"enum":[true],"type":"boolean"},"elec_total_usage":{"enum":[true],"type":"boolean"},"elec_usage":{"enum":[true],"type":"boolean"}},"type":"object"},"ElectricitySelfConsumption":{"example":{"code":200000,"from":"2025-06-15T13:47:07.619Z","selfConsumption":1,"to":"2025-06-15T13:47:07.619Z"},"properties":{"code":{"$ref":"#/components/schemas/ElectricityStatusCode"},"from":{"format":"date-time","type":"string"},"message":{"description":"Message for cases where computation is not possible (codes 200001, 200002)","minLength":1,"type":"string"},"selfConsumption":{"description":"Average self-consumption rate in % (value in range [0, 1], rounded)","example":0.555555,"maximum":1,"minimum":0,"type":"number"},"to":{"format":"date-time","type":"string"}},"required":["code"],"type":"object"},"ElectricityStatusCode":{"description":"Status code. 200000 means OK. Other codes indicate full or partial failure.","enum":[200000,200001,200002],"example":200000,"type":"integer"},"ElectricityStatusMessage":{"description":"Message for cases where computation is not possible (codes 200001, 200002)","minLength":1,"type":"string"},"ElectricityVirtualFlows":{"properties":{"battery_charge":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"battery_discharge":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"battery_grid":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"elec_drawn":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"elec_feed_in":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"elec_from_household":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"elec_local":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"elec_to_pv":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"elec_total_gen":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"elec_total_usage":{"$ref":"#/components/schemas/ElectricityFlowFormula"},"elec_usage":{"$ref":"#/components/schemas/ElectricityFlowFormula"}},"type":"object"},"ErrorEntity":{"description":"An error related to access to an entity (400, 403, 404, 410)","properties":{"code":{"type":"integer"},"message":{"type":"string"},"resource":{"$ref":"#/components/schemas/ResourceRef"}},"required":["code","message","resource"],"type":"object"},"ErrorGatewayUnreachable":{"description":"The gateway of the Place is not reachable.","properties":{"code":{"enum":["450"],"type":"string"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"ErrorSubEntity":{"description":"An error related to access to an sub-entity (400, 403, 404, 410)","properties":{"code":{"type":"integer"},"message":{"type":"string"},"resource":{"properties":{"entity":{"enum":["Action","Attribute","Bus"],"type":"string"},"href":{"minLength":1,"type":"string"},"id":{"minLength":1,"type":"string"},"parent":{"description":"Container resource.","properties":{"entity":{"enum":["Place","Functionality"],"type":"string"},"id":{"minLength":1,"type":"string"}},"required":["entity","id"],"type":"object"}},"required":["id","entity","href"],"type":"object"}},"required":["code","message","resource"],"type":"object"},"Functionality":{"properties":{"actions":{"items":{"$ref":"#/components/schemas/ActionName"},"readOnly":true,"type":"array","uniqueItems":true},"attributes":{"items":{"$ref":"#/components/schemas/AttributeName"},"readOnly":true,"type":"array","uniqueItems":true},"class":{"$ref":"#/components/schemas/FunctionalityClass"},"device":{"$ref":"#/components/schemas/DeviceId"},"endpoint":{"$ref":"#/components/schemas/FunctionalityEndpoint"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"$ref":"#/components/schemas/FunctionalityName"},"tags":{"items":{"$ref":"#/components/schemas/FunctionalityTag"},"type":"array","uniqueItems":true}},"required":["class","endpoint","device","attributes","tags"],"type":"object","x-links":[{"href":"/devices/{id}","rel":"device"}]},"FunctionalityClass":{"minLength":2,"pattern":"^[A-Z][A-Za-z0-9]+$","readOnly":true,"type":"string"},"FunctionalityCreated":{"description":"A resource has been created. The `resource` property gives its reference.","example":{"code":201,"message":"Functionality created","resource":{"entity":"Functionality","href":"/functionalities/RnVuY3Rpb25hbGl0eTAwMA","id":"RnVuY3Rpb25hbGl0eTAwMA"}},"properties":{"code":{"enum":[201],"example":201,"type":"integer"},"message":{"enum":["Functionality created"],"type":"string"},"resource":{"$ref":"#/components/schemas/FunctionalityResource"}},"required":["code","message","resource"],"type":"object"},"FunctionalityEndpoint":{"maximum":255,"minimum":0,"readOnly":true,"type":"integer"},"FunctionalityId":{"description":"Unique identifier of the *Functionality*","example":"RnVuY3Rpb25hbGl0eTAwMA","maxLength":22,"minLength":22,"pattern":"^[A-Za-z0-9-_]{22}$","readOnly":true,"type":"string"},"FunctionalityItem":{"properties":{"class":{"$ref":"#/components/schemas/FunctionalityClass"},"device":{"$ref":"#/components/schemas/DeviceId"},"endpoint":{"$ref":"#/components/schemas/FunctionalityEndpoint"},"id":{"$ref":"#/components/schemas/FunctionalityId"},"metadata":{"$ref":"#/components/schemas/MetadataSelected"},"name":{"$ref":"#/components/schemas/FunctionalityName"},"tags":{"items":{"$ref":"#/components/schemas/FunctionalityTag"},"type":"array","uniqueItems":true}},"readOnly":true,"required":["id","device","class","endpoint"],"type":"object","x-links":[{"href":"/functionalities/{id}","rel":"full"},{"href":"/devices/{device}","rel":"device"}]},"FunctionalityName":{"description":"Free functionality name","type":"string"},"FunctionalityNew":{"properties":{"class":{"$ref":"#/components/schemas/FunctionalityClass"},"endpoint":{"$ref":"#/components/schemas/FunctionalityEndpoint"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"$ref":"#/components/schemas/FunctionalityName"},"tags":{"items":{"$ref":"#/components/schemas/FunctionalityTag"},"type":"array","uniqueItems":true}},"required":["class","endpoint"],"type":"object"},"FunctionalityPatch":{"properties":{"name":{"$ref":"#/components/schemas/FunctionalityName"}},"type":"object"},"FunctionalityResource":{"example":{"entity":"Functionality","href":"/functionalities/RnVuY3Rpb25hbGl0eTAwMA","id":"RnVuY3Rpb25hbGl0eTAwMA"},"properties":{"entity":{"enum":["Functionality"],"type":"string"},"href":{"minLength":1,"type":"string"},"id":{"$ref":"#/components/schemas/FunctionalityId"}},"required":["id","entity","href"],"type":"object"},"FunctionalityTag":{"maxLength":21,"minLength":1,"pattern":"^[a-z](?:[a-z0-9_]{0,20}|[a-z0-9_]:[a-z0-9_]{1,18}|[a-z0-9_]{2}:[a-z0-9_]{1,17}|[a-z0-9_]{3}:[a-z0-9_]{1,16}|[a-z0-9_]{4}:[a-z0-9_]{1,15})$","type":"string"},"Locale":{"description":"Locale identifier (language, region). See https://tools.ietf.org/html/rfc5646 and https://www.iana.org/assignments/lang-subtags-templates/lang-subtags-templates.xhtml .\n","example":"fr-FR","minLength":2,"pattern":"^[a-z]{2}[A-Za-z0-9-]*$","type":"string"},"Metadata":{"additionalProperties":{"$ref":"#/components/schemas/AnyJSON"},"description":"Keys are limited to the same format as tags (up to 21 characters, [a-z0-9], starting with [a-z]). Values can be any JSON value.","type":"object"},"MetadataKey":{"maxLength":21,"minLength":1,"pattern":"^[a-z](?:[a-z0-9_]{0,20}|[a-z0-9_]:[a-z0-9_]{1,18}|[a-z0-9_]{2}:[a-z0-9_]{1,17}|[a-z0-9_]{3}:[a-z0-9_]{1,16}|[a-z0-9_]{4}:[a-z0-9_]{1,15})$","type":"string"},"MetadataPatch":{"properties":{"add":{"additionalProperties":{"$ref":"#/components/schemas/AnyJSON"},"description":"list of pairs key/value to add/replace","type":"object"},"remove":{"description":"list of keys to remove","items":{"$ref":"#/components/schemas/MetadataKey"},"type":"array","uniqueItems":true}},"type":"object"},"MetadataSelected":{"additionalProperties":{"$ref":"#/components/schemas/AnyJSON"},"description":"Subset of metadata attached to the resource selected using the 'embed-metadata' parameter","type":"object"},"Notification":{"properties":{"data":{"type":"object"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"minLength":1,"type":"string"},"place":{"$ref":"#/components/schemas/PlaceId"},"routing":{"format":"uri","type":"string"}},"required":["name","place"],"type":"object","x-links":[{"href":"/places/{place}","rel":"place"}]},"NotificationCreated":{"description":"A resource has been created. The `resource` property gives its reference.","example":{"code":201,"message":"Notification created","resource":{"entity":"Notification","href":"/notifications/InovwcCIGM5X7KvKrJ7vJw","id":"InovwcCIGM5X7KvKrJ7vJw"}},"properties":{"code":{"enum":[201],"example":201,"type":"integer"},"message":{"enum":["Notification created"],"type":"string"},"resource":{"$ref":"#/components/schemas/NotificationResource"}},"required":["code","message","resource"],"type":"object"},"NotificationId":{"description":"Unique identifier of the *Notification*","example":"InovwcCIGM5X7KvKrJ7vJw","maxLength":22,"minLength":22,"pattern":"^[A-Za-z0-9-_]{22}$","readOnly":true,"type":"string"},"NotificationItem":{"description":"Notification","properties":{"id":{"$ref":"#/components/schemas/NotificationId"},"metadata":{"$ref":"#/components/schemas/MetadataSelected"},"name":{"type":"string"}},"readOnly":true,"required":["id","name"],"type":"object","x-links":[{"href":"/notifications/{id}","rel":"full"}]},"NotificationNew":{"properties":{"data":{"type":"object"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"minLength":1,"type":"string"},"routing":{"format":"uri","type":"string"}},"required":["name"],"type":"object"},"NotificationPatch":{"properties":{"data":{"type":"object"},"name":{"minLength":1,"type":"string"},"routing":{"format":"uri","type":"string"}},"type":"object"},"NotificationResource":{"example":{"entity":"Notification","href":"/notifications/InovwcCIGM5X7KvKrJ7vJw","id":"InovwcCIGM5X7KvKrJ7vJw"},"properties":{"entity":{"enum":["Notification"],"type":"string"},"href":{"minLength":1,"type":"string"},"id":{"$ref":"#/components/schemas/NotificationId"}},"required":["id","entity","href"],"type":"object"},"Password":{"format":"password","minLength":5,"type":"string"},"PhoneNumber":{"description":"Phone number of the *User* in international format, for SMS notifications.","example":"+33177494646","minLength":6,"pattern":"^\\+[0-9]{5,}$","type":"string"},"Place":{"properties":{"account":{"$ref":"#/components/schemas/AccountId"},"country":{"$ref":"#/components/schemas/CountryCode"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"example":"⌂ Home","minLength":1,"type":"string"},"timeZone":{"$ref":"#/components/schemas/TimeZone"},"zipCode":{"$ref":"#/components/schemas/ZipCode"}},"required":["name","zipCode","country","timeZone"],"type":"object"},"PlaceCreated":{"description":"A resource has been created. The `resource` property gives its reference.","example":{"code":201,"message":"Place created","resource":{"entity":"Place","href":"/places/3HA6YcSCTSFX6SPPrI9PxQ","id":"3HA6YcSCTSFX6SPPrI9PxQ"}},"properties":{"code":{"enum":[201],"example":201,"type":"integer"},"message":{"enum":["Place created"],"type":"string"},"resource":{"$ref":"#/components/schemas/PlaceResource"}},"required":["code","message","resource"],"type":"object"},"PlaceId":{"description":"Unique identifier of the *Place*","example":"3HA6YcSCTSFX6SPPrI9PxQ","maxLength":22,"minLength":22,"pattern":"^[A-Za-z0-9-_]{22}$","readOnly":true,"type":"string"},"PlaceItem":{"properties":{"id":{"$ref":"#/components/schemas/PlaceId"},"name":{"type":"string"}},"readOnly":true,"required":["id","name"],"type":"object","x-links":[{"href":"/places/{id}","rel":"full"}]},"PlaceNew":{"properties":{"country":{"$ref":"#/components/schemas/CountryCode"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"example":"⌂ Home","minLength":1,"type":"string"},"timeZone":{"$ref":"#/components/schemas/TimeZone"},"zipCode":{"$ref":"#/components/schemas/ZipCode"}},"required":["name","zipCode","country","timeZone"],"type":"object"},"PlacePatch":{"properties":{"country":{"$ref":"#/components/schemas/CountryCode"},"name":{"example":"⌂ Home","minLength":1,"type":"string"},"timeZone":{"$ref":"#/components/schemas/TimeZone"},"zipCode":{"$ref":"#/components/schemas/ZipCode"}},"type":"object"},"PlaceResource":{"example":{"entity":"Place","href":"/places/3HA6YcSCTSFX6SPPrI9PxQ","id":"3HA6YcSCTSFX6SPPrI9PxQ"},"properties":{"entity":{"enum":["Place"],"type":"string"},"href":{"minLength":1,"type":"string"},"id":{"$ref":"#/components/schemas/PlaceId"}},"required":["id","entity","href"],"type":"object"},"Program":{"properties":{"code":{"$ref":"#/components/schemas/AnyJSON"},"enabled":{"type":"boolean"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"minLength":1,"type":"string"},"place":{"$ref":"#/components/schemas/PlaceId"}},"required":["name","enabled","code"],"type":"object","x-links":[{"href":"/places/{place}","rel":"place"}]},"ProgramCreated":{"description":"A resource has been created. The `resource` property gives its reference.","example":{"code":201,"message":"Program created","resource":{"entity":"Program","href":"/programs/3_J_6ZWICc5X_KverorNvw","id":"3_J_6ZWICc5X_KverorNvw"}},"properties":{"code":{"enum":[201],"example":201,"type":"integer"},"message":{"enum":["Program created"],"type":"string"},"resource":{"$ref":"#/components/schemas/ProgramResource"}},"required":["code","message","resource"],"type":"object"},"ProgramId":{"description":"Unique identifier of the *Program*","example":"3_J_6ZWICc5X_KverorNvw","maxLength":22,"minLength":22,"pattern":"^[A-Za-z0-9-_]{22}$","readOnly":true,"type":"string"},"ProgramItem":{"properties":{"enabled":{"type":"boolean"},"id":{"$ref":"#/components/schemas/ProgramId"},"metadata":{"$ref":"#/components/schemas/MetadataSelected"},"name":{"type":"string"}},"readOnly":true,"required":["id","name","enabled"],"type":"object","x-links":[{"href":"/programs/{id}","rel":"full"}]},"ProgramLog":{"properties":{"actions":{"items":{"$ref":"#/components/schemas/ActionResult"},"type":"array"},"errors":{"items":{"type":"string"},"type":"array"},"notifications":{"items":{"$ref":"#/components/schemas/NotificationId"},"type":"array","uniqueItems":true},"when":{"format":"date-time","type":"string"}},"required":["when"],"type":"object"},"ProgramNew":{"example":{"code":[],"enabled":false,"name":"NOOP"},"properties":{"code":{"$ref":"#/components/schemas/AnyJSON"},"enabled":{"default":true,"type":"boolean"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"minLength":1,"type":"string"}},"required":["name","code"],"type":"object"},"ProgramPatch":{"properties":{"code":{"$ref":"#/components/schemas/AnyJSON"},"enabled":{"type":"boolean"},"name":{"minLength":1,"type":"string"}},"type":"object"},"ProgramResource":{"example":{"entity":"Program","href":"/programs/3_J_6ZWICc5X_KverorNvw","id":"3_J_6ZWICc5X_KverorNvw"},"properties":{"entity":{"enum":["Program"],"type":"string"},"href":{"minLength":1,"type":"string"},"id":{"$ref":"#/components/schemas/ProgramId"}},"required":["id","entity","href"],"type":"object"},"ResourceRef":{"properties":{"entity":{"enum":["Device","Functionality","Notification","Place","Program","User","Account","AccountsBase"],"type":"string"},"href":{"minLength":1,"type":"string"},"id":{"minLength":1,"type":"string"}},"required":["id","entity","href"],"type":"object"},"Tag":{"maxLength":21,"minLength":1,"pattern":"^[a-z](?:[a-z0-9_]{0,20}|[a-z0-9_]:[a-z0-9_]{1,18}|[a-z0-9_]{2}:[a-z0-9_]{1,17}|[a-z0-9_]{3}:[a-z0-9_]{1,16}|[a-z0-9_]{4}:[a-z0-9_]{1,15})$","type":"string"},"Tags":{"items":{"$ref":"#/components/schemas/Tag"},"type":"array","uniqueItems":true},"TagsPatch":{"properties":{"add":{"description":"list of tags to add","items":{"$ref":"#/components/schemas/Tag"},"type":"array","uniqueItems":true},"remove":{"description":"list of tags to remove","items":{"$ref":"#/components/schemas/Tag"},"type":"array","uniqueItems":true}},"type":"object"},"TimeZone":{"description":"A time zone name from the Time Zone Database at https://www.iana.org/time-zones","example":"Europe/Paris","minLength":2,"pattern":"^[A-Z][A-Za-z0-9-_+]+(?:/[A-Z][A-Za-z0-9-_+]+)*$","type":"string"},"TokenId":{"example":"dfSDdRcsd","minLength":1,"type":"string"},"User":{"properties":{"account":{"$ref":"#/components/schemas/AccountId"},"canLogin":{"default":false,"description":"true if the user owning the account (can get tokens with /auth/login)","example":false,"readOnly":true,"type":"boolean"},"email":{"$ref":"#/components/schemas/UserEmail"},"locale":{"$ref":"#/components/schemas/Locale"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"minLength":1,"type":"string"},"phoneNumber":{"$ref":"#/components/schemas/PhoneNumber"}},"required":["email","name","locale","canLogin"],"type":"object"},"UserCreated":{"description":"A resource has been created. The `resource` property gives its reference.","example":{"code":201,"message":"User created","resource":{"entity":"User","href":"/users/RGV2aWNlMDAwMDAwMDAwMZ","id":"RGV2aWNlMDAwMDAwMDAwMZ"}},"properties":{"code":{"enum":[201],"example":201,"type":"integer"},"message":{"enum":["User created"],"type":"string"},"resource":{"$ref":"#/components/schemas/UserResource"}},"required":["code","message","resource"],"type":"object"},"UserEmail":{"format":"email","minLength":6,"type":"string"},"UserId":{"description":"Unique identifier of the *User*","example":"RGV2aWNlMDAwMDAwMDAwMZ","maxLength":22,"minLength":22,"pattern":"^[A-Za-z0-9-_]{22}$","readOnly":true,"type":"string"},"UserItem":{"properties":{"canLogin":{"default":false,"description":"true if the user owning the account (can get tokens with /auth/login)","example":false,"readOnly":true,"type":"boolean"},"email":{"$ref":"#/components/schemas/UserEmail"},"id":{"$ref":"#/components/schemas/UserId"},"locale":{"$ref":"#/components/schemas/Locale"},"metadata":{"$ref":"#/components/schemas/MetadataSelected"},"name":{"minLength":1,"type":"string"},"phoneNumber":{"$ref":"#/components/schemas/PhoneNumber"}},"required":["email","name","locale","id"],"type":"object","x-links":[{"href":"/users/{id}","rel":"full"}]},"UserMe":{"properties":{"email":{"$ref":"#/components/schemas/UserEmail"},"id":{"$ref":"#/components/schemas/UserId"},"locale":{"$ref":"#/components/schemas/Locale"},"login":{"$ref":"#/components/schemas/AccountLogin"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"minLength":1,"type":"string"},"phoneNumber":{"$ref":"#/components/schemas/PhoneNumber"}},"required":["email","name","locale","id"],"type":"object","x-links":[{"href":"/account/users/{id}","rel":"full"}]},"UserMePatch":{"properties":{"locale":{"$ref":"#/components/schemas/Locale"}},"type":"object"},"UserNew":{"properties":{"email":{"$ref":"#/components/schemas/UserEmail"},"locale":{"$ref":"#/components/schemas/Locale"},"metadata":{"$ref":"#/components/schemas/Metadata"},"name":{"minLength":1,"type":"string"},"phoneNumber":{"$ref":"#/components/schemas/PhoneNumber"}},"required":["email","name","locale"],"type":"object"},"UserPatch":{"properties":{"email":{"$ref":"#/components/schemas/UserEmail"},"locale":{"$ref":"#/components/schemas/Locale"},"name":{"minLength":1,"type":"string"},"phoneNumber":{"$ref":"#/components/schemas/PhoneNumber"}},"type":"object"},"UserResource":{"example":{"entity":"User","href":"/users/RGV2aWNlMDAwMDAwMDAwMZ","id":"RGV2aWNlMDAwMDAwMDAwMZ"},"properties":{"entity":{"enum":["User"],"type":"string"},"href":{"minLength":1,"type":"string"},"id":{"$ref":"#/components/schemas/UserId"}},"required":["id","entity","href"],"type":"object"},"UserTokenItem":{"description":"Token for User API access","properties":{"appName":{"description":"Application name","example":"Home Eopath","type":"string"},"id":{"$ref":"#/components/schemas/TokenId"},"lastUse":{"description":"Time of last use of the token to access the API. Updated at most every 15 minutes. If absent, the token has never been used.","format":"date-time","type":"string"},"places":{"description":"List of Places to which the User has access. If absent, it means any Place of the account are allowed.","items":{"$ref":"#/components/schemas/PlaceItem"},"type":"array","uniqueItems":true},"refreshTokenExpires":{"description":"If absent, infinite validity.","format":"date-time","type":"string"},"self":{"description":"True if this token is the one used for this API request","type":"boolean"},"user":{"$ref":"#/components/schemas/UserItem"}},"required":["id","appName","user"],"type":"object"},"ZipCode":{"description":"Postal code","maxLength":10,"minLength":0,"pattern":"^(?:[A-Z0-9](?:[A-Z0-9][- ]?)*[A-Z0-9])?$","type":"string"}}}}