---
type: api
title: Get calendar configuration info
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-calendars
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-get-calendars
products:
  - Elasticsearch
---

# Get calendar configuration info


Availability: 6.2+

## Paths

- `POST` (also `GET`) `/_ml/calendars/{calendar_id}`
- `POST` (also `GET`) `/_ml/calendars`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

#### Path Parameters

- `calendar_id` (string Id) — optional, leave it out to use `/_ml/calendars`
  A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids or a wildcard expression. You can get information for all calendars by using `_all` or `*` or by omitting the calendar identifier.

## Description

## Required authorization

* Cluster privileges: `monitor_ml`

## Query String Parameters

- `from` (number · default: 0)
  Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.
- `size` (number · default: 10000)
  Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.

## Request Body

`application/json`

- `page` ({} Page) — optional
  This object is supported only when you omit the calendar identifier.
  - `from` (number · default: 0) — optional
    Skips the specified number of items.
  - `size` (number · default: 10000) — optional
    Specifies the maximum number of items to obtain.

## Response

`application/json`

- `calendars` ([] Calendar)
  - `calendar_id` (string Id)
    A string that uniquely identifies a calendar.
  - `description` (string)
    A description of the calendar.
  - `job_ids` ([] string Id)
    An array of anomaly detection job identifiers.
- `count` (number)
## Code Examples

#### Console

```console
POST _ml/calendars/planned-outages
```

#### JavaScript

```javascript
const response = await client.ml.getCalendars({
  calendar_id: "planned-outages",
});
```

#### Python

```python
resp = client.ml.get_calendars(
    calendar_id="planned-outages",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_ml/calendars/planned-outages" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.ml().getCalendars(g -> g
    .calendarId("planned-outages")
);
```

#### C#

```c#
var response = await client.MachineLearning
    .GetCalendarsAsync(d1 => d1
        .CalendarId("planned-outages")
    );
```

#### PHP

```php
$resp = $client->ml()->getCalendars([
    "calendar_id" => "planned-outages",
]);
```

#### Ruby

```ruby
response = client.ml.get_calendars(
  calendar_id: "planned-outages"
)
```

