> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# List schedules

`GET https://api.pagerduty.com/schedules`

List the on-call schedules.

A Schedule determines the time periods that users are On-Call.

For more information see the [API Concepts Document](https://docs.pagerduty.com/developer/api-concepts#schedules)

Scoped OAuth requires: `schedules.read`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `limit` | integer |  | The number of results per page. |
| `offset` | integer |  | Offset to start pagination search results. |
| `total` | boolean |  | By 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](https://docs.pagerduty.com/developer/pagination) for more information. Default: `false`. |
| `query` | string |  | Filters the result, showing only the records whose name matches the query. |
| `include[]` | string |  | Array of additional details to include. One of: `schedule_layers`, `overrides_subschedule`, `final_schedule`. Items must be unique. |
| `time_zone` | string (tzinfo) |  | Time zone in which results will be rendered. This will default to the current user's time zone and then the account's time zone. |
| `include_next_oncall_for_user` | string |  | Specify an `user_id`, and the schedule list API will return information about this user's next on-call. |
| `since` | string (date-time) |  | The start of the date range over which you want to show schedule entries. Defaults to 2 weeks before until if an until is given. Optional parameter. When provided with include[] for schedule types, populates the rendered_schedule_entries fields in the response. |
| `until` | string (date-time) |  | The end of the date range over which you want to show schedule entries. Defaults to 2 weeks after since if a since is given. Optional parameter. When provided with include[] for schedule types, populates the rendered_schedule_entries fields in the response. |
| `team_ids[]` | array of string |  | An array of team IDs. Only results related to these teams will be returned. Account must have the `teams` ability to use this parameter. Items must be unique. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Response 200

A paginated array of schedule objects.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `offset` | integer |  | Echoes offset pagination property. Read-only. |
| `limit` | integer |  | Echoes limit pagination property. Read-only. |
| `more` | boolean |  | Indicates if there are additional records to return. Read-only. |
| `total` | integer \| null |  | The total number of records matching the given query. Read-only. |
| `schedules` | array of object | yes |  |
| `schedules[].id` | string |  | Read-only. |
| `schedules[].summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `schedules[].type` | string | yes | The type of object being created. One of: `schedule`. Default: `schedule`. |
| `schedules[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedules[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedules[].schedule_layers` | array of object |  | A list of schedule layers. |
| `schedules[].schedule_layers[].id` | string |  |  |
| `schedules[].schedule_layers[].start` | string (date-time) | yes | The start time of this layer. |
| `schedules[].schedule_layers[].end` | string (date-time) |  | The end time of this layer. If `null`, the layer does not end. |
| `schedules[].schedule_layers[].users` | array of object | yes | The ordered list of users on this layer. The position of the user on the list determines their order in the layer. |
| `schedules[].schedule_layers[].users[].user` | object | yes |  |
| `schedules[].schedule_layers[].users[].user.id` | string | yes | Read-only. |
| `schedules[].schedule_layers[].users[].user.summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `schedules[].schedule_layers[].users[].user.type` | string | yes | One of: `user_reference`. |
| `schedules[].schedule_layers[].users[].user.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedules[].schedule_layers[].users[].user.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedules[].schedule_layers[].restrictions` | array of object |  | An array of restrictions for the layer. A restriction is a limit on which period of the day or week the schedule layer can accept assignments. Restrictions respect the `time_zone` parameter of the request. |
| `schedules[].schedule_layers[].restrictions[].type` | string | yes | Specify the types of `restriction`. One of: `daily_restriction`, `weekly_restriction`. |
| `schedules[].schedule_layers[].restrictions[].duration_seconds` | integer | yes | The duration of the restriction in seconds. |
| `schedules[].schedule_layers[].restrictions[].start_time_of_day` | string (partial-time) | yes | The start time in HH:mm:ss format. |
| `schedules[].schedule_layers[].restrictions[].start_day_of_week` | integer |  | Only required for use with a `weekly_restriction` restriction type. The first day of the weekly rotation schedule as [ISO 8601 day](https://en.wikipedia.org/wiki/ISO_week_date) (1 is Monday, etc.) Minimum: 1. Maximum: 7. |
| `schedules[].schedule_layers[].rotation_virtual_start` | string (date-time) | yes | The effective start time of the layer. This can be before the start time of the schedule. |
| `schedules[].schedule_layers[].rotation_turn_length_seconds` | integer | yes | The duration of each on-call shift in seconds. |
| `schedules[].schedule_layers[].name` | string |  | The name of the schedule layer. |
| `schedules[].schedule_layers[].rendered_schedule_entries` | array of object |  | This is a list of entries on the computed layer for the current time range. Since or until must be set in order for this field to be populated. Read-only. |
| `schedules[].schedule_layers[].rendered_schedule_entries[].user` | object |  | Same fields as `schedules[].schedule_layers[].users[].user` above. |
| `schedules[].schedule_layers[].rendered_schedule_entries[].start` | string (date-time) | yes | The start time of this entry. Read-only. |
| `schedules[].schedule_layers[].rendered_schedule_entries[].end` | string (date-time) | yes | The end time of this entry. If null, the entry does not end. Read-only. |
| `schedules[].schedule_layers[].rendered_coverage_percentage` | number |  | The percentage of the time range covered by this layer. Returns null unless since or until are set. Read-only. |
| `schedules[].time_zone` | string (activesupport-time-zone) | yes | The time zone of the schedule. |
| `schedules[].name` | string |  | The name of the schedule. |
| `schedules[].description` | string |  | The description of the schedule. |
| `schedules[].final_schedule` | object |  |  |
| `schedules[].final_schedule.name` | string | yes | The name of the subschedule. Read-only. One of: `Final Schedule`, `Overrides`. |
| `schedules[].final_schedule.rendered_schedule_entries` | array of object |  | This is a list of entries on the computed layer for the current time range. Since or until must be set in order for this field to be populated. Read-only. |
| `schedules[].final_schedule.rendered_schedule_entries[].user` | object |  | Same fields as `schedules[].schedule_layers[].users[].user` above. |
| `schedules[].final_schedule.rendered_schedule_entries[].start` | string (date-time) | yes | The start time of this entry. Read-only. |
| `schedules[].final_schedule.rendered_schedule_entries[].end` | string (date-time) | yes | The end time of this entry. If null, the entry does not end. Read-only. |
| `schedules[].final_schedule.rendered_coverage_percentage` | number |  | The percentage of the time range covered by this layer. Returns null unless since or until are set. Read-only. |
| `schedules[].overrides_subschedule` | object |  | Same fields as `schedules[].final_schedule` above. |
| `schedules[].escalation_policies` | array of object |  | An array of all of the escalation policies that uses this schedule. Read-only. |
| `schedules[].escalation_policies[].id` | string | yes | Read-only. |
| `schedules[].escalation_policies[].summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `schedules[].escalation_policies[].type` | string | yes | One of: `escalation_policy_reference`. |
| `schedules[].escalation_policies[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedules[].escalation_policies[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedules[].users` | array of object |  | An array of all of the users on the schedule. Read-only. |
| `schedules[].users[].id` | string | yes | Read-only. |
| `schedules[].users[].summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `schedules[].users[].type` | string | yes | One of: `user_reference`. |
| `schedules[].users[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedules[].users[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedules[].teams` | array of object |  | An array of all of the teams on the schedule. Read-only. |
| `schedules[].teams[].id` | string | yes | Read-only. |
| `schedules[].teams[].summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `schedules[].teams[].type` | string | yes | One of: `team_reference`. |
| `schedules[].teams[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedules[].teams[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedules[].next_oncall_for_user` | object |  |  |
| `schedules[].next_oncall_for_user.start` | string |  | The start date for the User shift. Read-only. |
| `schedules[].next_oncall_for_user.end` | string |  | The end date for the User shift. Read-only. |
| `schedules[].next_oncall_for_user.user` | object |  |  |
| `schedules[].next_oncall_for_user.user.id` | string | yes | Read-only. |
| `schedules[].next_oncall_for_user.user.summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `schedules[].next_oncall_for_user.user.type` | string | yes | A string that determines the schema of the object. This must be the standard name for the entity, suffixed by `_reference` if the object is a reference. Read-only. |
| `schedules[].next_oncall_for_user.user.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedules[].next_oncall_for_user.user.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |

Example: Basic Example

```json
{
  "schedules": [
    {
      "id": "PI7DH85",
      "type": "schedule",
      "summary": "Daily Engineering Rotation",
      "self": "https://api.pagerduty.com/schedules/PI7DH85",
      "html_url": "https://subdomain.pagerduty.com/schedules/PI7DH85",
      "name": "Daily Engineering Rotation",
      "time_zone": "America/New_York",
      "description": "Rotation schedule for engineering",
      "escalation_policies": [
        {
          "id": "PT20YPA",
          "type": "escalation_policy_reference",
          "summary": "Another Escalation Policy",
          "self": "https://api.pagerduty.com/escalation_policies/PT20YPA",
          "html_url": "https://subdomain.pagerduty.com/escalation_policies/PT20YPA"
        }
      ],
      "users": [
        {
          "id": "PEYSGVF",
          "type": "user_reference",
          "summary": "PagerDuty Admin",
          "self": "https://api.pagerduty.com/users/PEYSGVF",
          "html_url": "https://subdomain.pagerduty.com/users/PEYSGVF"
        }
      ]
    }
  ],
  "limit": 100,
  "offset": 0,
  "more": false,
  "total": null
}
```

Example: With Schedule Layers Included

```json
{
  "schedules": [
    {
      "id": "PI7DH85",
      "type": "schedule",
      "summary": "Daily Engineering Rotation",
      "self": "https://api.pagerduty.com/schedules/PI7DH85",
      "html_url": "https://subdomain.pagerduty.com/schedules/PI7DH85",
      "name": "Daily Engineering Rotation",
      "time_zone": "America/New_York",
      "description": "Rotation schedule for engineering",
      "escalation_policies": [
        {
          "id": "PT20YPA",
          "type": "escalation_policy_reference",
          "summary": "Another Escalation Policy",
          "self": "https://api.pagerduty.com/escalation_policies/PT20YPA",
          "html_url": "https://subdomain.pagerduty.com/escalation_policies/PT20YPA"
        }
      ],
      "users": [
        {
          "id": "PEYSGVF",
          "type": "user_reference",
          "summary": "PagerDuty Admin",
          "self": "https://api.pagerduty.com/users/PEYSGVF",
          "html_url": "https://subdomain.pagerduty.com/users/PEYSGVF"
        }
      ],
      "schedule_layers": [
        {
          "name": "Night Shift",
          "start": "2015-11-06T20:00:00-05:00",
          "end": "2016-11-06T20:00:00-05:00",
          "rotation_virtual_start": "2015-11-06T20:00:00-05:00",
          "rotation_turn_length_seconds": 86400,
          "users": [
            {
              "user": {
                "id": "PEYSGVF",
                "type": "user_reference",
                "summary": "PagerDuty Admin",
                "self": "https://api.pagerduty.com/users/PEYSGVF",
                "html_url": "https://subdomain.pagerduty.com/users/PEYSGVF"
              }
            }
          ],
          "restrictions": [
            {
              "type": "daily_restriction",
              "start_time_of_day": "08:00:00",
              "duration_seconds": 32400
            }
          ]
        }
      ]
    }
  ],
  "limit": 100,
  "offset": 0,
  "more": false,
  "total": null
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
