Setu Recipes: reusable workflows across every app.Browse templates

Integrations / PagerDuty

PagerDuty

Incident response: see incidents, services and who is on call.

6 actions OAuth 2 6 read0 write Calls api.pagerduty.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "pagerduty" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

ScopeWhy it is requested
users.readIdentify the connected PagerDuty user
incidents.readRead incidents and their notes
services.readRead services
oncalls.readSee who is on call

Actions

Get incidentreadpagerduty.get_incidentGet one incident by id: title, status, urgency, service and link.

Needs scope: incidents.read

InputTypeDescription
idstringRequiredIncident id, e.g. PT4KHLK
TypeScript
await setu.execute({
  userId: "user_1",
  action: "pagerduty.get_incident",
  input: {
    "id": "<id>"
  },
});
Get servicereadpagerduty.get_serviceGet one service by id: name, description, status and link.

Needs scope: services.read

InputTypeDescription
idstringRequiredService id, e.g. PIJ90N7
TypeScript
await setu.execute({
  userId: "user_1",
  action: "pagerduty.get_service",
  input: {
    "id": "<id>"
  },
});
List incident notesreadpagerduty.list_incident_notesList the notes added to an incident, with the text and time of each.

Needs scope: incidents.read

InputTypeDescription
idstringRequiredIncident id
TypeScript
await setu.execute({
  userId: "user_1",
  action: "pagerduty.list_incident_notes",
  input: {
    "id": "<id>"
  },
});
List incidentsreadpagerduty.list_incidentsList incidents, newest first, optionally filtered by status, service and time range (default last month, max 6 months). Returns ids, titles, statuses and services.

Needs scope: incidents.read

InputTypeDescription
statusstringOptionalOnly incidents with this status
service_idstringOptionalOnly incidents of this service id
sincestringOptionalStart of the time range, ISO 8601
untilstringOptionalEnd of the time range, ISO 8601
limitintegerOptionalResults per page, up to 100
TypeScript
await setu.execute({
  userId: "user_1",
  action: "pagerduty.list_incidents",
  input: {},
});
List on-callsreadpagerduty.list_oncallsList who is on call now (or in a time range), with the escalation policy, level and schedule. Optionally filter by escalation policy or schedule id.

Needs scope: oncalls.read

InputTypeDescription
escalation_policy_idstringOptionalOnly on-calls for this escalation policy id
schedule_idstringOptionalOnly on-calls for this schedule id
sincestringOptionalStart of the range, ISO 8601; defaults to now
untilstringOptionalEnd of the range, ISO 8601
TypeScript
await setu.execute({
  userId: "user_1",
  action: "pagerduty.list_oncalls",
  input: {},
});
List servicesreadpagerduty.list_servicesList services in the PagerDuty account, optionally filtered by name. Returns ids, names and statuses.

Needs scope: services.read

InputTypeDescription
querystringOptionalOnly services whose name matches this text
limitintegerOptionalResults per page, up to 100
TypeScript
await setu.execute({
  userId: "user_1",
  action: "pagerduty.list_services",
  input: {},
});