DevHelm Python SDK
Typed Python client for the DevHelm monitoring API — monitors, incidents, alerting, and more.
Installation
pip install devhelm
Quick Start
from devhelm import Devhelm
client = Devhelm(token="your-api-token")
# List all monitors
monitors = client.monitors.list()
for m in monitors:
print(f"{m.name} — {m.type}")
# Create a monitor
monitor = client.monitors.create({
"name": "My API Health",
"type": "HTTP",
"config": {"url": "https://api.example.com/health", "method": "GET"},
"frequencySeconds": 60,
"regions": ["us-east"],
# `managedBy` records who reconciles drift on this resource. Use
# "DASHBOARD" (the default for one-off SDK scripts), "CLI" if the
# monitor lives in a `devhelm.yml` you re-deploy, or "TERRAFORM"
# if it lives in `.tf` you re-apply.
"managedBy": "DASHBOARD",
})
# Get a single monitor
monitor = client.monitors.get(monitor.id)
# Inbound testing. `webhooks` stays outbound alert delivery.
inbox = client.inboxes.create(name="stripe")
event = inbox.wait(timeout_ms=30_000, http={"method": "POST"})
payment = event.json()
raw = event.raw()
to = client.email.address(label="signup")
message = to.wait(timeout_ms=60_000, subject_contains="code")
code = message.otp[0].value if message.otp else None
pdf = message.attachments[0].bytes() if message.attachments else None
# Pause / resume
client.monitors.pause(monitor.id)
client.monitors.resume(monitor.id)
# Delete
client.monitors.delete(monitor.id)
Configuration
from devhelm import Devhelm
client = Devhelm(
token="your-api-token", # required (or DEVHELM_API_TOKEN env var)
org_id="1", # optional — see notes below
workspace_id="1", # optional — see notes below
base_url="https://api.devhelm.io", # optional, defaults to production
)
Environment variables are used as fallbacks when constructor arguments are not provided:
| Parameter | Required | Env Variable | Notes |
|---|---|---|---|
token |
Yes | DEVHELM_API_TOKEN |
Personal or workspace API token. |
org_id |
No | DEVHELM_ORG_ID |
Auto-resolved if your token is scoped to one org. Required only when the token has access to multiple. |
workspace_id |
No | DEVHELM_WORKSPACE_ID |
Auto-resolved if your token is scoped to one workspace. Required only when the token spans multiple. |
Resources
The client exposes the following resource modules:
| Resource | Description |
|---|---|
client.monitors |
HTTP, DNS, TCP, ICMP, MCP, and Heartbeat monitors |
client.incidents |
Manual and auto-detected incidents |
client.alert_channels |
Slack, email, webhook, and other alert channels |
client.notification_policies |
Routing rules for alerts |
client.environments |
Environment grouping (prod, staging, etc.) |
client.secrets |
Encrypted secrets for monitor auth |
client.tags |
Organize monitors with tags |
client.resource_groups |
Logical resource groups |
client.webhooks |
Outgoing webhook endpoints |
client.inboxes |
Inbound HTTP capture URLs |
client.email |
Inbound mailboxes and custom domains |
client.api_keys |
API key management |
client.dependencies |
Service dependency tracking |
client.deploy_lock |
Deploy lock for safe deployments |
client.services |
Status Data catalog: vendor services, components, incidents, uptime |
client.status |
Dashboard overview |
Pagination
List methods auto-paginate by default. For manual page control:
# Auto-paginate (fetches all pages)
all_monitors = client.monitors.list()
# Manual page control
page = client.monitors.list_page(page=0, size=20)
print(page.data) # list of monitors
print(page.has_next) # True if more pages
print(page.has_prev) # True if previous page exists
# Cursor pagination (for check results)
results = client.monitors.results(monitor_id, limit=50)
print(results.data)
print(results.next_cursor)
print(results.has_more)
Error Handling
The SDK raises three top-level error types (see
040-codegen-policies.md):
DevhelmValidationError— local request/response shape validation failed.DevhelmApiError— the API returned a non-2xx status. Subclassed by HTTP class for ergonomics:DevhelmAuthError(401/403),DevhelmNotFoundError(404),DevhelmConflictError(409),DevhelmRateLimitError(429),DevhelmServerError(5xx).DevhelmTransportError— the request never reached a server response (connection refused, timeout, TLS failure, etc.).
Every DevhelmApiError carries:
status— the HTTP status codecode— coarse machine-readable category (e.g.NOT_FOUND,RATE_LIMITED); switch on this, not the human-readablemessagerequest_id— the per-request id from theX-Request-Idresponse header; always include this in support tickets
from devhelm import Devhelm, DevhelmAuthError, DevhelmError
client = Devhelm(token="bad-token")
try:
client.monitors.list()
except DevhelmAuthError as e:
print(f"Auth failed: {e.message} (HTTP {e.status}, request_id={e.request_id})")
except DevhelmError as e:
print(f"API error [{e.code}]: {e.message}")
Development
# Install dependencies
uv sync
# Run tests
make test
# Lint + format check
make lint
# Type check
make typecheck
# Regenerate types from OpenAPI spec
make typegen
License
MIT
Metadata
Release files for devhelm 1.12.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| devhelm-1.12.0.tar.gz | 349.6 kB | Without provenance | Details for devhelm-1.12.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| devhelm-1.12.0-py3-none-any.whl | Python 3 | none | any | Details for devhelm-1.12.0-py3-none-any.whl |
Total release size: 479.0 kB
Release files / devhelm-1.12.0.tar.gz
| Download URL | devhelm-1.12.0.tar.gz |
|---|---|
| Size | 349.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
310e12ed39ecd8b432d5a64ec1208c117fd3c52ddfaabfa0f7b71bcb41f3b8dd
|
|
BLAKE2b-256 checksum How to use checksums |
6327063596f8f6f8e9683e74a9b2e03c6bc19d3f71fbb59ad02a8aafa67dc9e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.15
|
Release files / devhelm-1.12.0-py3-none-any.whl
| Download URL | devhelm-1.12.0-py3-none-any.whl |
|---|---|
| Size | 129.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf8d358eaa02abfa8325f1c03f70f2c84ec83497d0b19041113cb6582e631976
|
|
BLAKE2b-256 checksum How to use checksums |
3dea3665cce316cb1720d4a1027b1cb6f2c1ca1a47c90c1faa8adb62ea793120
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.15
|
Security for devhelm 1.12.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.