---
title: Get active downtimes for a monitor
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Downtimes
---

# Get active downtimes for a monitor{% #get-active-downtimes-for-a-monitor %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                                   |
| ----------------- | ------------------------------------------------------------------------------ |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/monitor/{monitor_id}/downtime_matches |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/monitor/{monitor_id}/downtime_matches |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/monitor/{monitor_id}/downtime_matches      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/monitor/{monitor_id}/downtime_matches      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/monitor/{monitor_id}/downtime_matches  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/monitor/{monitor_id}/downtime_matches     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/monitor/{monitor_id}/downtime_matches |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/monitor/{monitor_id}/downtime_matches |

### Overview

Get all active downtimes for the specified monitor. This endpoint requires the `monitors_downtime` permission.

OAuth apps require the `monitors_downtime` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#downtimes) to access this endpoint.



### Arguments

#### Path Parameters

| Name                         | Type    | Description            |
| ---------------------------- | ------- | ---------------------- |
| monitor_id [*required*] | integer | The id of the monitor. |

#### Query Strings

| Name         | Type    | Description                                                   |
| ------------ | ------- | ------------------------------------------------------------- |
| page[offset] | integer | Specific offset to use as the beginning of the returned page. |
| page[limit]  | integer | Maximum number of downtimes in the response.                  |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response for retrieving all downtime matches for a monitor.

