All jobs

How Do I Find Which Customers' Webhook Endpoints Keep Failing? A Weekly Report From Axiom for a SaaS Customer-Success Team

A booking API company runs an agent each week that queries its webhook delivery logs in Axiom and lists customers whose endpoints keep failing, with a draft note.

Run this on RushOpens the console with this prompt ready to send. Connect Axiom there first.

What the agent does

This is for a SaaS company that sells an appointment-booking API to clinics' software vendors, gyms' membership apps and salon platforms. Every booking, cancellation and reschedule is sent to the customer's server as a webhook, and the company's delivery service logs each attempt to an Axiom dataset: the customer, the endpoint URL, the event type, the HTTP status, the attempt number and any connection error. When a customer's endpoint starts failing, their app quietly stops seeing bookings, and the first sign is an angry support ticket weeks later. The customer-success team wants a list every Monday of who is failing, so they can warn them first.

The platform lead connects Axiom once with POST /me/connections {"type": "mcp", "name": "axiom", "url": "https://mcp.axiom.co/mcp", "auth": {"mode": "oauth"}} and signs in on Axiom's page. Axiom's docs recommend OAuth for remote agents, say the agent never sees the tokens, and say query cost limits can cap an agent's hourly and daily query spend, set on the person's roles with OAuth. The company gives the role it uses here read access to the delivery dataset and a modest cost limit.

On a run the agent calls listDatasets to find webhook-deliveries and getDatasetFields to confirm the field names before it writes a query, since a renamed field would otherwise return empty results that look like good news. It then runs queryDataset with an APL query that summarizes the last seven days by customer and endpoint: total attempts, attempts that ended in a 4xx, a 5xx, a timeout or a connection error, the first and last failure, and the most common error. A second query does the same for the week before, so the report can say whether a customer is new to the list or has been failing for two weeks.

Axiom's docs say formatted query results are capped at a number of table cells, 1,000 by default, so the agent does the counting in APL with summarize and keeps only endpoints with at least 20 failed attempts and a failure rate above 10 percent, rather than pulling raw rows. For each customer on the list it writes what the logs show in plain words ("your endpoint returned 401 Unauthorized to 412 of 430 deliveries since Tuesday") and a short draft note the customer-success manager can send, and it calls queryDataset with saveResults set to true on the main query, so the report links to the saved results in Axiom.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Weekly webhook failure report, for the 7 days ending 2026-11-23T08:00:00Z. Use the axiom connection. Call listDatasets and getDatasetFields for 'webhook-deliveries'; confirm the fields customer_id, customer_name, endpoint_url, event_type, status_code, attempt, error_kind exist, and stop with a message if any is missing. With queryDataset, run APL that summarizes by customer_id, customer_name, endpoint_url: attempts=count(), failed=countif(status_code >= 400 or isnotempty(error_kind)), by status class (4xx, 5xx, timeout, connection), first_failure=minif(_time, failed), last_failure=maxif(_time, failed), top error; keep rows with failed >= 20 and failed * 1.0 / attempts > 0.1. Run it with saveResults true and keep the link. Run the same query for the 7 days before and mark each customer new or continuing. Write webhook-failures.md: one section per customer, worst first, with endpoint, attempts, failed, failure rate, the status classes, first and last failure, the top error in plain words, new or continuing, and a 3-sentence draft note to the customer that states only what the logs show. Read only: do not create, change or delete any dataset, dashboard, monitor or notifier, and do not send anything.",
  "connections": [
    "axiom"
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

The session's artifacts hold webhook-failures.md: one section per failing customer, worst first, with the endpoint, the attempts and failures over the week, the failure rate by status class, when the failures started and last happened, the most common error in plain words, whether the customer is new to the list, and a three-sentence draft note. The top of the file links to the saved query results in Axiom, so an engineer can open the same numbers and drill in.

What the customer-success manager checks before sending a note: the account's own history, since a customer who told the company they were migrating servers is expected to fail for a day; the error itself, because a 401 usually means the customer rotated their signing secret, a 404 a moved URL, and a timeout their own server's load; and whether an engineer should talk to the customer instead. The notes are drafts. The manager sends them from the company's own email after reading them.

Run it on every Monday morning

In the console, a Project automation with a schedule trigger at 0 8 * * 1 and the team's timezone runs a saved agent whose connections name axiom, with the dataset, fields and thresholds above in its instructions. A schedule fills no dates into the prompt, so the instructions say "the seven days before this run, and the seven before those".

A company that wants to hear sooner about its largest accounts can add an Axiom monitor on the same dataset and have its notifier call a small handler on the company's server, which starts one POST /o/{org}/sessions for that customer with a request_id that is a UUID v5 of the monitor id and the alert time, so a repeated alert does not start a second run.

The use case this job follows, with its automation and trigger: Produce a report or file, no repo.

Why run it on Rush?

The Axiom sign-in stays in Rush's connection, under a role whose access and query cost the company chose, rather than in a personal access token in a cron script on someone's server. Each run has its own computer and a record of every APL query it ran, so when a customer disputes a note ("we never had an outage"), the team opens that Monday's session and sees the exact query and time window behind the number.

The weekly list is a handful of aggregate queries and some careful writing per customer, which takes an afternoon by hand and is easy to skip in a busy week. The session records its total_cost_usd, which the company can set against one prevented churned account.

Frequently asked questions

What if our delivery logs live in another dataset or use other field names?

Name them in the prompt. The agent checks the fields with getDatasetFields before querying and stops with a message when one is missing, so a renamed field makes the run fail loudly instead of reporting that every customer is fine.

Can the agent email the customers directly?

It is not given an email connection here, on purpose. A note telling a customer their integration is broken lands better from the person who manages the account, and some customers will already have a ticket open. The draft saves the manager the writing; sending stays with them.

Will the weekly queries use up our Axiom query budget?

Two summarized queries over a week of one dataset are small next to dashboards that refresh all day, but the cost depends on the dataset's size. Axiom's docs describe query cost limits per role for agents, so the company can cap what this connection may spend.

Can it also find customers whose webhooks are slow but not failing?

Yes, if the delivery service logs the response time. The prompt adds a duration percentile per endpoint, such as the 95th, and a threshold, and the report gains a second section for endpoints that answer but slowly, which often fail next.

More Axiom jobs

More jobs like this: Produce a report or file, no repo

Keep reading