PagerDuty API: The Routing Key, Not the Token
PagerDuty is two APIs on two hosts, each with its own authentication. The video walks through which credential goes where, a quick sanity check, and several details that trip people up when connecting Claude to PagerDuty.
A common assumption is that one PagerDuty credential handles everything, so triggering an alert is just a matter of using your API token. This video, from the Claude Basics playlist and focused on a Claude Tag plugin for the PagerDuty API, shows why that assumption fails. Triggering runs through a separate routing key sent in the request body, with no token involved.
Two APIs, two hosts, two auth schemes
PagerDuty splits into two separate APIs on two different hosts. The REST API lives at api.pagerduty.com and handles everything you read and manage: schedules, services, escalation policies, incidents, and users. It authenticates with an Authorization header that reads "Token" followed by the key. The video stresses that it is not "Bearer".
Events v2 lives at events.pagerduty.com and handles the alert life cycle: triggering, acknowledging, and resolving. It authenticates with a routing key sent in the request body, and it sends no Authorization header at all.
How an alert becomes a record
The video also sketches what happens under the hood. An alert fires on a service, which routes through an escalation policy to specific schedules and users, opening an incident. Every notification along the way is logged, and that log is the actual record of who got paged and why. This is why the REST API and its token still matter: they are how you look up who is on call or trace an incident.
A sanity check before touching data
Before reading or changing anything, the video recommends checking your credentials with a sanity call: a GET to the v1 user "me" endpoint using the token header. A 200 means the credentials work. A 401 comes back with an empty body, so curl shows you nothing unless you print the HTTP status explicitly, for example with the write-out option.
The From header for writes
Once you move from reading to writing, every mutation needs a From header containing a real email address. That includes triggering, acknowledging, and resolving. Leave it off and you get a 400 that looks like it came from nowhere.
More details worth knowing
The video lists several further points:
- Raw curl calls to the on-calls endpoint need the globbing-off flag, because the filters get mangled otherwise. The bundled on-call shell script already handles that.
- Any object you reference in a request body, such as a service or an escalation policy, needs both an ID and a type field, or you get a 400 naming the missing one.
- Events v2 error responses come back as plain text rather than JSON, so piping them through jq breaks immediately.
- The two APIs are rate limited differently. The REST API allows 960 requests a minute and gives headers you can watch. Events v2 has no such per-request header.
The short version
The REST API reads and manages everything with a Token header. Events v2 triggers, acknowledges, and resolves alerts with a routing key in the body and no token at all. Mix the two up and you do not get an error message. You get an empty one.
Key takeaways
- PagerDuty is two APIs on two hosts: api.pagerduty.com and events.pagerduty.com.
- The REST API uses an Authorization header of the form "Token", not "Bearer".
- Events v2 uses a routing key in the request body and no Authorization header.
- A 401 from the REST API arrives with an empty body, so print the HTTP status to see it.
- Every mutation needs a From header with a real email address.
- Referenced objects need both an ID and a type field.
- Events v2 errors are plain text, and the two APIs have different rate limits.
Try it yourself
Paste a prompt asking Claude to plan three PagerDuty tasks: checking who is on call, triggering a test alert, and looking up why an incident paged someone. Ask it to name the API, the host, and the exact authentication for each one before it writes any code. You can check the reasoning without a live PagerDuty account.
Chapters
Full transcript(auto-generated, with timestamps)
The naive framing: "Can Claude trigger an alert with my API TOKEN?"
[0:00]Someone assumes one PagerDuty credential handles everything trigger an alert just use your API token. It doesn't. Triggering runs through a separate routing key in the request body, no token involved. So, what's the difference? PagerDuty splits into two
Two APIs, two auth schemes
[0:14]Separate APIs on two different hosts, each with its own way of authenticating. The REST API at api.pagerduty.com handles everything you read and manage schedules, services, escalation policies, incidents, users. It authenticates with an authorization header reading token then key not bearer not events V2 at events.pagerduty.com handles the alert life cycle instead triggering, acknowledging, resolving. It authenticates with a routing key sent in the request body and sends no authorization header at all. Under the hood an alert fires on a service which routes through an escalation policy to specific schedules and users opening an incident and every notification along the way is logged which is the actual record of who got paged and why. Before
Sanity check, then From
[0:57]Touching any data check your credentials with a sanity call. Get /v1/user/me with that token header. A 200 means you're good. A 401 comes back with an empty body curl shows you nothing unless you print the HTTP status explicitly with -W or -o/dev/null-W. And once you start writing not just reading every mutation triggering acknowledging resolving needs a from header with a real email address. Leave it off and you get a 400 that looks like it came from nowhere. A few more things
Needs -g, id+type, rate limits differ
[1:26]Worth knowing. Raw curl calls to the /oncalls endpoint -g where the filters get mangled the bundled PD on call. SH script already handles that for you. Any object you reference in a request body a service an escalation policy needs both an ID and a type field or you'll get a 400 naming the missing one. Events V2 error responses come back as plain text not JSON. So, piping them through jq breaks immediately and the two APIs are rate limited differently. REST gives you 960 requests a minute with headers you can watch. Events V2 gives you no such per request header at all. PagerDuty splits in two. The REST API
Carry-out
[2:04]Reads and manages everything with a token header, while Events V2 triggers, acknowledges, and resolves alerts with a routing key in the body. No token there at all. Mix the two up and you won't get an error message, you'll get an empty one.
Your turn
[2:17]Your turn. Here's the prompt, read it with me. I want to connect Claude to PagerDuty. For three tasks, checking who's on call, triggering a test alert, and looking up what an incident page someone, tell me which API you'd call, which host, and exactly how you'd authenticate for each one before you write any code. Liam, in for Bear.
Outro
[2:34]The routing key, not the token. Liam, in for Bear.
More from Claude
2:07Redshift API: 200 Means Accepted, Not "Your Query Worked"
2:25Notion API: The Data Source, Not the Database
2:05Salesforce API: Empty Responses Mean Success, Not Failure
2:29Linear Has No REST API — One GraphQL Endpoint, Two ID Systems
2:44Sentry API: The ID in the URL Isn't the ID Claude Sends
2:13