| Parent field | Field                | Type      | Description                                                                                                                                 |
| ------------ | -------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data                 | [object]  | An array of downtime matches.                                                                                                               |
| data         | attributes           | object    | Downtime match details.                                                                                                                     |
| attributes   | end                  | date-time | The end of the downtime.                                                                                                                    |
| attributes   | groups               | [string]  | An array of groups associated with the downtime.                                                                                            |
| attributes   | scope                | string    | The scope to which the downtime applies. Must follow the [common search syntax](https://docs.datadoghq.com/logs/explorer/search_syntax.md). |
| attributes   | start                | date-time | The start of the downtime.                                                                                                                  |
| data         | id                   | string    | The downtime ID.                                                                                                                            |
| data         | type                 | enum      | Monitor Downtime Match resource type. Allowed enum values: `downtime_match`                                                                 |
|              | meta                 | object    | Pagination metadata returned by the API.                                                                                                    |
| meta         | page                 | object    | Object containing the total filtered count.                                                                                                 |
| page         | total_filtered_count | int64     | Total count of elements matched by the filter.                                                                                              |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "end": "2020-01-02T03:04:00.000Z",
        "groups": [
          "service:postgres",
          "team:frontend"
        ],
        "scope": "env:(staging OR prod) AND datacenter:us-east-1",
        "start": "2020-01-02T03:04:00.000Z"
      },
      "id": "00000000-0000-1234-0000-000000000000",
      "type": "downtime_match"
    }
  ],
  "meta": {
    "page": {
      "total_filtered_count": "integer"
    }
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Monitor Not Found error
{% 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

##### 
                  \# Path parameters export monitor_id="CHANGE_ME" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/monitor/${monitor_id}/downtime_matches" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get active downtimes for a monitor returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.downtimes_api import DowntimesApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DowntimesApi(api_client)
    response = api_instance.list_monitor_downtimes(
        monitor_id=35534610,
    )

    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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Get active downtimes for a monitor returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::DowntimesAPI.new
p api_instance.list_monitor_downtimes(35534610)
```

#### 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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Get active downtimes for a monitor 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())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewDowntimesApi(apiClient)
	resp, r, err := api.ListMonitorDowntimes(ctx, 35534610, *datadogV2.NewListMonitorDowntimesOptionalParameters())

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DowntimesApi.ListMonitorDowntimes`:\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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Get active downtimes for a monitor returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DowntimesApi;
import com.datadog.api.client.v2.model.MonitorDowntimeMatchResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    DowntimesApi apiInstance = new DowntimesApi(defaultClient);

    try {
      MonitorDowntimeMatchResponse result = apiInstance.listMonitorDowntimes(35534610L);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DowntimesApi#listMonitorDowntimes");
      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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get active downtimes for a monitor returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_downtimes::DowntimesAPI;
use datadog_api_client::datadogV2::api_downtimes::ListMonitorDowntimesOptionalParams;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = DowntimesAPI::with_config(configuration);
    let resp = api
        .list_monitor_downtimes(35534610, ListMonitorDowntimesOptionalParams::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
/**
 * Get active downtimes for a monitor returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.DowntimesApi(configuration);

const params: v2.DowntimesApiListMonitorDowntimesRequest = {
  monitorId: 35534610,
};

apiInstance
  .listMonitorDowntimes(params)
  .then((data: v2.MonitorDowntimeMatchResponse) => {
    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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

{% tab title="v1" %}

| Datadog site      | API endpoint                                                            |
| ----------------- | ----------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v1/monitor/{monitor_id}/downtimes |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v1/monitor/{monitor_id}/downtimes |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v1/monitor/{monitor_id}/downtimes      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v1/monitor/{monitor_id}/downtimes      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v1/monitor/{monitor_id}/downtimes  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v1/monitor/{monitor_id}/downtimes     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v1/monitor/{monitor_id}/downtimes |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v1/monitor/{monitor_id}/downtimes |

### Overview

Get all active v1 downtimes for the specified monitor. **Note:** This endpoint has been deprecated. Please use v2 endpoints. This endpoint requires the `monitors_read` permission.

OAuth apps require the `monitors_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#downtimes) to access this endpoint.



### Arguments

#### Path Parameters

| Name                         | Type    | Description           |
| ---------------------------- | ------- | --------------------- |
| monitor_id [*required*] | integer | The id of the monitor |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}

| Parent field | Field                            | Type     | Description                                                                                                                                                                                                                                                                                                                                                      |
| ------------ | -------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | active                           | boolean  | If a scheduled downtime currently exists.                                                                                                                                                                                                                                                                                                                        |
|              | active_child                     | object   | The downtime object definition of the active child for the original parent recurring downtime. This field will only exist on recurring downtimes.                                                                                                                                                                                                                |
| active_child | active                           | boolean  | If a scheduled downtime currently exists.                                                                                                                                                                                                                                                                                                                        |
| active_child | canceled                         | int64    | If a scheduled downtime is canceled.                                                                                                                                                                                                                                                                                                                             |
| active_child | creator_id                       | int32    | User ID of the downtime creator.                                                                                                                                                                                                                                                                                                                                 |
| active_child | disabled                         | boolean  | If a downtime has been disabled.                                                                                                                                                                                                                                                                                                                                 |
| active_child | downtime_type                    | int32    | `0` for a downtime applied on `*` or all, `1` when the downtime is only scoped to hosts, or `2` when the downtime is scoped to anything but hosts.                                                                                                                                                                                                               |
| active_child | end                              | int64    | POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.                                                                                                                                                                                                                                                |
| active_child | id                               | int64    | The downtime ID.                                                                                                                                                                                                                                                                                                                                                 |
| active_child | message                          | string   | A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same `@username` notation as events.                                                                                                                                                                                                   |
| active_child | monitor_id                       | int64    | A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.                                                                                                                                                                                                                                                           |
| active_child | monitor_tags                     | [string] | A comma-separated list of monitor tags. For example, tags that are applied directly to monitors, not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags. For example, `service:postgres` **AND** `team:frontend`. |
| active_child | mute_first_recovery_notification | boolean  | If the first recovery notification during a downtime should be muted.                                                                                                                                                                                                                                                                                            |
| active_child | notify_end_states                | [string] | States for which `notify_end_types` sends out notifications for.                                                                                                                                                                                                                                                                                                 |
| active_child | notify_end_types                 | [string] | If set, notifies if a monitor is in an alert-worthy state (`ALERT`, `WARNING`, or `NO DATA`) when this downtime expires or is canceled. Applied to monitors that change states during the downtime (such as from `OK` to `ALERT`, `WARNING`, or `NO DATA`), and to monitors that already have an alert-worthy state when downtime begins.                        |
| active_child | parent_id                        | int64    | ID of the parent Downtime.                                                                                                                                                                                                                                                                                                                                       |
| active_child | recurrence                       | object   | An object defining the recurrence of the downtime.                                                                                                                                                                                                                                                                                                               |
| recurrence   | period                           | int32    | How often to repeat as an integer. For example, to repeat every 3 days, select a type of `days` and a period of `3`.                                                                                                                                                                                                                                             |
| recurrence   | rrule                            | string   | The `RRULE` standard for defining recurring events (**requires to set "type" to rrule**) For example, to have a recurring event on the first day of each month, set the type to `rrule` and set the `FREQ` to `MONTHLY` and `BYMONTHDAY` to `1`. Most common `rrule` options from the [iCalendar Spec](https://tools.ietf.org/html/rfc5545) are supported.       | **Note**: Attributes specifying the duration in `RRULE` are not supported (for example, `DTSTART`, `DTEND`, `DURATION`). More examples available in this [downtime guide](https://docs.datadoghq.com/monitors/guide/suppress-alert-with-downtimes.md?tab=api) |
| recurrence   | type                             | string   | The type of recurrence. Choose from `days`, `weeks`, `months`, `years`, `rrule`.                                                                                                                                                                                                                                                                                 |
| recurrence   | until_date                       | int64    | The date at which the recurrence should end as a POSIX timestamp. `until_occurences` and `until_date` are mutually exclusive.                                                                                                                                                                                                                                    |
| recurrence   | until_occurrences                | int32    | How many times the downtime is rescheduled. `until_occurences` and `until_date` are mutually exclusive.                                                                                                                                                                                                                                                          |
| recurrence   | week_days                        | [string] | A list of week days to repeat on. Choose from `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when type is weeks. First letter must be capitalized.                                                                                                                                                                                           |
| active_child | scope                            | [string] | The scope(s) to which the downtime applies and must be in `key:value` format. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`).                                                                    |
| active_child | start                            | int64    | POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.                                                                                                                                                                                                                                                            |
| active_child | timezone                         | string   | The timezone in which to display the downtime's start and end times in Datadog applications.                                                                                                                                                                                                                                                                     |
| active_child | updater_id                       | int32    | ID of the last user that updated the downtime.                                                                                                                                                                                                                                                                                                                   |
|              | canceled                         | int64    | If a scheduled downtime is canceled.                                                                                                                                                                                                                                                                                                                             |
|              | creator_id                       | int32    | User ID of the downtime creator.                                                                                                                                                                                                                                                                                                                                 |
|              | disabled                         | boolean  | If a downtime has been disabled.                                                                                                                                                                                                                                                                                                                                 |
|              | downtime_type                    | int32    | `0` for a downtime applied on `*` or all, `1` when the downtime is only scoped to hosts, or `2` when the downtime is scoped to anything but hosts.                                                                                                                                                                                                               |
|              | end                              | int64    | POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.                                                                                                                                                                                                                                                |
|              | id                               | int64    | The downtime ID.                                                                                                                                                                                                                                                                                                                                                 |
|              | message                          | string   | A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same `@username` notation as events.                                                                                                                                                                                                   |
|              | monitor_id                       | int64    | A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.                                                                                                                                                                                                                                                           |
|              | monitor_tags                     | [string] | A comma-separated list of monitor tags. For example, tags that are applied directly to monitors, not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags. For example, `service:postgres` **AND** `team:frontend`. |
|              | mute_first_recovery_notification | boolean  | If the first recovery notification during a downtime should be muted.                                                                                                                                                                                                                                                                                            |
|              | notify_end_states                | [string] | States for which `notify_end_types` sends out notifications for.                                                                                                                                                                                                                                                                                                 |
|              | notify_end_types                 | [string] | If set, notifies if a monitor is in an alert-worthy state (`ALERT`, `WARNING`, or `NO DATA`) when this downtime expires or is canceled. Applied to monitors that change states during the downtime (such as from `OK` to `ALERT`, `WARNING`, or `NO DATA`), and to monitors that already have an alert-worthy state when downtime begins.                        |
|              | parent_id                        | int64    | ID of the parent Downtime.                                                                                                                                                                                                                                                                                                                                       |
|              | recurrence                       | object   | An object defining the recurrence of the downtime.                                                                                                                                                                                                                                                                                                               |
| recurrence   | period                           | int32    | How often to repeat as an integer. For example, to repeat every 3 days, select a type of `days` and a period of `3`.                                                                                                                                                                                                                                             |
| recurrence   | rrule                            | string   | The `RRULE` standard for defining recurring events (**requires to set "type" to rrule**) For example, to have a recurring event on the first day of each month, set the type to `rrule` and set the `FREQ` to `MONTHLY` and `BYMONTHDAY` to `1`. Most common `rrule` options from the [iCalendar Spec](https://tools.ietf.org/html/rfc5545) are supported.       | **Note**: Attributes specifying the duration in `RRULE` are not supported (for example, `DTSTART`, `DTEND`, `DURATION`). More examples available in this [downtime guide](https://docs.datadoghq.com/monitors/guide/suppress-alert-with-downtimes.md?tab=api) |
| recurrence   | type                             | string   | The type of recurrence. Choose from `days`, `weeks`, `months`, `years`, `rrule`.                                                                                                                                                                                                                                                                                 |
| recurrence   | until_date                       | int64    | The date at which the recurrence should end as a POSIX timestamp. `until_occurences` and `until_date` are mutually exclusive.                                                                                                                                                                                                                                    |
| recurrence   | until_occurrences                | int32    | How many times the downtime is rescheduled. `until_occurences` and `until_date` are mutually exclusive.                                                                                                                                                                                                                                                          |
| recurrence   | week_days                        | [string] | A list of week days to repeat on. Choose from `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when type is weeks. First letter must be capitalized.                                                                                                                                                                                           |
|              | scope                            | [string] | The scope(s) to which the downtime applies and must be in `key:value` format. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`).                                                                    |
|              | start                            | int64    | POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.                                                                                                                                                                                                                                                            |
|              | timezone                         | string   | The timezone in which to display the downtime's start and end times in Datadog applications.                                                                                                                                                                                                                                                                     |
|              | updater_id                       | int32    | ID of the last user that updated the downtime.                                                                                                                                                                                                                                                                                                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "active": true,
  "active_child": {
    "active": true,
    "canceled": 1412799983,
    "creator_id": 123456,
    "disabled": false,
    "downtime_type": 2,
    "end": 1412793983,
    "id": 1626,
    "message": "Message on the downtime",
    "monitor_id": 123456,
    "monitor_tags": [
      "*"
    ],
    "mute_first_recovery_notification": false,
    "notify_end_states": [
      "alert",
      "no data",
      "warn"
    ],
    "notify_end_types": [
      "canceled",
      "expired"
    ],
    "parent_id": 123,
    "recurrence": {
      "period": 1,
      "rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
      "type": "weeks",
      "until_date": 1447786293,
      "until_occurrences": 2,
      "week_days": [
        "Mon",
        "Tue"
      ]
    },
    "scope": [
      "env:staging"
    ],
    "start": 1412792983,
    "timezone": "America/New_York",
    "updater_id": 123456
  },
  "canceled": 1412799983,
  "creator_id": 123456,
  "disabled": false,
  "downtime_type": 2,
  "end": 1412793983,
  "id": 1625,
  "message": "Message on the downtime",
  "monitor_id": 123456,
  "monitor_tags": [
    "*"
  ],
  "mute_first_recovery_notification": false,
  "notify_end_states": [
    "alert",
    "no data",
    "warn"
  ],
  "notify_end_types": [
    "canceled",
    "expired"
  ],
  "parent_id": 123,
  "recurrence": {
    "period": 1,
    "rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
    "type": "weeks",
    "until_date": 1447786293,
    "until_occurrences": 2,
    "week_days": [
      "Mon",
      "Tue"
    ]
  },
  "scope": [
    "env:staging"
  ],
  "start": 1412792983,
  "timezone": "America/New_York",
  "updater_id": 123456
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="404" %}
Monitor Not Found error
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export monitor_id="CHANGE_ME" \# Curl command curl -X GET "https://api.datadoghq.com/api/v1/monitor/${monitor_id}/downtimes" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get active downtimes for a monitor returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.downtimes_api import DowntimesApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DowntimesApi(api_client)
    response = api_instance.list_monitor_downtimes(
        monitor_id=9223372036854775807,
    )

    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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Get active downtimes for a monitor returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::DowntimesAPI.new
p api_instance.list_monitor_downtimes(9223372036854775807)
```

#### 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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Get active downtimes for a monitor 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/datadogV1"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewDowntimesApi(apiClient)
	resp, r, err := api.ListMonitorDowntimes(ctx, 9223372036854775807)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `DowntimesApi.ListMonitorDowntimes`:\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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Get active downtimes for a monitor returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.DowntimesApi;
import com.datadog.api.client.v1.model.Downtime;
import java.util.List;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    DowntimesApi apiInstance = new DowntimesApi(defaultClient);

    try {
      List<Downtime> result = apiInstance.listMonitorDowntimes(9223372036854775807L);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DowntimesApi#listMonitorDowntimes");
      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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get active downtimes for a monitor returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_downtimes::DowntimesAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = DowntimesAPI::with_config(configuration);
    let resp = api.list_monitor_downtimes(9223372036854775807).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
/**
 * Get active downtimes for a monitor returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);

const params: v1.DowntimesApiListMonitorDowntimesRequest = {
  monitorId: 9223372036854775807,
};

apiInstance
  .listMonitorDowntimes(params)
  .then((data: v1.Downtime[]) => {
    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_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
