---
title: Edit maintenance update
description: Edits the message of a specific maintenance update.
breadcrumbs: Documentation > API > Edit maintenance update
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# Edit maintenance update

## v2 (latest)

| Datadog site      | API endpoint                                                                                                       |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}      |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id} |
| uk1.datadoghq.com | PATCH https://api.uk1.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id} |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}  |

### Overview

Edits the message of a specific maintenance update. Editing is allowed regardless of the parent maintenance's status, including completed and canceled maintenances.

This endpoint requires the `status_pages_incident_write` permission.

OAuth apps require the `status_pages_incident_write` authorization [scope](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/fr/api/latest/scopes.md#status-pages) to access this endpoint.

### Arguments

#### Path Parameters

| Field                       | Type   | Description                       |
| --------------------------- | ------ | --------------------------------- |
| page_id [*required*]        | string | The ID of the status page.        |
| maintenance_id [*required*] | string | The ID of the maintenance.        |
| update_id [*required*]      | string | The ID of the maintenance update. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field | Field             | Type   | Description                                                                                                    |
| ------------ | ----------------- | ------ | -------------------------------------------------------------------------------------------------------------- |
|              | data              | object | The data object for editing a maintenance update.                                                              |
| data         | attributes        | object | Attributes for editing a maintenance update.                                                                   |
| attributes   | description       | string | The message body of the update.                                                                                |
| data         | id [*required*]   | string | The ID of the maintenance update to edit. Must match the `update_id` path parameter.                           |
| data         | type [*required*] | enum   | Maintenance updates resource type. Allowed enum values: `maintenance_updates`. Default: `maintenance_updates`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "description": ""
    },
    "id": "1234abcd-12ab-34cd-56ef-123456abcdef",
    "type": "maintenance_updates"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response object for a maintenance update.

| Parent field          | Field                 | Type      | Description                                                                                                     |
| --------------------- | --------------------- | --------- | --------------------------------------------------------------------------------------------------------------- |
|                       | data                  | object    | The data object for a maintenance update.                                                                       |
| data                  | attributes            | object    | Attributes of a maintenance update resource.                                                                    |
| attributes            | components_affected   | [object]  | Components affected at the time of the update.                                                                  |
| components_affected   | id [*required*]       | uuid      | The ID of the component. Must be a component of type `component`.                                               |
| components_affected   | name                  | string    | The name of the component. Read-only.                                                                           |
| components_affected   | status [*required*]   | enum      | The status of the component. Allowed enum values: `operational`, `maintenance`.                                 |
| attributes            | created_at            | date-time | The date and time the update was created.                                                                       |
| attributes            | description           | string    | The message body of the update.                                                                                 |
| attributes            | manual_transition     | boolean   | Whether the update was applied manually by a user (true) or automatically by the system (false).                |
| attributes            | modified_at           | date-time | The date and time the update was last modified.                                                                 |
| attributes            | started_at            | date-time | The date and time the update started.                                                                           |
| attributes            | status                | enum      | The status of the maintenance update. Allowed enum values: `scheduled`, `in_progress`, `completed`, `canceled`. |
| data                  | id [*required*]       | uuid      | The ID of the maintenance update.                                                                               |
| data                  | relationships         | object    | Relationships of a maintenance update resource.                                                                 |
| relationships         | created_by_user       | object    | A user relationship of a maintenance update.                                                                    |
| created_by_user       | data [*required*]     | object    | The data object identifying a Datadog user linked to a maintenance update.                                      |
| data                  | id [*required*]       | uuid      | The ID of the Datadog user.                                                                                     |
| data                  | type [*required*]     | enum      | Users resource type. Allowed enum values: `users`. Default: `users`.                                            |
| relationships         | last_modified_by_user | object    | A user relationship of a maintenance update.                                                                    |
| last_modified_by_user | data [*required*]     | object    | The data object identifying a Datadog user linked to a maintenance update.                                      |
| data                  | id [*required*]       | uuid      | The ID of the Datadog user.                                                                                     |
| data                  | type [*required*]     | enum      | Users resource type. Allowed enum values: `users`. Default: `users`.                                            |
| relationships         | maintenance           | object    | The parent maintenance of the update.                                                                           |
| maintenance           | data [*required*]     | object    | The maintenance linked to a maintenance update.                                                                 |
| data                  | id [*required*]       | uuid      | The ID of the maintenance.                                                                                      |
| data                  | type [*required*]     | enum      | Maintenances resource type. Allowed enum values: `maintenances`. Default: `maintenances`.                       |
| data                  | type [*required*]     | enum      | Maintenance updates resource type. Allowed enum values: `maintenance_updates`. Default: `maintenance_updates`.  |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "components_affected": [
        {
          "id": "1234abcd-12ab-34cd-56ef-123456abcdef",
          "name": "string",
          "status": "operational"
        }
      ],
      "created_at": "2019-09-19T10:00:00.000Z",
      "description": "string",
      "manual_transition": false,
      "modified_at": "2019-09-19T10:00:00.000Z",
      "started_at": "2019-09-19T10:00:00.000Z",
      "status": "string"
    },
    "id": "1234abcd-12ab-34cd-56ef-123456abcdef",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "",
          "type": "users"
        }
      },
      "maintenance": {
        "data": {
          "id": "",
          "type": "maintenances"
        }
      }
    },
    "type": "maintenance_updates"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export page_id="CHANGE_ME"
export maintenance_id="CHANGE_ME"
export update_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/statuspages/${page_id}/maintenances/${maintenance_id}/updates/${update_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "We have completed maintenance on the API to improve performance."
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "type": "maintenance_updates"
  }
}
EOF
```
{% /tab %}

{% tab label="Go" %}
```go
// Edit maintenance update 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"
	"github.com/google/uuid"
)

