Skip to content

Account

Get account details.

GET /account

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Account representation from the API.

Source code in nukiwebapi/account.py
11
12
13
14
15
16
17
18
19
20
def get(self) -> Dict[str, Any]:
    """
    Get account details.

    GET /account

    Returns:
        Dict[str, Any]: Account representation from the API.
    """
    return self.client._request("GET", "/account").json()

Update account details.

POST /account

Parameters:

Name Type Description Default
language str

The language code (required).

required
email str

The new email address.

None
password str

The account password (min 7 chars).

None
name str

The account name.

None
config dict

Alexa/Google/OTP configuration.

None
profile dict

Profile details (firstName, lastName, address, etc.).

None
delete_api_tokens bool

Whether to delete existing API tokens if password changes. Defaults to True.

True

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Updated account representation from the API.

Source code in nukiwebapi/account.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
def update(
    self,
    language: str,
    email: Optional[str] = None,
    password: Optional[str] = None,
    name: Optional[str] = None,
    config: Optional[Dict[str, Any]] = None,
    profile: Optional[Dict[str, Any]] = None,
    delete_api_tokens: bool = True,
) -> Dict[str, Any]:
    """
    Update account details.

    POST /account

    Args:
        language (str): The language code (required).
        email (str, optional): The new email address.
        password (str, optional): The account password (min 7 chars).
        name (str, optional): The account name.
        config (dict, optional): Alexa/Google/OTP configuration.
        profile (dict, optional): Profile details (firstName, lastName, address, etc.).
        delete_api_tokens (bool, optional): Whether to delete existing API tokens if password changes. Defaults to True.

    Returns:
        Dict[str, Any]: Updated account representation from the API.
    """
    body: Dict[str, Any] = {"language": language}
    if email is not None:
        body["email"] = email
    if password is not None:
        if len(password) < 7:
            raise ValueError("Password must be at least 7 characters long")
        body["password"] = password
    if name is not None:
        body["name"] = name
    if config is not None:
        body["config"] = config
    if profile is not None:
        body["profile"] = profile

    return self.client._request(
        "POST",
        "/account",
        params={"deleteApiTokens": delete_api_tokens},
        json=body,
    )

Delete the account.

DELETE /account

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: API response confirming account deletion.

Source code in nukiwebapi/account.py
70
71
72
73
74
75
76
77
78
79
def delete(self) -> Dict[str, Any]:
    """
    Delete the account.

    DELETE /account

    Returns:
        Dict[str, Any]: API response confirming account deletion.
    """
    return self.client._request("DELETE", "/account")

Trigger an email change request for the account.

POST /account/email/change

Parameters:

Name Type Description Default
email str

The new email address to change to.

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: API response indicating the email change request was sent.

Source code in nukiwebapi/account.py
82
83
84
85
86
87
88
89
90
91
92
93
94
95
def change_email(self, email: str) -> Dict[str, Any]:
    """
    Trigger an email change request for the account.

    POST /account/email/change

    Args:
        email (str): The new email address to change to.

    Returns:
        Dict[str, Any]: API response indicating the email change request was sent.
    """
    data = {"email": email}
    return self.client._request("POST", "/account/email/change", json=data)

Verify the email change using the code sent to the new email.

POST /account/email/verify

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: API response indicating success or failure of the email verification.

Source code in nukiwebapi/account.py
 97
 98
 99
100
101
102
103
104
105
106
def verify_email(self) -> Dict[str, Any]:
    """
    Verify the email change using the code sent to the new email.

    POST /account/email/verify

    Returns:
        Dict[str, Any]: API response indicating success or failure of the email verification.
    """
    return self.client._request("POST", "/account/email/verify")

List all integrations for the account.

GET /account/integration

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: List of integrations for this account.

Source code in nukiwebapi/account.py
109
110
111
112
113
114
115
116
117
118
def list_integrations(self) -> Dict[str, Any]:
    """
    List all integrations for the account.

    GET /account/integration

    Returns:
        Dict[str, Any]: List of integrations for this account.
    """
    return self.client._request("GET", "/account/integration").json()

Delete a specific integration or its tokens for the account.

DELETE /account/integration

Parameters:

Name Type Description Default
apiKeyId str

ID of the API key to delete.

required
tokenId str

Specific token ID to delete. If not provided, all tokens under the API key will be removed.

None

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: API response indicating success of the deletion.

