Skip to content

ApiKey

List all API keys.

GET /api/key

Returns:

Type Description

list[dict]: List of API key objects.

Source code in nukiwebapi/api_key.py
 8
 9
10
11
12
13
14
15
16
def list_api_keys(self):
    """List all API keys.

    GET /api/key

    Returns:
        list[dict]: List of API key objects.
    """
    return self.client._request("GET", "/api/key")

Create a new API key.

PUT /api/key

Parameters:

Name Type Description Default
key_data dict

Data for creating the API key.

required

Returns:

Name Type Description
dict

Created API key object.

Source code in nukiwebapi/api_key.py
18
19
20
21
22
23
24
25
26
27
28
29
def create_api_key(self, key_data: dict):
    """Create a new API key.

    PUT /api/key

    Args:
        key_data (dict): Data for creating the API key.

    Returns:
        dict: Created API key object.
    """
    return self.client._request("PUT", "/api/key", json=key_data)

Update an existing API key.

POST /api/key/{apiKeyId}

Parameters:

Name Type Description Default
api_key_id int

ID of the API key to update.

required
key_data dict

Update data.

required

Returns:

Name Type Description
dict

API response (usually empty with 204 status).

Source code in nukiwebapi/api_key.py
31
32
33
34
35
36
37
38
39
40
41
42
43
def update_api_key(self, api_key_id: int, key_data: dict):
    """Update an existing API key.

    POST /api/key/{apiKeyId}

    Args:
        api_key_id (int): ID of the API key to update.
        key_data (dict): Update data.

    Returns:
        dict: API response (usually empty with 204 status).
    """
    return self.client._request("POST", f"/api/key/{api_key_id}", json=key_data)

Delete an API key.

DELETE /api/key/{apiKeyId}

Parameters:

Name Type Description Default
api_key_id int

ID of the API key to delete.

required

Returns:

Name Type Description
dict

API response (usually empty with 204 status).

Source code in nukiwebapi/api_key.py
45
46
47
48
49
50
51
52
53
54
55
56
def delete_api_key(self, api_key_id: int):
    """Delete an API key.

    DELETE /api/key/{apiKeyId}

    Args:
        api_key_id (int): ID of the API key to delete.

    Returns:
        dict: API response (usually empty with 204 status).
    """
    return self.client._request("DELETE", f"/api/key/{api_key_id}")

Get details of an advanced API key.

GET /api/key/{apiKeyId}/advanced

Parameters:

Name Type Description Default
api_key_id int

ID of the advanced API key.

required

Returns:

Name Type Description
dict

Advanced API key object.

Source code in nukiwebapi/api_key.py
59
60
61
62
63
64
65
66
67
68
69
70
def get_advanced_api_key(self, api_key_id: int):
    """Get details of an advanced API key.

    GET /api/key/{apiKeyId}/advanced

    Args:
        api_key_id (int): ID of the advanced API key.

    Returns:
        dict: Advanced API key object.
    """
    return self.client._request("GET", f"/api/key/{api_key_id}/advanced")

Create an advanced API key.

PUT /api/key/{apiKeyId}/advanced

Parameters:

Name Type Description Default
api_key_id int

ID of the base API key.

required
key_data dict

Data for creating the advanced API key.

required

Returns:

Name Type Description
dict

API response (usually empty with 204 status).

Source code in nukiwebapi/api_key.py
72
73
74
75
76
77
78
79
80
81
82
83
84
def create_advanced_api_key(self, api_key_id: int, key_data: dict):
    """Create an advanced API key.

    PUT /api/key/{apiKeyId}/advanced

    Args:
        api_key_id (int): ID of the base API key.
        key_data (dict): Data for creating the advanced API key.

    Returns:
        dict: API response (usually empty with 204 status).
    """
    return self.client._request("PUT", f"/api/key/{api_key_id}/advanced", json=key_data)

Update an advanced API key.

POST /api/key/{apiKeyId}/advanced

Parameters:

Name Type Description Default
api_key_id int

ID of the advanced API key.

required
key_data dict

Update data.

required

Returns:

Name Type Description
dict

API response (usually empty with 204 status).

Source code in nukiwebapi/api_key.py
86
87
88
89
90
91
92
93
94
95
96
97
98
def update_advanced_api_key(self, api_key_id: int, key_data: dict):
    """Update an advanced API key.

    POST /api/key/{apiKeyId}/advanced

    Args:
        api_key_id (int): ID of the advanced API key.
        key_data (dict): Update data.

    Returns:
        dict: API response (usually empty with 204 status).
    """
    return self.client._request("POST", f"/api/key/{api_key_id}/advanced", json=key_data)

