Official Python SDK for Hookfreight.
Capture, inspect, replay, and reliably deliver webhooks with full visibility.
pip install hookfreightfrom hookfreight import Hookfreight
hf = Hookfreight(api_key="hf_sk_...")
result = hf.deliveries.list({"limit": 10})
print(result["deliveries"])from hookfreight import Hookfreight
hf = Hookfreight(base_url="http://localhost:3030/api/v1")| Option | Type | Default | Description |
|---|---|---|---|
api_key |
str |
— | API key for Hookfreight Cloud. Optional for self-hosted. |
base_url |
str |
https://api.hookfreight.com/v1 |
Base URL of the API. Override for self-hosted. |
timeout |
int |
30000 |
Request timeout in milliseconds. |
from hookfreight import Hookfreight
hf = Hookfreight(api_key="hf_sk_...")
app = hf.apps.create({"name": "My App"})
endpoint = hf.endpoints.create({
"name": "Stripe",
"app_id": app["id"],
"forward_url": "https://example.com/webhooks/stripe",
})
event = hf.events.get("evt_...")
print(event["body"])
stats = hf.deliveries.queue_stats()
print(stats)from hookfreight import Hookfreight, NotFoundError, ValidationError, ConnectionError
hf = Hookfreight(api_key="hf_sk_...")
try:
hf.apps.get("app_nonexistent")
except NotFoundError:
print("App not found")
except ValidationError as err:
print(err.errors)
except ConnectionError as err:
print(err)examples/basic_usage.pyexamples/manage_endpoints.pyexamples/retry_failed_deliveries.pyexamples/monitor_queue.py
Run an example:
HOOKFREIGHT_API_KEY=hf_sk_... python examples/basic_usage.pyApache-2.0