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

# Get a custom shift

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

<!-- theme: info -->

> **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:**
>
> 1. **Update your automations** to use the V3 API for all new shift-based schedules
> 2. **Keep the V2 endpoint** for your existing schedules
>
> 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).

Retrieve a single custom shift by ID.

## 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. |
| `custom_shift_id` | string | yes | The ID of the custom shift. |

## Response 200

Custom shift retrieved successfully

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `custom_shift` | object | yes | An ad-hoc one-off shift outside of rotation events. |
| `custom_shift.id` | string | yes |  |
| `custom_shift.type` | string | yes | One of: `custom_shift`. |
| `custom_shift.start_time` | string (date-time) | yes |  |
| `custom_shift.end_time` | string (date-time) | yes |  |
| `custom_shift.assignments` | array of object | yes | Exactly one assignment per custom shift. Min items: 1. Max items: 1. |
| `custom_shift.assignments[].id` | string | yes | Assignment ID. |
| `custom_shift.assignments[].type` | string | yes | One of: `shift_assignment`. |
| `custom_shift.assignments[].member` | object | yes | A member (user) assigned to a shift or rotation slot. |
| `custom_shift.assignments[].member.type` | string | yes | `user_member` — a specific user is assigned. `empty_member` — the slot is intentionally unassigned. One of: `user_member`, `empty_member`. |
| `custom_shift.assignments[].member.user_id` | string |  | The ID of the user. Required when type is `user_member`. |
| `custom_shift.self` | string (uri) |  |  |
| `custom_shift.html_url` | string (uri) |  |  |

Example: Example response

```json
{
  "custom_shift": {
    "id": "ABCDE12345FGHIJ67890KLMNO",
    "type": "custom_shift",
    "start_time": "2025-03-15T09:00:00Z",
    "end_time": "2025-03-15T17:00:00Z",
    "assignments": [
      {
        "id": "AGOQEAQOOJ3UDGC22OGLXLIRY4",
        "member": {
          "type": "user_member",
          "user_id": "PNFNM8M"
        },
        "type": "shift_assignment"
      }
    ],
    "self": "https://api.pagerduty.com/v3/schedules/PI7DH85/custom_shifts/ABCDE12345FGHIJ67890KLMNO",
    "html_url": "https://subdomain.pagerduty.com/schedules/PI7DH85"
  }
}
```

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

Internal Server Error the PagerDuty server experienced an error.

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