Skip to content

Get Notified When Your Agent Fails

Push error alerts to Slack, Discord, or any HTTP endpoint. Stop babysitting your agents.

Your agent runs in production. You can’t watch an SSE stream all day. When something breaks, you need a push notification — a Slack message, a Discord alert, a PagerDuty trigger.

from axonpush import AxonPush
with AxonPush(api_key="ak_...", tenant_id="1", base_url="https://api.axonpush.xyz") as client:
endpoint = client.webhooks.create_endpoint(
url="https://your-server.com/webhook",
channel_id=1,
event_types=["agent.error"],
secret="whsec_your_signing_secret",
description="Slack alert on agent errors",
)
print(f"Webhook {endpoint.id} active: {endpoint.active}")
deliveries = client.webhooks.get_deliveries(endpoint_id=endpoint.id)
for d in deliveries:
print(f" Delivery {d.id}: {d.status} (HTTP {d.status_code})")
  • create_endpoint() registers a URL that axonpush POSTs to whenever a matching event is published.
  • event_types=["agent.error"] filters to only fire on error events.
  • The secret enables HMAC signature verification.
  • get_deliveries() returns delivery attempts with status (pending, success, failed, retrying).
  • Failed deliveries are retried automatically.
Go Deeper
endpoint = client.webhooks.create_endpoint(
url="https://your-server.com/webhook",
channel_id=1,
event_types=["agent.error", "agent.handoff", "agent.end"],
description="Alert on errors, handoffs, and completions",
)
deliveries = client.webhooks.get_deliveries(endpoint_id=endpoint.id)
for d in deliveries:
if d.status == "failed":
print(f"Failed delivery {d.id}: {d.error}")
print(f" Attempts: {d.attempts}, Last status: {d.status_code}")
endpoints = client.webhooks.list_endpoints(channel_id=1)
for ep in endpoints:
print(f"{ep.id}: {ep.url} — active={ep.active}")
client.webhooks.delete_endpoint(endpoint_id=endpoint.id)