You're reading the docs for v1.5.0, which isn't released yet. Commands here pull :edge, the newest pre-release build. Go to the current release (v1.4.0) →
Reference › Python SDK

Python SDK

A typed client for the REST API.

pip install "uptimer-python-sdk>=1.5.0"      # or: uv add "uptimer-python-sdk>=1.5.0"

The SDK version tracks the server it targets. 1.5.x speaks to uptimer 1.5.0 and later; patch numbers move independently. So install the SDK whose major.minor matches your server — no compatibility table to look up.

Still on API v1? Pin uptimer-python-sdk<1. The server’s v1 is unchanged and supported, so 0.4.x keeps working — it just cannot use anything below.

Quick start

from uptimer.client import UptimerClient

client = UptimerClient(api_key="…", base_url="http://localhost:2517/api")

# Optional, but it fails with a message that names the fix rather than a 404
# on your first real call.
print(client.check_compatibility())

ws = client.workspaces.all()[0]
print(client.monitoring.websites.all(ws.id))

For the hosted product use UptimerCloudClient(api_key="…").

What is available

The client mirrors API v2:

Website monitoring sits under client.monitoring because it is a built-in template, not the general monitor model.

Create website monitoring

from uptimer.models import (
    AGREEMENT_MAJORITY, CreateWebsiteMonitorRequest,
    WebsiteMonitorRequest, WebsiteMonitorResponse, WebsiteMonitorResponseBody,
)

locations = [loc.name for loc in client.locations.all()]   # names on this instance
monitor = client.monitoring.websites.create(CreateWebsiteMonitorRequest(
    name="home",
    interval=60,
    workspace_id=ws.id,
    request=WebsiteMonitorRequest(url="https://example.com", method="GET"),
    response=WebsiteMonitorResponse(
        statuses=[200], body=WebsiteMonitorResponseBody(content=""),
    ),
    locations=locations[:1],
    agreement=AGREEMENT_MAJORITY,   # "any" | "majority" | "all"
))
print(monitor.locations)            # ["local"]

Assign locations with the locations field (names, as listed by client.locations.all()). A monitor with none is never checked and stays at no data. On update the list replaces the stored one.

Omitting agreement on update keeps the stored value — it is not reset to the default.

Read what is wrong

for incident in client.incidents.all(ws.id):
    print(incident.monitor_name, incident.status, incident.locations.failing)

status carries the same words the dashboard shows. pending is the one to watch: the monitor is failing but still inside the confirm hold, so nobody has been notified yet.

Errors

Migrating from 0.4.x

0.4.x (API v1)1.5.0 (API v2)
client.v1.workspacesclient.workspaces
client.v1.regionsclient.locations
client.v1.rulesclient.monitoring.websites
RegionLocation
Rule / CreateRuleRequestWebsiteMonitor / CreateWebsiteMonitorRequest
regions=[...]locations=[...]
agreement=..., client.incidents

Source and releases on PyPI and GitHub.