audit_records
Creates, updates, deletes, gets or lists an audit_records resource.
Overview
| Name | audit_records |
| Type | Resource |
| Id | pagerduty.schedules_v3.audit_records |
Fields
The following fields are returned by SELECT queries:
- list
Records matching the query criteria.
| Name | Datatype | Description |
|---|---|---|
id | string | |
action | string | (example: create) |
actors | array | |
details | object | Additional details to provide further information about the action or the resource that has been audited. |
execution_context | object | Action execution context |
execution_time | string (date-time) | The date/time the action executed, in ISO8601 format and millisecond precision. |
method | object | The method information |
root_resource | object | (opaque JSON object) |
self | string | Record URL. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | id | limit, cursor, since, until | <!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />The returned records are sorted by the execution_time from newest to oldest.<br /><br />See [Cursor-based pagination](https://developer.pagerduty.com/docs/rest-api-v2/pagination/) for instructions on how to paginate through the result set.<br /><br />For more information see the [Audit API Document](https://developer.pagerduty.com/docs/rest-api-v2/audit-records-api/).<br /><br />Scoped OAuth requires: audit_records.read<br /> |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the schedule. (example: PSJUKNI) |
cursor | string | Optional parameter used to request the "next" set of results from an API. The value provided here is most commonly obtained from the next_cursor field of the previous request. When no value is provided, the request starts at the beginning of the result set. |
limit | integer | The minimum of the limit parameter used in the request or the maximum request size of the API. |
since | string (date-time) | The start of the date range over which you want to search. If not specified, defaults to now() - 24 hours (past 24 hours) |
until | string (date-time) | The end of the date range over which you want to search. If not specified, defaults to now(). May not be more than 31 days after since. |
SELECT examples
- list
<!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />The returned records are sorted by the execution_time from newest to oldest.<br /><br />See [Cursor-based pagination](https://developer.pagerduty.com/docs/rest-api-v2/pagination/) for instructions on how to paginate through the result set.<br /><br />For more information see the [Audit API Document](https://developer.pagerduty.com/docs/rest-api-v2/audit-records-api/).<br /><br />Scoped OAuth requires: audit_records.read<br />
SELECT
id,
action,
actors,
details,
execution_context,
execution_time,
method,
root_resource,
self
FROM pagerduty.schedules_v3.audit_records
WHERE id = '{{ id }}' -- required
AND limit = '{{ limit }}'
AND cursor = '{{ cursor }}'
AND since = '{{ since }}'
AND until = '{{ until }}'
;