---
title: List On-Call schedules
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > On-Call
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

# List On-Call schedules{% #list-on-call-schedules %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                               |
| ----------------- | ---------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/on-call/schedules |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/on-call/schedules |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/on-call/schedules      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/on-call/schedules      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/on-call/schedules  |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/on-call/schedules |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/on-call/schedules     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/on-call/schedules |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/on-call/schedules |

### Overview

Retrieve a list of On-Call schedules. This endpoint requires the `on_call_read` permission.

### Arguments

#### Query Strings

| Name          | Type    | Description                                                                                                                                                                                                                                                          |
| ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| page[size]    | integer | Number of items to return per page. The maximum allowed value is 100.                                                                                                                                                                                                |
| page[number]  | integer | Specific page number to return.                                                                                                                                                                                                                                      |
| filter[query] | string  | Search query to filter schedules. Supports free-text search on schedule name (case-insensitive, `*` wildcards), and structured filters such as `team.id:<uuid>` and `user.id:<uuid>` (multiple values can be combined with `OR`, e.g. `user.id:(<uuid> OR <uuid>)`). |
| include       | string  | Comma-separated list of included relationships to be returned. Allowed value: `teams`.                                                                                                                                                                               |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
A list of schedules with pagination metadata and any related included resources (such as teams).

| Parent field  | Field                  | Type     | Description                                                                                                         |
| ------------- | ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
|               | data                   | [object] | A list of schedules.                                                                                                |
| data          | attributes             | object   | Provides core properties of a schedule object such as its name and time zone.                                       |
| attributes    | name                   | string   | A short name for the schedule.                                                                                      |
| attributes    | tags                   | [string] | A list of tags associated with the schedule.                                                                        |
| attributes    | time_zone              | string   | The time zone in which this schedule operates.                                                                      |
| data          | id [*required*]   | string   | The schedule's unique identifier.                                                                                   |
| data          | relationships          | object   | Groups the relationships for a schedule summary, referencing its teams.                                             |
| relationships | teams                  | object   | Associates teams with this schedule in a data structure.                                                            |
| teams         | data                   | [object] | An array of team references for this schedule.                                                                      |
| data          | id [*required*]   | string   | The unique identifier of the team in this relationship.                                                             |
| data          | type [*required*] | enum     | Teams resource type. Allowed enum values: `teams`                                                                   |
| data          | type [*required*] | enum     | Schedules resource type. Allowed enum values: `schedules`                                                           |
|               | included               | [object] | Any additional resources related to the schedules, such as teams.                                                   |
| included      | attributes             | object   | Encapsulates the basic attributes of a Team reference, such as name, handle, and an optional avatar or description. |
| attributes    | avatar                 | string   | URL or reference for the team's avatar (if available).                                                              |
| attributes    | description            | string   | A short text describing the team.                                                                                   |
| attributes    | handle                 | string   | A unique handle/slug for the team.                                                                                  |
| attributes    | name                   | string   | The full, human-readable name of the team.                                                                          |
| included      | id                     | string   | The team's unique identifier.                                                                                       |
| included      | type [*required*] | enum     | Teams resource type. Allowed enum values: `teams`                                                                   |
|               | meta                   | object   | Metadata that is included in the response when listing schedules.                                                   |
| meta          | page                   | object   | Metadata related to paging information that is included in the response when listing schedules.                     |
| page          | first_number           | int64    | First page number.                                                                                                  |
| page          | last_number            | int64    | Last page number.                                                                                                   |
| page          | next_number            | int64    | Next page number.                                                                                                   |
| page          | number                 | int64    | Page number.                                                                                                        |
| page          | prev_number            | int64    | Previous page number.                                                                                               |
| page          | size                   | int64    | Page size.                                                                                                          |
| page          | total                  | int64    | Total number of results.                                                                                            |
| page          | type                   | string   | Pagination type.                                                                                                    |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "name": "Primary On-Call",
        "tags": [],
        "time_zone": "America/New_York"
      },
      "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
      "relationships": {
        "teams": {
          "data": [
            {
              "id": "00000000-da3a-0000-0000-000000000000",
              "type": "teams"
            }
          ]
        }
      },
      "type": "schedules"
    }
  ],
  "meta": {
    "page": {
      "first_number": 0,
      "last_number": 0,
      "next_number": null,
      "number": 0,
      "prev_number": null,
      "size": 10,
      "total": 1,
      "type": "number_size"
    }
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Unauthorized
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/on-call/schedules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" 
                
##### 

```python
"""
List On-Call schedules returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.on_call_api import OnCallApi

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = OnCallApi(api_client)
    response = api_instance.list_on_call_schedules()

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
##### 

```ruby
# List On-Call schedules returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::OnCallAPI.new
p api_instance.list_on_call_schedules()
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
##### 

```go
// List On-Call schedules returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOnCallApi(apiClient)
	resp, r, err := api.ListOnCallSchedules(ctx, *datadogV2.NewListOnCallSchedulesOptionalParameters())

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `OnCallApi.ListOnCallSchedules`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OnCallApi.ListOnCallSchedules`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
##### 

```java
// List On-Call schedules returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OnCallApi;
import com.datadog.api.client.v2.model.Schedules;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    OnCallApi apiInstance = new OnCallApi(defaultClient);

    try {
      Schedules result = apiInstance.listOnCallSchedules();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OnCallApi#listOnCallSchedules");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
##### 

```rust
// List On-Call schedules returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_on_call::ListOnCallSchedulesOptionalParams;
use datadog_api_client::datadogV2::api_on_call::OnCallAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = OnCallAPI::with_config(configuration);
    let resp = api
        .list_on_call_schedules(ListOnCallSchedulesOptionalParams::default())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * List On-Call schedules returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
const apiInstance = new v2.OnCallApi(configuration);

apiInstance
  .listOnCallSchedules()
  .then((data: v2.Schedules) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"
{% /tab %}
