Skip to main content

Pathly Python SDK

English · Français · Español

Powered by Pathly Website API docs Start free

Get started in one click. Create a free account on Pathly (sign up), create an API key in the console, then export PATHLY_API_TOKEN. This project is the official bridge to Pathly monitoring — real-browser and HTTP checks for checkout, login and availability, with data hosted in the EU. Full API reference: pathlyhq.com/en/developers.

Official Python client for the Pathly public /v1 API. Manage HTTP monitoring scenarios, maintenance windows, signed outbound webhooks and SLA targets from scripts, CI jobs and automations.

pip install pathly
export PATHLY_API_TOKEN="sp_…"
from pathly import Client, ScenarioInput

client = Client()  # reads PATHLY_API_TOKEN
scenario = client.create_scenario(
    ScenarioInput(
        name="Checkout",
        url="https://shop.example.com/cart",
        intervalSec=300,
        expectText="Your cart",
        tags=["prod", "payment"],
    )
)
print(scenario.id)

Authentication

Variable Purpose
PATHLY_API_TOKEN Organization API key (sp_ prefix). Required.
PATHLY_API_URL API base. Defaults to https://api.pathlyhq.com.

Never hard-code the token in source control. Prefer the environment, or a secret store injected at runtime.

Minimum scopes

Method group Scopes
Scenarios scenarios:read, scenarios:write
Webhooks alerting:read, alerting:write
Maintenance windows maintenance:read, maintenance:write
SLA targets sla:read, sla:write

Client.ping() calls /v1/usage and accepts HTTP 403: the key is valid but lacks org:read. That keeps least privilege for scenario-only keys.

What this SDK manages

Resource Methods
Scenario (HTTP) create_scenario, get_scenario, update_scenario, delete_scenario, list_scenarios, mute_scenario
Maintenance window create_maintenance_window, get_maintenance_window, delete_maintenance_window, list_maintenance_windows
Webhook create_webhook, get_webhook, delete_webhook, list_webhooks
SLA target upsert_sla_target, get_sla_target, delete_sla_target, list_sla_targets

Browser journeys are not managed here: their steps carry login credentials that would end up in logs or tickets. Create them in the console.

The webhook secret is returned once at creation time. Store it in a vault immediately. The API never returns the destination URL on read, only urlFingerprint.

Behavior

  • Creates send an Idempotency-Key (auto-generated UUID unless you pass one).
  • HTTP 429 and 5xx honor Retry-After (capped at 90 seconds, four attempts).
  • HTTP 404 raises NotFoundError (is_not_found(err) helper).
  • Zero third-party runtime dependencies (stdlib only).

Development

python -m pip install -e ".[dev]"
pytest

Coverage is required at 100% (--cov-fail-under=100).

Package Role
pathly-terraform-provider Terraform / OpenTofu
pathly-ansible Ansible Galaxy pathlyhq.pathly
pathly-sdk-typescript @pathlyhq/sdk
pathly-pulumi Pulumi
pathly-crossplane Crossplane
pathly-cdktf CDK for Terraform

API reference: pathlyhq.com/en/developers.

About Pathly

Pathly is synthetic monitoring for agencies and e-commerce: replay the customer journey, catch broken checkouts before your clients call, and keep evidence (screenshot, step, runbook) ready for the invoice. Product: pathlyhq.com · Developers: pathlyhq.com/en/developers · Status & pricing: pathlyhq.com/en/pricing.

Author

Company Pathly
Author Simon Raynaud / keyral

See AUTHORS.

License

Apache-2.0

Metadata

Release files for pathly 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pathly 0.1.0
File Size Uploaded
pathly-0.1.0.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pathly 0.1.0
File Interpreter ABI Platform
pathly-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / pathly-0.1.0.tar.gz

Download URL pathly-0.1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5da542bc06efa2917c3114a5847370629014911f09e442671203ee77136c08b0
BLAKE2b-256 checksum
How to use checksums
90db162cb6e0e63d3df2d2b2fd5030d6e2bf5a070ce3308cddbb52cdcb2be760
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / pathly-0.1.0-py3-none-any.whl

Download URL pathly-0.1.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56fbd294f5dbd60726144f4e7663a83b53ddc8e931fe60ce6878582cc22bb076
BLAKE2b-256 checksum
How to use checksums
8a8e34547355ebb93dfd4da6ad00d6ccf956ece74308183cb20c1d50f06d8273
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page