Source code in nukiwebapi/account.py
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
def delete_integration(self, apiKeyId: str, tokenId: Optional[str] = None) -> Dict[str, Any]:
    """
    Delete a specific integration or its tokens for the account.

    DELETE /account/integration

    Args:
        apiKeyId (str): ID of the API key to delete.
        tokenId (str, optional): Specific token ID to delete. If not provided, all tokens under the API key will be removed.

    Returns:
        Dict[str, Any]: API response indicating success of the deletion.
    """
    data = {"apiKeyId": apiKeyId}
    if tokenId:
        data["tokenId"] = tokenId
    return self.client._request("DELETE", "/account/integration", json=data)

Create a one-time password (OTP) secret for the account.

PUT /account/otp

Returns:

Name Type Description
str str

The OTP secret (Base32) to be used for generating TOTP codes.

Source code in nukiwebapi/account.py
139
140
141
142
143
144
145
146
147
148
def create_otp(self) -> str:
    """
    Create a one-time password (OTP) secret for the account.

    PUT /account/otp

    Returns:
        str: The OTP secret (Base32) to be used for generating TOTP codes.
    """
    return self.client._request("PUT", "/account/otp").json()

Enable OTP for the account using a TOTP code generated from the secret.

POST /account/otp

Parameters:

Name Type Description Default
otp str

Time-based one-time password (TOTP) code generated from the OTP secret.

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: API response indicating success of enabling OTP.

Source code in nukiwebapi/account.py
150
151
152
153
154
155
156
157
158
159
160
161
162
def enable_otp(self, otp: str) -> Dict[str, Any]:
    """
    Enable OTP for the account using a TOTP code generated from the secret.

    POST /account/otp

    Args:
        otp (str): Time-based one-time password (TOTP) code generated from the OTP secret.

    Returns:
        Dict[str, Any]: API response indicating success of enabling OTP.
    """
    return self.client._request("POST", "/account/otp", json={"otp": otp})

Disable OTP for the account.

DELETE /account/otp

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: API response indicating OTP was successfully disabled.

Source code in nukiwebapi/account.py
164
165
166
167
168
169
170
171
172
173
def disable_otp(self) -> Dict[str, Any]:
    """
    Disable OTP for the account.

    DELETE /account/otp

    Returns:
        Dict[str, Any]: API response indicating OTP was successfully disabled.
    """
    return self.client._request("DELETE", "/account/otp")

Reset the account password and optionally delete existing API tokens.

POST /account/password/reset

Parameters:

Name Type Description Default
email str

The email of the account to reset the password for.

required
deleteApiTokens bool

Whether to delete existing API tokens. Defaults to True.

True

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: API response indicating success of the password reset.

Source code in nukiwebapi/account.py
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
def reset_password(self, email: str, deleteApiTokens: bool = True) -> Dict[str, Any]:
    """
    Reset the account password and optionally delete existing API tokens.

    POST /account/password/reset

    Args:
        email (str): The email of the account to reset the password for.
        deleteApiTokens (bool, optional): Whether to delete existing API tokens. Defaults to True.

    Returns:
        Dict[str, Any]: API response indicating success of the password reset.
    """
    data = {"email": email, "deleteApiTokens": deleteApiTokens}
    return self.client._request("POST", "/account/password/reset", json=data)

Get account settings.

GET /account/setting

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Account settings from the API.

Source code in nukiwebapi/account.py
193
194
195
196
197
198
199
200
201
202
def get_setting(self) -> Dict[str, Any]:
    """
    Get account settings.

    GET /account/setting

    Returns:
        Dict[str, Any]: Account settings from the API.
    """
    return self.client._request("GET", "/account/setting").json()

Update account settings.

PUT /account/setting

Parameters:

Name Type Description Default
data dict

Settings data to update.

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Updated account settings from the API.

Source code in nukiwebapi/account.py
204
205
206
207
208
209
210
211
212
213
214
215
216
def update_setting(self, data: Dict[str, Any]) -> Dict[str, Any]:
    """
    Update account settings.

    PUT /account/setting

    Args:
        data (dict): Settings data to update.

    Returns:
        Dict[str, Any]: Updated account settings from the API.
    """
    return self.client._request("PUT", "/account/setting", json=data).json()

Delete a specific account setting.

DELETE /account/setting

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: API response confirming deletion.

Source code in nukiwebapi/account.py
218
219
220
221
222
223
224
225
226
227
def delete_setting(self) -> Dict[str, Any]:
    """
    Delete a specific account setting.

    DELETE /account/setting

    Returns:
        Dict[str, Any]: API response confirming deletion.
    """
    return self.client._request("DELETE", "/account/setting")

