Skip to main content

oncalls

Creates, updates, deletes, gets or lists an oncalls resource.

Overview

Nameoncalls
TypeResource
Idpagerduty.on_calls.oncalls

Fields

The following fields are returned by SELECT queries:

A paginated array of on-call objects.

NameDatatypeDescription
endstring (date-time)The end of the on-call. If null, the user does not go off-call.
escalation_levelintegerThe escalation level for the on-call.
escalation_policyobject
scheduleobject
startstring (date-time)The start of the on-call. If null, the on-call is a permanent user on-call.
userobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_on_callsselectAccept, Content-Type, time_zone, limit, offset, total, include[], user_ids[], escalation_policy_ids[], schedule_ids[], since, until, earliestList the on-call entries during a given time range.

An on-call represents a contiguous unit of time for which a User will be on call for a given Escalation Policy and Escalation Rules.

For more information see the API Concepts Document

Scoped OAuth requires: oncalls.read
_list_on_callsexecAccept, Content-Type, time_zone, limit, offset, total, include[], user_ids[], escalation_policy_ids[], schedule_ids[], since, until, earliestList the on-call entries during a given time range.

An on-call represents a contiguous unit of time for which a User will be on call for a given Escalation Policy and Escalation Rules.

For more information see the API Concepts Document

Scoped OAuth requires: oncalls.read

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.

NameDatatypeDescription
AcceptstringThe Accept header is used as a versioning header.
Content-Typestring
earliestbooleanThis will filter on-calls such that only the earliest on-call for each combination of escalation policy, escalation level, and user is returned. This is useful for determining when the "next" on-calls are for a given set of filters.
escalation_policy_ids[]arrayFilters the results, showing only on-calls for the specified escalation policy IDs.
include[]stringArray of additional details to include.
limitintegerThe number of results per page.
offsetintegerOffset to start pagination search results.
schedule_ids[]arrayFilters the results, showing only on-calls for the specified schedule IDs. If null is provided in the array, it includes permanent on-calls due to direct user escalation targets.
sincestring (date-time)The start of the time range over which you want to search. If an on-call period overlaps with the range, it will be included in the result. Defaults to current time. On-call shifts are limited to 90 days in the future.
time_zonestring (tzinfo)Time zone in which dates in the result will be rendered.
totalbooleanBy default the total field in pagination responses is set to null to provide the fastest possible response times. Set total to true for this field to be populated. See our Pagination Docs for more information.
untilstring (date-time)The end of the time range over which you want to search. If an on-call period overlaps with the range, it will be included in the result. Defaults to current time. On-call shifts are limited to 90 days in the future, and the until time cannot be before the since time.
user_ids[]arrayFilters the results, showing only on-calls for the specified user IDs.

SELECT examples

List the on-call entries during a given time range.

An on-call represents a contiguous unit of time for which a User will be on call for a given Escalation Policy and Escalation Rules.

For more information see the API Concepts Document

Scoped OAuth requires: oncalls.read

SELECT
end,
escalation_level,
escalation_policy,
schedule,
start,
user
FROM pagerduty.on_calls.oncalls
WHERE Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
AND time_zone = '{{ time_zone }}'
AND limit = '{{ limit }}'
AND offset = '{{ offset }}'
AND total = '{{ total }}'
AND include[] = '{{ include[] }}'
AND user_ids[] = '{{ user_ids[] }}'
AND escalation_policy_ids[] = '{{ escalation_policy_ids[] }}'
AND schedule_ids[] = '{{ schedule_ids[] }}'
AND since = '{{ since }}'
AND until = '{{ until }}'
AND earliest = '{{ earliest }}'
;

Lifecycle Methods

List the on-call entries during a given time range.

An on-call represents a contiguous unit of time for which a User will be on call for a given Escalation Policy and Escalation Rules.

For more information see the API Concepts Document

Scoped OAuth requires: oncalls.read

EXEC pagerduty.on_calls.oncalls._list_on_calls 
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}',
@time_zone='{{ time_zone }}',
@limit='{{ limit }}',
@offset='{{ offset }}',
@total={{ total }},
@include[]='{{ include[] }}',
@user_ids[]='{{ user_ids[] }}',
@escalation_policy_ids[]='{{ escalation_policy_ids[] }}',
@schedule_ids[]='{{ schedule_ids[] }}',
@since='{{ since }}',
@until='{{ until }}',
@earliest={{ earliest }}
;