openapi: 3.0.2
info:
description: 'This document describes the PagerDuty REST APIs.
For guides and examples please visit our [Documentation.](https://developer.pagerduty.com/docs/get-started/getting-started/)
Our REST APIs are defined in OpenAPI v3.x. You can view the schema at [github.com/PagerDuty/api-schema](https://github.com/PagerDuty/api-schema).
Note that properties in some schemas have fields not shown by default such as `readOnly`, `format`, and `default`. Hover your cursor over the right column that looks like `optional+1` to see the full list of fields.
'
contact:
name: PagerDuty Support
url: http://www.pagerduty.com/support
email: support@pagerduty.com
title: PagerDuty Abilities Rulesets API
version: 2.0.0
servers:
- url: https://api.pagerduty.com
description: PagerDuty V2 API.
security:
- api_key: []
tags:
- name: Rulesets
description: 'Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
'
paths:
/rulesets:
description: Create, list, update and delete Rulesets.
get:
x-pd-requires-scope: event_rules.read
tags:
- Rulesets
operationId: listRulesets
description: 'List all Rulesets
<!-- theme: warning -->
> ### End-of-life
> Rulesets and Event Rules will end-of-life soon. We highly recommend that you [migrate to Event Orchestration](https://support.pagerduty.com/docs/migrate-to-event-orchestration) as soon as possible so you can take advantage of the new functionality, such as improved UI, rule creation, APIs and Terraform support, advanced conditions, and rule nesting.
Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
For more information see the [API Concepts Document](../../api-reference/ZG9jOjI3NDc5Nzc-api-concepts#rulesets)
Scoped OAuth requires: `event_rules.read`
'
summary: PagerDuty List Rulesets
parameters:
- $ref: '#/components/parameters/header_Accept'
- $ref: '#/components/parameters/header_Content-Type'
- $ref: '#/components/parameters/offset_limit'
- $ref: '#/components/parameters/offset_offset'
- $ref: '#/components/parameters/offset_total'
responses:
'200':
description: A paginated array of Ruleset objects.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Pagination'
- type: object
properties:
rulesets:
type: array
items:
$ref: '#/components/schemas/Ruleset'
examples:
response:
summary: Response Example
value:
rulesets:
- id: 0e84de00-9511-4380-9f4f-a7b568bb49a0
name: MySQL Clusters
type: global
routing_keys:
- R0212P1QXGEIQE2NMTQ7L7WXD00DWHIN
self: https://api.pagerduty.com/rulesets/0e84de00-9511-4380-9f4f-a7b568bb49a0
created_at: '2019-12-24T21:18:52Z'
creator:
type: user_reference
self: https://api.pagerduty.com/users/PABO808
id: PABO808
updated_at: '2019-12-25T14:54:23Z'
updater:
type: user_reference
self: https://api.pagerduty.com/users/PABO808
id: PABO808
team:
type: team_reference
self: https://api.pagerduty.com/teams/P3ZQXDF
id: P3ZQXDF
limit: 25
offset: 0
more: false
total: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
post:
x-pd-requires-scope: event_rules.write
tags:
- Rulesets
operationId: createRuleset
description: 'Create a new Ruleset.
<!-- theme: warning -->
> ### End-of-life
> Rulesets and Event Rules will end-of-life soon. We highly recommend that you [migrate to Event Orchestration](https://support.pagerduty.com/docs/migrate-to-event-orchestration) as soon as possible so you can take advantage of the new functionality, such as improved UI, rule creation, APIs and Terraform support, advanced conditions, and rule nesting.
Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
For more information see the [API Concepts Document](../../api-reference/ZG9jOjI3NDc5Nzc-api-concepts#rulesets)
Scoped OAuth requires: `event_rules.write`
'
summary: PagerDuty Create a Ruleset
parameters:
- $ref: '#/components/parameters/header_Accept'
- $ref: '#/components/parameters/header_Content-Type'
requestBody:
content:
application/json:
schema:
type: object
properties:
ruleset:
allOf:
- $ref: '#/components/schemas/Ruleset'
- type: object
required:
- name
required:
- ruleset
examples:
request:
summary: Request Example
value:
ruleset:
name: MySQL Clusters
team:
id: PWL7QXS
type: team_reference
responses:
'201':
description: The Ruleset that was created.
content:
application/json:
schema:
type: object
properties:
ruleset:
$ref: '#/components/schemas/Ruleset'
examples:
response:
summary: Response Example
value:
rulesets:
id: 0e84de00-9511-4380-9f4f-a7b568bb49a0
name: MySQL Clusters
type: global
routing_keys:
- R0212P1QXGEIQE2NMTQ7L7WXD00DWHIN
self: https://api.pagerduty.com/rulesets/0e84de00-9511-4380-9f4f-a7b568bb49a0
created_at: '2019-12-24T21:18:52Z'
creator:
type: user_reference
self: https://api.pagerduty.com/users/PABO808
id: PABO808
updated_at: '2019-12-25T14:54:23Z'
updater:
type: user_reference
self: https://api.pagerduty.com/users/PABO808
id: PABO808
team:
type: team_reference
self: https://api.pagerduty.com/teams/P3ZQXDF
id: P3ZQXDF
'400':
$ref: '#/components/responses/ArgumentError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/rulesets/{id}:
description: Manage Rulesets.
get:
x-pd-requires-scope: event_rules.read
tags:
- Rulesets
operationId: getRuleset
description: 'Get a Ruleset.
<!-- theme: warning -->
> ### End-of-life
> Rulesets and Event Rules will end-of-life soon. We highly recommend that you [migrate to Event Orchestration](https://support.pagerduty.com/docs/migrate-to-event-orchestration) as soon as possible so you can take advantage of the new functionality, such as improved UI, rule creation, APIs and Terraform support, advanced conditions, and rule nesting.
Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
For more information see the [API Concepts Document](../../api-reference/ZG9jOjI3NDc5Nzc-api-concepts#rulesets)
Scoped OAuth requires: `event_rules.read`
'
summary: PagerDuty Get a Ruleset
parameters:
- $ref: '#/components/parameters/header_Accept'
- $ref: '#/components/parameters/header_Content-Type'
- $ref: '#/components/parameters/id'
responses:
'200':
description: The Ruleset object.
content:
application/json:
schema:
type: object
properties:
ruleset:
$ref: '#/components/schemas/Ruleset'
examples:
response:
summary: Response Example
value:
ruleset:
id: 0e84de00-9511-4380-9f4f-a7b568bb49a0
name: MySQL Clusters
type: global
routing_keys:
- R0212P1QXGEIQE2NMTQ7L7WXD00DWHIN
self: https://api.pagerduty.com/rulesets/0e84de00-9511-4380-9f4f-a7b568bb49a0
created_at: '2019-12-24T21:18:52Z'
creator:
type: user_reference
self: https://api.pagerduty.com/users/PABO808
id: PABO808
updated_at: '2019-12-25T14:54:23Z'
updater:
type: user_reference
self: https://api.pagerduty.com/users/PABO808
id: PABO808
team:
type: team_reference
self: https://api.pagerduty.com/teams/P3ZQXDF
id: P3ZQXDF
'400':
$ref: '#/components/responses/ArgumentError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
put:
x-pd-requires-scope: event_rules.write
tags:
- Rulesets
operationId: updateRuleset
description: 'Update a Ruleset.
<!-- theme: warning -->
> ### End-of-life
> Rulesets and Event Rules will end-of-life soon. We highly recommend that you [migrate to Event Orchestration](https://support.pagerduty.com/docs/migrate-to-event-orchestration) as soon as possible so you can take advantage of the new functionality, such as improved UI, rule creation, APIs and Terraform support, advanced conditions, and rule nesting.
Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
For more information see the [API Concepts Document](../../api-reference/ZG9jOjI3NDc5Nzc-api-concepts#rulesets)
Scoped OAuth requires: `event_rules.write`
'
summary: PagerDuty Update a Ruleset
parameters:
- $ref: '#/components/parameters/header_Accept'
- $ref: '#/components/parameters/header_Content-Type'
- $ref: '#/components/parameters/id'
requestBody:
content:
application/json:
schema:
type: object
properties:
ruleset:
$ref: '#/components/schemas/Ruleset'
required:
- ruleset
examples:
change_name:
summary: 'Example: Change name'
value:
ruleset:
name: MySQL Clusters
change_team:
summary: 'Example: Change team'
value:
ruleset:
team:
id: PWL7QXS
type: team_reference
responses:
'200':
description: The Ruleset that was updated.
content:
application/json:
schema:
type: object
properties:
ruleset:
$ref: '#/components/schemas/Ruleset'
examples:
response:
summary: Response Example
value:
rulesets:
id: 0e84de00-9511-4380-9f4f-a7b568bb49a0
name: MySQL Clusters
type: global
routing_keys:
- R0212P1QXGEIQE2NMTQ7L7WXD00DWHIN
self: https://api.pagerduty.com/rulesets/0e84de00-9511-4380-9f4f-a7b568bb49a0
created_at: '2019-12-24T21:18:52Z'
creator:
type: user_reference
self: https://api.pagerduty.com/users/PABO808
id: PABO808
updated_at: '2019-12-25T14:54:23Z'
updater:
type: user_reference
self: https://api.pagerduty.com/users/PABO808
id: PABO808
team:
type: team_reference
self: https://api.pagerduty.com/teams/P3ZQXDF
id: P3ZQXDF
'400':
$ref: '#/components/responses/ArgumentError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'405':
$ref: '#/components/responses/NotAllowed'
'409':
$ref: '#/components/responses/Conflict'
delete:
x-pd-requires-scope: event_rules.write
tags:
- Rulesets
operationId: deleteRuleset
description: 'Delete a Ruleset.
<!-- theme: warning -->
> ### End-of-life
> Rulesets and Event Rules will end-of-life soon. We highly recommend that you [migrate to Event Orchestration](https://support.pagerduty.com/docs/migrate-to-event-orchestration) as soon as possible so you can take advantage of the new functionality, such as improved UI, rule creation, APIs and Terraform support, advanced conditions, and rule nesting.
Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
For more information see the [API Concepts Document](../../api-reference/ZG9jOjI3NDc5Nzc-api-concepts#rulesets)
Scoped OAuth requires: `event_rules.write`
'
summary: PagerDuty Delete a Ruleset
parameters:
- $ref: '#/components/parameters/header_Accept'
- $ref: '#/components/parameters/header_Content-Type'
- $ref: '#/components/parameters/id'
responses:
'204':
description: The Ruleset was deleted successfully.
'400':
$ref: '#/components/responses/ArgumentError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'405':
$ref: '#/components/responses/NotAllowed'
'409':
$ref: '#/components/responses/Conflict'
/rulesets/{id}/rules:
description: Create, list, update and delete Event Rules.
get:
x-pd-requires-scope: event_rules.read
tags:
- Rulesets
operationId: listRulesetEventRules
description: 'List all Event Rules on a Ruleset.
<!-- theme: warning -->
> ### End-of-life
> Rulesets and Event Rules will end-of-life soon. We highly recommend that you [migrate to Event Orchestration](https://support.pagerduty.com/docs/migrate-to-event-orchestration) as soon as possible so you can take advantage of the new functionality, such as improved UI, rule creation, APIs and Terraform support, advanced conditions, and rule nesting.
Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
For more information see the [API Concepts Document](../../api-reference/ZG9jOjI3NDc5Nzc-api-concepts#rulesets)
Note: Create and Update on rules will accept ''description'' or ''summary'' interchangeably as an extraction action target. Get and List on rules will always return ''summary'' as the target. If you are expecting ''description'' please change your automation code to expect ''summary'' instead.
Scoped OAuth requires: `event_rules.read`
'
summary: PagerDuty List Event Rules
parameters:
- $ref: '#/components/parameters/header_Accept'
- $ref: '#/components/parameters/header_Content-Type'
- $ref: '#/components/parameters/offset_limit'
- $ref: '#/components/parameters/offset_offset'
- $ref: '#/components/parameters/offset_total'
- $ref: '#/components/parameters/id'
responses:
'200':
description: A paginated array of Event Rule objects.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Pagination'
- type: object
properties:
rules:
type: array
description: The paginated list of rules of the Ruleset.
items:
$ref: '#/components/schemas/EventRule'
examples:
response:
summary: Response Example
value:
rules:
- id: 14e56445-ebab-4dd0-ba9d-fc28a41b7e7b
position: 0
disabled: false
catch_all: false
self: https://api.pagerduty.com/rulesets/0e84de00-9511-4380-9f4f-a7b568bb49a0/rules/14e56445-ebab-4dd0-ba9d-fc28a41b7e7b
conditions:
operator: and
subconditions:
- operator: contains
parameters:
value: mysql
path: details.host
time_frame:
active_between:
start_time: 1577880000000
end_time: 1580558400000
actions:
annotate:
value: This incident was created by a Global Event Rule
route:
value: PI2KBWI
priority:
value: PCMUB6F
severity:
value: warning
extractions:
- target: dedup_key
source: details.error_summary
regex: Host (.*) is experiencing errors
- id: 0d819a5a-b714-4bae-9333-dc73ea0daefb
position: 1
disabled: false
catch_all: true
self: https://api.pagerduty.com/rulesets/0e84de00-9511-4380-9f4f-a7b568bb49a0/rules/0d819a5a-b714-4bae-9333-dc73ea0daefb
actions:
suppress:
value: true
severity: null
route: null
priority: null
extractions: []
event_action: null
annotate: null
limit: 25
offset: 0
more: false
total: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
post:
x-pd-requires-scope: event_rules.write
tags:
- Rulesets
operationId: createRulesetEventRule
description: 'Create a new Event Rule.
<!-- theme: warning -->
> ### End-of-life
> Rulesets and Event Rules will end-of-life soon. We highly recommend that you [migrate to Event Orchestration](https://support.pagerduty.com/docs/migrate-to-event-orchestration) as soon as possible so you can take advantage of the new functionality, such as improved UI, rule creation, APIs and Terraform support, advanced conditions, and rule nesting.
Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
For more information see the [API Concepts Document](../../api-reference/ZG9jOjI3NDc5Nzc-api-concepts#rulesets)
Note: Create and Update on rules will accept ''description'' or ''summary'' interchangeably as an extraction action target. Get and List on rules will always return ''summary'' as the target. If you are expecting ''description'' please change your automation code to expect ''summary'' instead.
Scoped OAuth requires: `event_rules.write`
'
summary: PagerDuty Create an Event Rule
parameters:
- $ref: '#/components/parameters/header_Accept'
- $ref: '#/components/parameters/header_Content-Type'
- $ref: '#/components/parameters/id'
requestBody:
content:
application/json:
schema:
type: object
properties:
rule:
$ref: '#/components/schemas/EventRule'
required:
- rule
examples:
request:
summary: Request Example
value:
rule:
id: 14e56445-ebab-4dd0-ba9d-fc28a41b7e7b
position: 0
disabled: false
catch_all: false
conditions:
operator: and
subconditions:
- operator: contains
parameters:
value: mysql
path: details.host
time_frame:
active_between:
start_time: 1577880000000
end_time: 1580558400000
actions:
annotate:
value: This incident was created by a Global Event Rule
route:
value: PI2KBWI
priority:
value: PCMUB6F
severity:
value: warning
extractions:
- target: dedup_key
source: details.error_summary
regex: Host (.*) is experiencing errors
responses:
'201':
description: The Event Rule that was created.
content:
application/json:
schema:
type: object
properties:
rule:
$ref: '#/components/schemas/EventRule'
examples:
response:
summary: Response Example
value:
ruleset:
id: 14e56445-ebab-4dd0-ba9d-fc28a41b7e7b
position: 0
disabled: false
catch_all: false
self: https://api.pagerduty.com/rulesets/0e84de00-9511-4380-9f4f-a7b568bb49a0/rules/14e56445-ebab-4dd0-ba9d-fc28a41b7e7b
conditions:
operator: and
subconditions:
- operator: contains
parameters:
value: mysql
path: details.host
time_frame:
active_between:
start_time: 1577880000000
end_time: 1580558400000
actions:
annotate:
value: This incident was created by a Global Event Rule
route:
value: PI2KBWI
priority:
value: PCMUB6F
severity:
value: warning
extractions:
- target: dedup_key
source: details.error_summary
regex: Host (.*) is experiencing errors
'400':
$ref: '#/components/responses/ArgumentError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
/rulesets/{id}/rules/{rule_id}:
description: Manage Event Rules.
get:
x-pd-requires-scope: event_rules.read
tags:
- Rulesets
operationId: getRulesetEventRule
description: 'Get an Event Rule.
<!-- theme: warning -->
> ### End-of-life
> Rulesets and Event Rules will end-of-life soon. We highly recommend that you [migrate to Event Orchestration](https://support.pagerduty.com/docs/migrate-to-event-orchestration) as soon as possible so you can take advantage of the new functionality, such as improved UI, rule creation, APIs and Terraform support, advanced conditions, and rule nesting.
Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
For more information see the [API Concepts Document](../../api-reference/ZG9jOjI3NDc5Nzc-api-concepts#rulesets)
Note: Create and Update on rules will accept ''description'' or ''summary'' interchangeably as an extraction action target. Get and List on rules will always return ''summary'' as the target. If you are expecting ''description'' please change your automation code to expect ''summary'' instead.
Scoped OAuth requires: `event_rules.read`
'
summary: PagerDuty Get an Event Rule
parameters:
- $ref: '#/components/parameters/header_Accept'
- $ref: '#/components/parameters/header_Content-Type'
- $ref: '#/components/parameters/id'
- $ref: '#/components/parameters/rule_id'
responses:
'200':
description: The Event Rule object.
content:
application/json:
schema:
type: object
properties:
rule:
$ref: '#/components/schemas/EventRule'
examples:
response:
summary: Response Example
value:
rule:
id: 14e56445-ebab-4dd0-ba9d-fc28a41b7e7b
position: 0
disabled: false
catch_all: false
self: https://api.pagerduty.com/rulesets/0e84de00-9511-4380-9f4f-a7b568bb49a0/rules/14e56445-ebab-4dd0-ba9d-fc28a41b7e7b
conditions:
operator: and
subconditions:
- operator: contains
parameters:
value: mysql
path: details.host
time_frame:
active_between:
start_time: 1577880000000
end_time: 1580558400000
actions:
annotate:
value: This incident was created by a Global Event Rule
route:
value: PI2KBWI
priority:
value: PCMUB6F
severity:
value: warning
extractions:
- target: dedup_key
template: '{{error_level}} error on host {{host}}'
variables:
- name: error_level
type: regex
parameters:
value: .*error level is (\w+)\.
path: payload.summary
- name: host
type: regex
parameters:
value: (.*)-USW2
path: payload.host.human_name
'400':
$ref: '#/components/responses/ArgumentError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
put:
x-pd-requires-scope: event_rules.write
tags:
- Rulesets
operationId: updateRulesetEventRule
summary: PagerDuty Update an Event Rule
description: 'Update an Event Rule. Note that the endpoint supports partial updates, so any number of the writable fields can be provided.
<!-- theme: warning -->
> ### End-of-life
> Rulesets and Event Rules will end-of-life soon. We highly recommend that you [migrate to Event Orchestration](https://support.pagerduty.com/docs/migrate-to-event-orchestration) as soon as possible so you can take advantage of the new functionality, such as improved UI, rule creation, APIs and Terraform support, advanced conditions, and rule nesting.
Rulesets allow you to route events to an endpoint and create collections of Event Rules, which define sets of actions to take based on event content.
For more information see the [API Concepts Document](../../api-reference/ZG9jOjI3NDc5Nzc-api-concepts#rulesets)
Note: Create and Update on rules will accept ''description'' or ''summary'' interchangeably as an extraction action target. Get and List on rules will always return ''summary'' as the target. If you are expecting ''description'' please change your automation code to expect ''summary'' instead.
Scoped OAuth requires: `event_rules.write`
'
parameters:
- $ref: '#/components/parameters/header_Accept'
- $ref: '#/components/parameters/header_Content-Type'
- $ref: '#/components/parameters/id'
- $ref: '#/components/parameters/rule_id'
requestBody:
content:
application/json:
schema:
type: object
properties:
rule:
$ref: '#/components/schemas/EventRule'
rule_id:
description: The id of the Event Rule to update.
type: string
required:
- rule_id
examples:
suppress_action:
summary: 'Example: Enable suppress action'
value:
rule_id: 7123bdd1-74e8-4aa7-aa38-4a9ebe123456
rule:
actions:
suppress:
value: true
disable_rule:
summary: 'Example: Disable rule'
value:
rule_id: 7123bdd1-74e8-4aa7-aa38-4a9ebe123456
rule:
disabled: true
actions:
suppress:
value: true
responses:
'200':
description: The Event Rule that was updated.
content:
application/json:
schema:
type: object
properties:
rule:
$re
# --- truncated at 32 KB (54 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/pagerduty/refs/heads/main/openapi/pagerduty-rulesets-api-openapi.yml