Delete an advanced API key.

DELETE /api/key/{apiKeyId}/advanced

Parameters:

Name Type Description Default
api_key_id int

ID of the advanced API key.

required

Returns:

Name Type Description
dict

API response (usually empty with 204 status).

Source code in nukiwebapi/api_key.py
100
101
102
103
104
105
106
107
108
109
110
111
def delete_advanced_api_key(self, api_key_id: int):
    """Delete an advanced API key.

    DELETE /api/key/{apiKeyId}/advanced

    Args:
        api_key_id (int): ID of the advanced API key.

    Returns:
        dict: API response (usually empty with 204 status).
    """
    return self.client._request("DELETE", f"/api/key/{api_key_id}/advanced")

Reactivate a deactivated advanced API key.

POST /api/key/{apiKeyId}/advanced/reactivate

Parameters:

Name Type Description Default
api_key_id int

ID of the advanced API key.

required

Returns:

Name Type Description
dict

API response (usually empty with 204 status).

Source code in nukiwebapi/api_key.py
113
114
115
116
117
118
119
120
121
122
123
124
def reactivate_advanced_api_key(self, api_key_id: int):
    """Reactivate a deactivated advanced API key.

    POST /api/key/{apiKeyId}/advanced/reactivate

    Args:
        api_key_id (int): ID of the advanced API key.

    Returns:
        dict: API response (usually empty with 204 status).
    """
    return self.client._request("POST", f"/api/key/{api_key_id}/advanced/reactivate")

List all tokens for a given API key.

GET /api/key/{apiKeyId}/token

Parameters:

Name Type Description Default
api_key_id int

ID of the API key.

required

Returns:

Type Description

list[dict]: List of API key token objects.

Source code in nukiwebapi/api_key.py
127
128
129
130
131
132
133
134
135
136
137
138
def list_api_key_tokens(self, api_key_id: int):
    """List all tokens for a given API key.

    GET /api/key/{apiKeyId}/token

    Args:
        api_key_id (int): ID of the API key.

    Returns:
        list[dict]: List of API key token objects.
    """
    return self.client._request("GET", f"/api/key/{api_key_id}/token")

Create a token for a given API key.

PUT /api/key/{apiKeyId}/token

Parameters:

Name Type Description Default
api_key_id int

ID of the API key.

required
token_data dict

Data for the new token.

required

Returns:

Name Type Description
dict

Created API key token object.

Source code in nukiwebapi/api_key.py
140
141
142
143
144
145
146
147
148
149
150
151
152
def create_api_key_token(self, api_key_id: int, token_data: dict):
    """Create a token for a given API key.

    PUT /api/key/{apiKeyId}/token

    Args:
        api_key_id (int): ID of the API key.
        token_data (dict): Data for the new token.

    Returns:
        dict: Created API key token object.
    """
    return self.client._request("PUT", f"/api/key/{api_key_id}/token", json=token_data)

Update an API key token.

POST /api/key/{apiKeyId}/token/{id}

Parameters:

Name Type Description Default
api_key_id int

ID of the API key.

required
token_id str

ID of the token.

required
token_data dict

Update data.

required

Returns:

Name Type Description
dict

API response (usually empty with 204 status).

Source code in nukiwebapi/api_key.py
154
155
156
157
158
159
160
161
162
163
164
165
166
167
def update_api_key_token(self, api_key_id: int, token_id: str, token_data: dict):
    """Update an API key token.

    POST /api/key/{apiKeyId}/token/{id}

    Args:
        api_key_id (int): ID of the API key.
        token_id (str): ID of the token.
        token_data (dict): Update data.

    Returns:
        dict: API response (usually empty with 204 status).
    """
    return self.client._request("POST", f"/api/key/{api_key_id}/token/{token_id}", json=token_data)

Delete an API key token.

DELETE /api/key/{apiKeyId}/token/{id}

Parameters:

Name Type Description Default
api_key_id int

ID of the API key.

required
token_id str

ID of the token.

required

Returns:

Name Type Description
dict

API response (usually empty with 204 status).

Source code in nukiwebapi/api_key.py
169
170
171
172
173
174
175
176
177
178
179
180
181
def delete_api_key_token(self, api_key_id: int, token_id: str):
    """Delete an API key token.

    DELETE /api/key/{apiKeyId}/token/{id}

    Args:
        api_key_id (int): ID of the API key.
        token_id (str): ID of the token.

    Returns:
        dict: API response (usually empty with 204 status).
    """
    return self.client._request("DELETE", f"/api/key/{api_key_id}/token/{token_id}")