List all sub-accounts, optionally filtered by email.

GET /account/sub

Parameters:

Name Type Description Default
email str

Regex to filter sub-account emails.

None

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: List of sub-account representations.

Source code in nukiwebapi/account.py
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
def list_sub_accounts(self, email: str = None) -> Dict[str, Any]:
    """
    List all sub-accounts, optionally filtered by email.

    GET /account/sub

    Args:
        email (str, optional): Regex to filter sub-account emails.

    Returns:
        Dict[str, Any]: List of sub-account representations.
    """
    params = {}
    if email:
        params["email"] = email
    return self.client._request("GET", "/account/sub", params=params).json()

Create a new sub-account.

PUT /account/sub

Parameters:

Name Type Description Default
email str

Sub-account email address.

required
password str

Sub-account password (min 7 characters).

required
name str

Name of the sub-account.

required
rights int

Rights bitmask (0–31).

required
language str

Language code (e.g., "de").

required
profile dict

Sub-account profile with keys: - firstName (str) - lastName (str) - address (str) - zip (str) - city (str) - country (str, 2-letter ISO code)

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Created sub-account representation from the API.

Source code in nukiwebapi/account.py
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
def create_sub_account(
    self,
    email: str,
    password: str,
    name: str,
    rights: int,
    language: str,
    profile: Dict[str, str]
) -> Dict[str, Any]:
    """
    Create a new sub-account.

    PUT /account/sub

    Args:
        email (str): Sub-account email address.
        password (str): Sub-account password (min 7 characters).
        name (str): Name of the sub-account.
        rights (int): Rights bitmask (0–31).
        language (str): Language code (e.g., "de").
        profile (dict): Sub-account profile with keys:
            - firstName (str)
            - lastName (str)
            - address (str)
            - zip (str)
            - city (str)
            - country (str, 2-letter ISO code)

    Returns:
        Dict[str, Any]: Created sub-account representation from the API.
    """
    payload = {
        "email": email,
        "password": password,
        "name": name,
        "rights": rights,
        "language": language,
        "profile": profile
    }
    return self.client._request("PUT", "/account/sub", json=payload).json()

Get details of a specific sub-account.

GET /account/sub/{accountId}

Parameters:

Name Type Description Default
account_id int

ID of the sub-account to retrieve.

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Sub-account representation from the API.

Source code in nukiwebapi/account.py
288
289
290
291
292
293
294
295
296
297
298
299
300
def get_sub_account(self, account_id: int) -> Dict[str, Any]:
    """
    Get details of a specific sub-account.

    GET /account/sub/{accountId}

    Args:
        account_id (int): ID of the sub-account to retrieve.

    Returns:
        Dict[str, Any]: Sub-account representation from the API.
    """
    return self.client._request("GET", f"/account/sub/{account_id}").json()

Update a specific sub-account.

POST /account/sub/{accountId}

Parameters:

Name Type Description Default
account_id int

ID of the sub-account to update.

required
data dict

Fields to update (email, password, name, rights, language, profile, etc.)

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Updated sub-account representation from the API.

Source code in nukiwebapi/account.py
302
303
304
305
306
307
308
309
310
311
312
313
314
315
def update_sub_account(self, account_id: int, data: Dict[str, Any]) -> Dict[str, Any]:
    """
    Update a specific sub-account.

    POST /account/sub/{accountId}

    Args:
        account_id (int): ID of the sub-account to update.
        data (dict): Fields to update (email, password, name, rights, language, profile, etc.)

    Returns:
        Dict[str, Any]: Updated sub-account representation from the API.
    """
    return self.client._request("POST", f"/account/sub/{account_id}", json=data)

Delete a specific sub-account.

DELETE /account/sub/{accountId}

Parameters:

Name Type Description Default
account_id int

ID of the sub-account to delete.

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: API response confirming deletion.

Source code in nukiwebapi/account.py
317
318
319
320
321
322
323
324
325
326
327
328
329
def delete_sub_account(self, account_id: int) -> Dict[str, Any]:
    """
    Delete a specific sub-account.

    DELETE /account/sub/{accountId}

    Args:
        account_id (int): ID of the sub-account to delete.

    Returns:
        Dict[str, Any]: API response confirming deletion.
    """
    return self.client._request("DELETE", f"/account/sub/{account_id}")