Skip to content

Service

Get a list of services.

GET /service

Parameters:

Name Type Description Default
service_ids list[str]

Filter for service IDs. Will be joined into a comma-separated string (e.g. ["airbnb", "guesty"]).

None

Returns:

Type Description
list[dict]

list[dict]: List of service objects.

Source code in nukiwebapi/service.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def list_services(self, service_ids: list[str] | None = None) -> list[dict]:
    """Get a list of services.

    GET /service

    Args:
        service_ids (list[str], optional): Filter for service IDs. Will be
            joined into a comma-separated string (e.g. ["airbnb", "guesty"]).

    Returns:
        list[dict]: List of service objects.
    """
    params = {}
    if service_ids:
        params["serviceIds"] = ",".join(service_ids)
    return self.client._request("GET", "/service", params=params or None)

Get a specific service.

GET /service/{serviceId}

Parameters:

Name Type Description Default
service_id str

The service ID.

required

Returns:

Name Type Description
dict dict

A service object containing fields like: - context (dict) - enabled (bool) - started (bool) - stopped (bool)

Source code in nukiwebapi/service.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def get_service(self, service_id: str) -> dict:
    """Get a specific service.

    GET /service/{serviceId}

    Args:
        service_id (str): The service ID.

    Returns:
        dict: A service object containing fields like:
            - context (dict)
            - enabled (bool)
            - started (bool)
            - stopped (bool)
    """
    return self.client._request("GET", f"/service/{service_id}")

Link a service.

POST /service/{serviceId}/link

Parameters:

Name Type Description Default
service_id str

The service ID.

required
data dict

Payload for linking (may be empty).

None

Returns:

Name Type Description
str str

A confirmation message from the API.

Source code in nukiwebapi/service.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def link_service(self, service_id: str, data: dict | None = None) -> str:
    """Link a service.

    POST /service/{serviceId}/link

    Args:
        service_id (str): The service ID.
        data (dict, optional): Payload for linking (may be empty).

    Returns:
        str: A confirmation message from the API.
    """
    return self.client._request(
        "POST", f"/service/{service_id}/link", json=data or {}
    )

Sync a service.

POST /service/{serviceId}/sync

Parameters:

Name Type Description Default
service_id str

The service ID.

required
data dict

Payload for syncing (may be empty).

None

Returns:

Name Type Description
None None

On success, the API returns HTTP 204 (no content).

Source code in nukiwebapi/service.py
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
def sync_service(self, service_id: str, data: dict | None = None) -> None:
    """Sync a service.

    POST /service/{serviceId}/sync

    Args:
        service_id (str): The service ID.
        data (dict, optional): Payload for syncing (may be empty).

    Returns:
        None: On success, the API returns HTTP 204 (no content).
    """
    return self.client._request(
        "POST", f"/service/{service_id}/sync", json=data or {}
    )

Unlink a service.

POST /service/{serviceId}/unlink

Parameters:

Name Type Description Default
service_id str

The service ID.

required
data dict

Payload for unlinking (may be empty).

None

Returns:

Name Type Description
None None

On success, the API returns HTTP 204 (no content).

Source code in nukiwebapi/service.py
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
def unlink_service(self, service_id: str, data: dict | None = None) -> None:
    """Unlink a service.

    POST /service/{serviceId}/unlink

    Args:
        service_id (str): The service ID.
        data (dict, optional): Payload for unlinking (may be empty).

    Returns:
        None: On success, the API returns HTTP 204 (no content).
    """
    return self.client._request(
        "POST", f"/service/{service_id}/unlink", json=data or {}
    )