# List on-call rotations — API reference

> Returns rotations with members, handoff settings, the current on-call person, and pagination.

Source: https://upfour.io/docs/api/oncall-schedules/list-on-call-rotations

[Developers](https://upfour.io/docs/api.md)/[On-call rotations](https://upfour.io/docs/api/oncall-schedules.md)

Returns rotations with members, handoff settings, the current on-call person, and pagination.

GET https://app.upfour.io/v1/oncall-schedules

scope oncall.read stable returns 200

## Parameters

| Field | Type | Description |
| --- | --- | --- |
| `limit` optional | integer 1–250 default `50` | query parameter |
| `cursor` optional | string | query parameter |
| `client_id` optional | uuid | query parameter |
| `all_clients` optional | boolean | query parameter |
| `q` optional | string | query parameter |
| `sort` optional | string | query parameter |

## Returns

A successful request returns `200` with application/json.

Response fields 2 top-level fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | OnCallSchedule[]  · nullable | |
| Each item · 28 fields FieldTypeDescription `created_at` string (date-time) `handoff_day` integer Weekday of the weekly handoff, 0 = Sunday to 6 = Saturday. `handoff_time` string HH:MM:SS in the schedule's time zone. `id` uuid `members` OnCallMember[]  · nullable Each item · 8 fields FieldTypeDescription `created_at` string (date-time) `id` uuid `schedule_id` uuid `sort_order` integer `user_id` uuid `email` string `first_name` string `last_name` string `name` string `organization_id` uuid `rotation_type` string one of`daily` `weekly` `custom` `timezone` string `updated_at` string (date-time) `client_id` uuid `current_oncall` OnCallMember The person on call right now, an active override first; absent while nobody is. OnCallMember · 8 fields FieldTypeDescription `created_at` string (date-time) `id` uuid `schedule_id` uuid `sort_order` integer `user_id` uuid `email` string `first_name` string `last_name` string | | |
| `pagination` | Pagination | |
| Pagination · 5 fields FieldTypeDescription `cursor` string  · nullable `has_more` boolean `limit` integer 1–250 `next_cursor` string  · nullable `prev_cursor` string  · nullable | | |

## Errors

Only the errors this operation can return. Every error uses the [same envelope](https://upfour.io/docs/api/responses.md).

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | [bad_request](https://upfour.io/docs/api/errors#code-bad_request) | The request is malformed or fails validation. |

Every call can also return `unauthorized` (401), `rate_limit_exceeded` (429) or `internal_error` (500 / 502). See [Responses and errors](https://upfour.io/docs/api/responses.md).

[NextCreate an on-call rotation](https://upfour.io/docs/api/oncall-schedules/create-an-on-call-rotation.md)

## Request

### cURL

```bash
curl -s "https://app.upfour.io/v1/oncall-schedules" \
  -H "Authorization: Bearer $UP4_API_KEY"
```

### JavaScript

```javascript
const res = await fetch("https://app.upfour.io/v1/oncall-schedules", {
  headers: {
    Authorization: `Bearer ${process.env.UP4_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

### Python

```python
import os
import requests

res = requests.get(
    "https://app.upfour.io/v1/oncall-schedules",
    headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
)
print(res.status_code, res.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.upfour.io/v1/oncall-schedules", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("UP4_API_KEY"))
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(res.StatusCode, string(out))
}
```

### PHP

```php
<?php
$ch = curl_init("https://app.upfour.io/v1/oncall-schedules");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("UP4_API_KEY"),
    ],
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), " ", $response, "\n";
curl_close($ch);
```

## Response

### 200

```json
{
  "data": [
    {
      "created_at": "2026-10-27T09:00:00Z",
      "current_oncall": {
        "created_at": "2026-10-27T09:00:00Z",
        "email": "anna@example.com",
        "id": "00000000-0000-4000-8000-000000000001",
        "schedule_id": "00000000-0000-4000-8000-000000000002",
        "sort_order": 0,
        "user_id": "00000000-0000-4000-8000-000000000003"
      },
      "handoff_day": 1,
      "handoff_time": "09:00:00",
      "id": "00000000-0000-4000-8000-000000000002",
      "members": [
        {
          "created_at": "2026-10-27T09:00:00Z",
          "email": "anna@example.com",
          "id": "00000000-0000-4000-8000-000000000001",
          "schedule_id": "00000000-0000-4000-8000-000000000002",
          "sort_order": 0,
          "user_id": "00000000-0000-4000-8000-000000000003"
        }
      ],
      "name": "Platform on-call",
      "organization_id": "00000000-0000-4000-8000-000000000004",
      "rotation_type": "weekly",
      "timezone": "Europe/Berlin",
      "updated_at": "2026-10-27T09:00:00Z"
    }
  ],
  "pagination": {
    "cursor": null,
    "has_more": false,
    "limit": 50,
    "next_cursor": null,
    "prev_cursor": null
  }
}
```

### 400

```json
{
  "error": {
    "code": "bad_request",
    "message": "The request is malformed or fails validation.",
    "request_id": "req_…"
  }
}
```
