> For the complete documentation index, see [llms.txt](https://docs.enlyze.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enlyze.com/en/enlyze-api/api-reference/downtimes.md).

# Downtimes

## Get Downtimes

> Returns a list of downtimes in your organization.

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Downtimes"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"NullSentinel":{"type":"string","const":"null"},"DowntimeReasonState":{"type":"string","enum":["active","archived"],"title":"DowntimeReasonState"},"PaginatedDowntimes":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Downtime"},"type":"array","title":"Data"},"metadata":{"$ref":"#/components/schemas/Metadata","description":"This field contains pagination metadata."}},"additionalProperties":false,"type":"object","required":["data","metadata"],"title":"PaginatedDowntimes"},"Downtime":{"properties":{"uuid":{"type":"string","format":"uuid","title":"Downtime UUID","description":"The UUID of the downtime."},"machine":{"type":"string","format":"uuid","title":"Machine","description":"The UUID of the machine the downtime was observed on."},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment","description":"Comment associated with the downtime."},"type":{"$ref":"#/components/schemas/DowntimeType","title":"Downtime Type","description":"Type of the downtime."},"updated":{"anyOf":[{"$ref":"#/components/schemas/DowntimeUpdateInformation"},{"type":"null"}],"title":"Downtime Update Information","description":"Information about the update operation if the downtime was updated."},"reason":{"anyOf":[{"$ref":"#/components/schemas/DowntimeReason"},{"type":"null"}],"title":"Downtime Reason","description":"The reason this downtime occured."},"start":{"type":"string","format":"date-time","title":"Start","description":"The start of the downtime in ISO8601 format with timezone info."},"end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End","description":"The end of the downtime in ISO8601 format with timezone info. If the value of this field is `null`, the downtime is not yet over."}},"type":"object","required":["uuid","machine","comment","type","updated","reason","start","end"],"title":"Downtime"},"DowntimeType":{"type":"string","enum":["THRESHOLD","NO_DATA"],"title":"DowntimeType"},"DowntimeUpdateInformation":{"properties":{"first_name":{"type":"string","title":"First Name","description":"First name of the individual who updated the downtime."},"last_name":{"type":"string","title":"Last Name","description":"Last name of the individual who updated the downtime."},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","description":"The timestamp in which the update occurred at in ISO8601 format with timezone info."}},"type":"object","required":["first_name","last_name","timestamp"],"title":"DowntimeUpdateInformation"},"DowntimeReason":{"properties":{"uuid":{"type":"string","format":"uuid","title":"Downtime Reason UUID","description":"The UUID of the downtime reason."},"name":{"type":"string","title":"Downtime Reason Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Downtime Reason Description","description":"Free-text description of the downtime reason."},"category":{"$ref":"#/components/schemas/DowntimeCategory","title":"Downtime Reason Category","description":"Category of the downtime reason."},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Downtime Reason Group"},"state":{"$ref":"#/components/schemas/DowntimeReasonState","title":"Downtime Reason State","description":"Lifecycle state of the downtime reason."},"catalog":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Downtime Catalog","description":"UUID of the catalog this reason belongs to. Resolve it via `GET /api/v2/downtime-catalogs/{uuid}`. `null` for legacy reasons not yet migrated to a catalog (only reachable as an embedded reason on `GET /api/v2/downtimes`)."}},"type":"object","required":["uuid","name","category","group","state"],"title":"DowntimeReason"},"DowntimeCategory":{"type":"string","enum":["PLANNED","UNPLANNED","NOT_SCHEDULED","INVALID"],"title":"DowntimeCategory"},"Metadata":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pagination continuation point. Specify its value as the `cursor` parameter in a request with otherwise the same parameters to fetch the next page. `None`, if there is no more data to be fetched from the server."}},"additionalProperties":false,"type":"object","required":["next_cursor"],"title":"Metadata"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/downtimes":{"get":{"tags":["Downtimes"],"summary":"Get Downtimes","description":"Returns a list of downtimes in your organization.","operationId":"get_downtimes_v2_downtimes_get","parameters":[{"name":"uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"array","uniqueItems":true,"items":{"type":"string","format":"uuid"},"maxItems":50},{"type":"null"}],"title":"Downtime UUIDs","description":"Matches downtimes with any of these UUIDs."},"description":"Matches downtimes with any of these UUIDs."},{"name":"machine","in":"query","required":false,"schema":{"anyOf":[{"type":"array","uniqueItems":true,"items":{"type":"string","format":"uuid"},"maxItems":50},{"type":"null"}],"title":"Machine UUIDs","description":"Matches downtimes on any of these machines."},"description":"Matches downtimes on any of these machines."},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start","description":"Matches downtimes observed at or after this time."},"description":"Matches downtimes observed at or after this time."},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End","description":"Matches downtimes observed up to this time."},"description":"Matches downtimes observed up to this time."},{"name":"reason","in":"query","required":false,"schema":{"anyOf":[{"type":"array","uniqueItems":true,"items":{"anyOf":[{"type":"string","format":"uuid"},{"$ref":"#/components/schemas/NullSentinel"}]},"maxItems":50},{"type":"null"}],"title":"Downtime Reasons","description":"Matches downtimes labeled with any of these reasons. `null` matches downtimes with no reason."},"description":"Matches downtimes labeled with any of these reasons. `null` matches downtimes with no reason."},{"name":"reason_state","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DowntimeReasonState"},{"type":"null"}],"title":"Reason Lifecycle State","description":"`active` matches downtimes whose reason is active, `archived` those whose reason is archived. Neither matches unlabeled downtimes."},"description":"`active` matches downtimes whose reason is active, `archived` those whose reason is archived. Neither matches unlabeled downtimes."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","title":"Get page starting at cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"title":"Maximum number of results to return","description":"Caps the page size. Defaults to 1000, which is also the maximum; a value below 1 or above 1000 is rejected.","default":1000},"description":"Caps the page size. Defaults to 1000, which is also the maximum; a value below 1 or above 1000 is rejected."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDowntimes"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Bulk Update Downtimes

> Apply a downtime reason to every downtime matching \`filters\` (the same filters as \`GET /downtimes\` — e.g. \`reason\_state=archived\` to target downtimes whose reason was archived). The response reports how many downtimes were relabeled and which machines they belong to. Pass \`dry\_run=true\` to preview that scope without changing anything.

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Downtimes"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"DowntimeBulkUpdateRequest":{"properties":{"filters":{"$ref":"#/components/schemas/DowntimeFilters","title":"Selection","description":"Which downtimes to relabel."},"update":{"$ref":"#/components/schemas/DowntimeBulkUpdate","title":"Update","description":"The change to apply to the selection."}},"type":"object","required":["filters","update"],"title":"DowntimeBulkUpdateRequest"},"DowntimeFilters":{"properties":{"uuid":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":50,"uniqueItems":true},{"type":"null"}],"title":"Downtime UUIDs","description":"Matches downtimes with any of these UUIDs."},"machine":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":50,"uniqueItems":true},{"type":"null"}],"title":"Machine UUIDs","description":"Matches downtimes on any of these machines."},"start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start","description":"Matches downtimes observed at or after this time."},"end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End","description":"Matches downtimes observed up to this time."},"reason":{"anyOf":[{"items":{"anyOf":[{"type":"string","format":"uuid"},{"$ref":"#/components/schemas/NullSentinel"}]},"type":"array","maxItems":50,"uniqueItems":true},{"type":"null"}],"title":"Downtime Reasons","description":"Matches downtimes labeled with any of these reasons. `null` matches downtimes with no reason."},"reason_state":{"anyOf":[{"$ref":"#/components/schemas/DowntimeReasonState"},{"type":"null"}],"title":"Reason Lifecycle State","description":"`active` matches downtimes whose reason is active, `archived` those whose reason is archived. Neither matches unlabeled downtimes."}},"type":"object","title":"DowntimeFilters"},"NullSentinel":{"type":"string","const":"null"},"DowntimeReasonState":{"type":"string","enum":["active","archived"],"title":"DowntimeReasonState"},"DowntimeBulkUpdate":{"properties":{"reason":{"type":"string","format":"uuid","title":"Downtime Reason","description":"UUID of the reason to apply to the selected downtimes."}},"type":"object","required":["reason"],"title":"DowntimeBulkUpdate"},"DowntimeBulkUpdateResult":{"properties":{"affected_count":{"type":"integer","title":"Affected Count","description":"Number of downtimes the reason was applied to."},"affected_machines":{"items":{"type":"string","format":"uuid"},"type":"array","uniqueItems":true,"title":"Affected Machines","description":"The machines those downtimes belong to — the scope of the change."}},"type":"object","required":["affected_count","affected_machines"],"title":"DowntimeBulkUpdateResult"},"LabelingReasonArchivedError":{"properties":{"type":{"type":"string","const":"archived_reason","title":"Type","default":"archived_reason"},"detail":{"type":"string","title":"Detail","description":"Human-readable explanation."}},"type":"object","required":["detail"],"title":"LabelingReasonArchivedError"},"LabelingReasonNotFoundError":{"properties":{"type":{"type":"string","const":"reason_not_found","title":"Type","default":"reason_not_found"}},"type":"object","title":"LabelingReasonNotFoundError"},"DowntimeBulkUpdateMissingAssignments":{"properties":{"type":{"type":"string","const":"missing_assignments","title":"Type","default":"missing_assignments"},"detail":{"type":"string","title":"Detail","description":"Human-readable explanation."},"catalog":{"type":"string","format":"uuid","title":"Catalog","description":"The catalog the reason belongs to."},"missing_machines":{"items":{"type":"string","format":"uuid"},"type":"array","uniqueItems":true,"title":"Missing Machines","description":"Machines the matched downtimes occurred on that the catalog is not assigned to."}},"type":"object","required":["detail","catalog","missing_machines"],"title":"DowntimeBulkUpdateMissingAssignments"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/downtimes/bulk":{"patch":{"tags":["Downtimes"],"summary":"Bulk Update Downtimes","description":"Apply a downtime reason to every downtime matching `filters` (the same filters as `GET /downtimes` — e.g. `reason_state=archived` to target downtimes whose reason was archived). The response reports how many downtimes were relabeled and which machines they belong to. Pass `dry_run=true` to preview that scope without changing anything.","operationId":"bulk_update_downtimes_v2_downtimes_bulk_patch","parameters":[{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","title":"Preview the update without applying it.","description":"If true, nothing is changed; the response reports what a real update would affect.","default":false},"description":"If true, nothing is changed; the response reports what a real update would affect."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DowntimeBulkUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DowntimeBulkUpdateResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/LabelingReasonArchivedError"}],"discriminator":{"propertyName":"type","mapping":{"archived_reason":"#/components/schemas/LabelingReasonArchivedError"}},"title":"Response 400 Bulk Update Downtimes V2 Downtimes Bulk Patch"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/LabelingReasonNotFoundError"}],"discriminator":{"propertyName":"type","mapping":{"reason_not_found":"#/components/schemas/LabelingReasonNotFoundError"}},"title":"Response 404 Bulk Update Downtimes V2 Downtimes Bulk Patch"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/DowntimeBulkUpdateMissingAssignments"}],"discriminator":{"propertyName":"type","mapping":{"missing_assignments":"#/components/schemas/DowntimeBulkUpdateMissingAssignments"}},"title":"Response 409 Bulk Update Downtimes V2 Downtimes Bulk Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
