---
title: "Add a test to a Synthetics downtime"
method: PUT
path: "/api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}"
tags: ["Synthetics"]
---

# Add a test to a Synthetics downtime

`PUT /api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Associate a Synthetics test with a downtime.

## Path parameters

- `downtime_id` string, required
- `test_id` string, required

## Response `200`

OK

- SyntheticsDowntimeResponse: Response containing a single Synthetics downtime.
  - `data` SyntheticsDowntimeData, required: A Synthetics downtime object.
    - `attributes` SyntheticsDowntimeDataAttributesResponse, required: Attributes of a Synthetics downtime response object.
      - `createdAt` string, date-time, required: The timestamp when the downtime was created.
      - `createdBy` string, required: The UUID of the user who created the downtime.
      - `createdByName` string, required: The display name of the user who created the downtime.
      - `description` string, required: The description of the downtime.
      - `isEnabled` boolean, required: Whether the downtime is enabled.
      - `name` string, required: The name of the downtime.
      - `tags` string[], required: List of tags associated with a Synthetics downtime.
      - `testIds` string[], required: List of Synthetics test public IDs associated with a downtime.
      - `timeSlots` SyntheticsDowntimeTimeSlotResponse[], required: List of time slots in a Synthetics downtime response.
        - `duration` integer, required: The duration of the time slot in seconds.
        - `id` string, required: The unique identifier of the time slot.
        - `name` string: The label for the time slot.
        - `recurrence` SyntheticsDowntimeTimeSlotRecurrenceResponse: Recurrence settings returned in a Synthetics downtime time slot response.
          - `frequency` 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY', required: The recurrence frequency of a Synthetics downtime time slot.
          - `interval` integer, required: The interval between recurrences, relative to the frequency.
          - `until` SyntheticsDowntimeTimeSlotDate: A specific date and time used to define the start or end of a Synthetics downtime time slot.
            - `day` integer, required: The day component of the date (1-31).
            - `hour` integer, required: The hour component of the time (0-23).
            - `minute` integer, required: The minute component of the time (0-59).
            - `month` integer, required: The month component of the date (1-12).
            - `year` integer, required: The year component of the date.
          - `weekdayPositions` SyntheticsDowntimeWeekdayPosition[]: Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with `weekdays` to schedule occurrences such as "the first Monday of the month".
          - `weekdays` SyntheticsDowntimeWeekday[], required: Days of the week for a Synthetics downtime recurrence schedule.
        - `start` SyntheticsDowntimeTimeSlotDate, required: A specific date and time used to define the start or end of a Synthetics downtime time slot.
          - `day` integer, required: The day component of the date (1-31).
          - `hour` integer, required: The hour component of the time (0-23).
          - `minute` integer, required: The minute component of the time (0-59).
          - `month` integer, required: The month component of the date (1-12).
          - `year` integer, required: The year component of the date.
        - `timezone` string, required: The IANA timezone name for the time slot.
      - `updatedAt` string, date-time, required: The timestamp when the downtime was last updated.
      - `updatedBy` string, required: The UUID of the user who last updated the downtime.
      - `updatedByName` string, required: The display name of the user who last updated the downtime.
    - `id` string, required: The unique identifier of the downtime.
    - `type` 'downtime', required: The resource type for a Synthetics downtime.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/api-v2.md) - [All operations](https://skmtc.dev/datadog/apis/api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/api-v2/revisions/da68bf029e4c?raw)