func main() {
	body := datadogV2.PatchMaintenanceUpdateRequest{
		Data: &datadogV2.PatchMaintenanceUpdateRequestData{
			Attributes: &datadogV2.PatchMaintenanceUpdateRequestDataAttributes{
				Description: datadog.PtrString("We have completed maintenance on the API to improve performance."),
			},
			Id:   "00000000-0000-0000-0000-000000000000",
			Type: datadogV2.PATCHMAINTENANCEUPDATEREQUESTDATATYPE_MAINTENANCE_UPDATES,
		},
	}
	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.NewStatusPagesApi(apiClient)
	resp, r, err := api.PatchMaintenanceUpdate(ctx, uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body)

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

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

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
```
{% /tab %}

{% tab label="Java" %}
```java
// Edit maintenance update returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.StatusPagesApi;
import com.datadog.api.client.v2.model.MaintenanceUpdate;
import com.datadog.api.client.v2.model.PatchMaintenanceUpdateRequest;
import com.datadog.api.client.v2.model.PatchMaintenanceUpdateRequestData;
import com.datadog.api.client.v2.model.PatchMaintenanceUpdateRequestDataAttributes;
import com.datadog.api.client.v2.model.PatchMaintenanceUpdateRequestDataType;
import java.util.UUID;

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

    PatchMaintenanceUpdateRequest body =
        new PatchMaintenanceUpdateRequest()
            .data(
                new PatchMaintenanceUpdateRequestData()
                    .attributes(
                        new PatchMaintenanceUpdateRequestDataAttributes()
                            .description(
                                "We have completed maintenance on the API to improve performance."))
                    .id("00000000-0000-0000-0000-000000000000")
                    .type(PatchMaintenanceUpdateRequestDataType.MAINTENANCE_UPDATES));

    try {
      MaintenanceUpdate result =
          apiInstance.patchMaintenanceUpdate(
              UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
              UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
              UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
              body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling StatusPagesApi#patchMaintenanceUpdate");
      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://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
```
{% /tab %}

{% tab label="Python" %}
```python
"""
Edit maintenance update returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.status_pages_api import StatusPagesApi
from datadog_api_client.v2.model.patch_maintenance_update_request import PatchMaintenanceUpdateRequest
from datadog_api_client.v2.model.patch_maintenance_update_request_data import PatchMaintenanceUpdateRequestData
from datadog_api_client.v2.model.patch_maintenance_update_request_data_attributes import (
    PatchMaintenanceUpdateRequestDataAttributes,
)
from datadog_api_client.v2.model.patch_maintenance_update_request_data_type import PatchMaintenanceUpdateRequestDataType
from uuid import UUID

body = PatchMaintenanceUpdateRequest(
    data=PatchMaintenanceUpdateRequestData(
        attributes=PatchMaintenanceUpdateRequestDataAttributes(
            description="We have completed maintenance on the API to improve performance.",
        ),
        id="00000000-0000-0000-0000-000000000000",
        type=PatchMaintenanceUpdateRequestDataType.MAINTENANCE_UPDATES,
    ),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = StatusPagesApi(api_client)
    response = api_instance.patch_maintenance_update(
        page_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
        maintenance_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
        update_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
        body=body,
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
```
{% /tab %}

{% tab label="Ruby" %}
```ruby
# Edit maintenance update returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::StatusPagesAPI.new

body = DatadogAPIClient::V2::PatchMaintenanceUpdateRequest.new({
  data: DatadogAPIClient::V2::PatchMaintenanceUpdateRequestData.new({
    attributes: DatadogAPIClient::V2::PatchMaintenanceUpdateRequestDataAttributes.new({
      description: "We have completed maintenance on the API to improve performance.",
    }),
    id: "00000000-0000-0000-0000-000000000000",
    type: DatadogAPIClient::V2::PatchMaintenanceUpdateRequestDataType::MAINTENANCE_UPDATES,
  }),
})
p api_instance.patch_maintenance_update("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
```
{% /tab %}

{% tab label="Rust" %}
```rust
// Edit maintenance update returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
use datadog_api_client::datadogV2::model::PatchMaintenanceUpdateRequest;
use datadog_api_client::datadogV2::model::PatchMaintenanceUpdateRequestData;
use datadog_api_client::datadogV2::model::PatchMaintenanceUpdateRequestDataAttributes;
use datadog_api_client::datadogV2::model::PatchMaintenanceUpdateRequestDataType;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body = PatchMaintenanceUpdateRequest::new().data(
        PatchMaintenanceUpdateRequestData::new(
            "00000000-0000-0000-0000-000000000000".to_string(),
            PatchMaintenanceUpdateRequestDataType::MAINTENANCE_UPDATES,
        )
        .attributes(
            PatchMaintenanceUpdateRequestDataAttributes::new().description(
                "We have completed maintenance on the API to improve performance.".to_string(),
            ),
        ),
    );
    let configuration = datadog::Configuration::new();
    let api = StatusPagesAPI::with_config(configuration);
    let resp = api
        .patch_maintenance_update(
            Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
            Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
            Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
            body,
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
```
{% /tab %}

{% tab label="TypeScript" %}
```typescript
/**
 * Edit maintenance update 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.StatusPagesApi(configuration);

const params: v2.StatusPagesApiPatchMaintenanceUpdateRequest = {
  body: {
    data: {
      attributes: {
        description:
          "We have completed maintenance on the API to improve performance.",
      },
      id: "00000000-0000-0000-0000-000000000000",
      type: "maintenance_updates",
    },
  },
  pageId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
  maintenanceId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
  updateId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
};

apiInstance
  .patchMaintenanceUpdate(params)
  .then((data: v2.MaintenanceUpdate) => {
    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://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"
```
{% /tab %}
{% /tabs %}
