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

# Get a schedule

`GET https://api.pagerduty.com/schedules/{id}`

Show detailed information about a schedule, including entries for each layer.
Scoped OAuth requires: `schedules.read`

## Authorization

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

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The ID of the schedule. |

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `time_zone` | string (tzinfo) |  | Time zone in which results will be rendered. This will default to the schedule's time zone. |
| `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. |
| `overflow` | boolean |  | Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter `overflow=true` is passed. This parameter defaults to false. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from `2011-06-01T10:00:00Z` to `2011-06-01T14:00:00Z`: - If you don't pass the `overflow=true` parameter, you will get one schedule entry returned with a start of `2011-06-01T10:00:00Z` and end of `2011-06-01T14:00:00Z`. - If you do pass the `overflow=true` parameter, you will get one schedule entry returned with a start of `2011-06-01T00:00:00Z` and end of `2011-06-02T00:00:00Z`. Default: `false`. |
| `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. |

## 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

The schedule object.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `schedule` | object | yes |  |
| `schedule.id` | string |  | Read-only. |
| `schedule.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. |
| `schedule.type` | string | yes | The type of object being created. One of: `schedule`. Default: `schedule`. |
| `schedule.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedule.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedule.schedule_layers` | array of object |  | A list of schedule layers. |
| `schedule.schedule_layers[].id` | string |  |  |
| `schedule.schedule_layers[].start` | string (date-time) | yes | The start time of this layer. |
| `schedule.schedule_layers[].end` | string (date-time) |  | The end time of this layer. If `null`, the layer does not end. |
| `schedule.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. |
| `schedule.schedule_layers[].users[].user` | object | yes |  |
| `schedule.schedule_layers[].users[].user.id` | string | yes | Read-only. |
| `schedule.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. |
| `schedule.schedule_layers[].users[].user.type` | string | yes | One of: `user_reference`. |
| `schedule.schedule_layers[].users[].user.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedule.schedule_layers[].users[].user.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedule.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. |
| `schedule.schedule_layers[].restrictions[].type` | string | yes | Specify the types of `restriction`. One of: `daily_restriction`, `weekly_restriction`. |
| `schedule.schedule_layers[].restrictions[].duration_seconds` | integer | yes | The duration of the restriction in seconds. |
| `schedule.schedule_layers[].restrictions[].start_time_of_day` | string (partial-time) | yes | The start time in HH:mm:ss format. |
| `schedule.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. |
| `schedule.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. |
| `schedule.schedule_layers[].rotation_turn_length_seconds` | integer | yes | The duration of each on-call shift in seconds. |
| `schedule.schedule_layers[].name` | string |  | The name of the schedule layer. |
| `schedule.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. |
| `schedule.schedule_layers[].rendered_schedule_entries[].user` | object |  | Same fields as `schedule.schedule_layers[].users[].user` above. |
| `schedule.schedule_layers[].rendered_schedule_entries[].start` | string (date-time) | yes | The start time of this entry. Read-only. |
| `schedule.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. |
| `schedule.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. |
| `schedule.time_zone` | string (activesupport-time-zone) | yes | The time zone of the schedule. |
| `schedule.name` | string |  | The name of the schedule. |
| `schedule.description` | string |  | The description of the schedule. |
| `schedule.final_schedule` | object |  |  |
| `schedule.final_schedule.name` | string | yes | The name of the subschedule. Read-only. One of: `Final Schedule`, `Overrides`. |
| `schedule.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. |
| `schedule.final_schedule.rendered_schedule_entries[].user` | object |  | Same fields as `schedule.schedule_layers[].users[].user` above. |
| `schedule.final_schedule.rendered_schedule_entries[].start` | string (date-time) | yes | The start time of this entry. Read-only. |
| `schedule.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. |
| `schedule.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. |
| `schedule.overrides_subschedule` | object |  | Same fields as `schedule.final_schedule` above. |
| `schedule.escalation_policies` | array of object |  | An array of all of the escalation policies that uses this schedule. Read-only. |
| `schedule.escalation_policies[].id` | string | yes | Read-only. |
| `schedule.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. |
| `schedule.escalation_policies[].type` | string | yes | One of: `escalation_policy_reference`. |
| `schedule.escalation_policies[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedule.escalation_policies[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedule.users` | array of object |  | An array of all of the users on the schedule. Read-only. |
| `schedule.users[].id` | string | yes | Read-only. |
| `schedule.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. |
| `schedule.users[].type` | string | yes | One of: `user_reference`. |
| `schedule.users[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedule.users[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedule.teams` | array of object |  | An array of all of the teams on the schedule. Read-only. |
| `schedule.teams[].id` | string | yes | Read-only. |
| `schedule.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. |
| `schedule.teams[].type` | string | yes | One of: `team_reference`. |
| `schedule.teams[].self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedule.teams[].html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `schedule.next_oncall_for_user` | object |  |  |
| `schedule.next_oncall_for_user.start` | string |  | The start date for the User shift. Read-only. |
| `schedule.next_oncall_for_user.end` | string |  | The end date for the User shift. Read-only. |
| `schedule.next_oncall_for_user.user` | object |  |  |
| `schedule.next_oncall_for_user.user.id` | string | yes | Read-only. |
| `schedule.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. |
| `schedule.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. |
| `schedule.next_oncall_for_user.user.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `schedule.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: Response Example

```json
{
  "schedule": {
    "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": "PXPGF42",
        "type": "user_reference",
        "summary": "Regina Phalange",
        "self": "https://api.pagerduty.com/users/PXPGF42",
        "html_url": "https://subdomain.pagerduty.com/users/PXPGF42"
      }
    ],
    "teams": [
      {
        "id": "PQ9K7I8",
        "type": "team_reference",
        "summary": "Engineering",
        "self": "https://api.pagerduty.com/teams/PQ9K7I8",
        "html_url": "https://subdomain.pagerduty.com/teams/PQ9K7I8"
      }
    ],
    "schedule_layers": [
      {
        "name": "Layer 1",
        "rendered_schedule_entries": [
          {
            "start": "2015-11-09T08:00:00-05:00",
            "end": "2015-11-09T17:00:00-05:00",
            "user": {
              "id": "PXPGF42",
              "type": "user_reference",
              "summary": "Regina Phalange",
              "self": "https://api.pagerduty.com/users/PXPGF42",
              "html_url": "https://subdomain.pagerduty.com/users/PXPGF42"
            }
          }
        ],
        "rendered_coverage_percentage": 37.5,
        "id": "PG68P1M",
        "start": "2015-11-06T21:00:00-05:00",
        "rotation_virtual_start": "2015-11-06T20:00:00-05:00",
        "rotation_turn_length_seconds": 86400,
        "users": [
          {
            "user": {
              "id": "PXPGF42",
              "type": "user_reference",
              "summary": "Regina Phalange",
              "self": "https://api.pagerduty.com/users/PXPGF42",
              "html_url": "https://subdomain.pagerduty.com/users/PXPGF42"
            }
          }
        ],
        "restrictions": [
          {
            "type": "daily_restriction",
            "start_time_of_day": "08:00:00",
            "duration_seconds": 32400
          }
        ]
      }
    ],
    "overrides_subschedule": {
      "name": "Overrides",
      "rendered_schedule_entries": [],
      "rendered_coverage_percentage": 0
    },
    "final_schedule": {
      "name": "Final Schedule",
      "rendered_schedule_entries": [
        {
          "start": "2015-11-10T08:00:00-05:00",
          "end": "2015-11-10T17:00:00-05:00",
          "user": {
            "id": "PXPGF42",
            "type": "user_reference",
            "summary": "Regina Phalange",
            "self": "https://api.pagerduty.com/users/PXPGF42",
            "html_url": "https://subdomain.pagerduty.com/users/PXPGF42"
          }
        }
      ],
      "rendered_coverage_percentage": 37.5
    },
    "next_oncall_for_user": {
      "start": "2021-12-27T16:00:00-05:00",
      "end": "2022-01-03T16:00:00-05:00",
      "user": [
        {
          "id": "PCQNVHM",
          "type": "user_reference",
          "summary": "Jim Halpert",
          "self": "https://api.pagerduty.com/users/PCQNVHM",
          "html_url": "https://subdomain.pagerduty.com/users/PCQNVHM"
        }
      ]
    }
  }
}
```

## 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 404

The requested resource was not found.

### `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).
