---
title: Update the Statuspage account
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Statuspage Integration
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Update the Statuspage account{% #update-the-statuspage-account %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                              |
| ----------------- | ------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/integration/statuspage/account |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/integration/statuspage/account |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/integration/statuspage/account      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/integration/statuspage/account      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/integration/statuspage/account  |
| uk1.datadoghq.com | PATCH https://api.uk1.datadoghq.com/api/v2/integration/statuspage/account |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/integration/statuspage/account     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/integration/statuspage/account |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/integration/statuspage/account |

### Overview

Update the Statuspage account configured for your organization. This endpoint requires the `manage_integrations` permission.

### Request

#### Body Data (required)

Statuspage account payload.

{% tab title="Model" %}

| Parent field | Field                        | Type   | Description                                                                 |
| ------------ | ---------------------------- | ------ | --------------------------------------------------------------------------- |
|              | data [*required*]       | object | Statuspage account data for an update request.                              |
| data         | attributes [*required*] | object | The Statuspage account attributes for an update request.                    |
| attributes   | api_key                      | string | The Statuspage API key for your Statuspage account.                         |
| data         | type [*required*]       | enum   | Statuspage account resource type. Allowed enum values: `statuspage-account` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "api_key": "00000000-0000-0000-0000-000000000000"
    },
    "type": "statuspage-account"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a Statuspage account.

| Parent field | Field                        | Type   | Description                                                                              |
| ------------ | ---------------------------- | ------ | ---------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | Statuspage account data from a response.                                                 |
| data         | attributes [*required*] | object | The attributes from a Statuspage account response.                                       |
| attributes   | api_key                      | string | The Statuspage API key for your Statuspage account. The value is always returned masked. |
| data         | type [*required*]       | enum   | Statuspage account resource type. Allowed enum values: `statuspage-account`              |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "api_key": "*****"
    },
    "type": "statuspage-account"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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="403" %}
Forbidden
{% 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="404" %}
Not Found
{% 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

##### 
                  \## default
# 
 \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/integration/statuspage/account" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "api_key": "00000000-0000-0000-0000-000000000000"
    },
    "type": "statuspage-account"
  }
}
EOF 
                
##### 

```python
"""
Update the Statuspage account returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.statuspage_integration_api import StatuspageIntegrationApi
from datadog_api_client.v2.model.statuspage_account_type import StatuspageAccountType
from datadog_api_client.v2.model.statuspage_account_update_attributes import StatuspageAccountUpdateAttributes
from datadog_api_client.v2.model.statuspage_account_update_data import StatuspageAccountUpdateData
from datadog_api_client.v2.model.statuspage_account_update_request import StatuspageAccountUpdateRequest

body = StatuspageAccountUpdateRequest(
    data=StatuspageAccountUpdateData(
        attributes=StatuspageAccountUpdateAttributes(
            api_key="00000000-0000-0000-0000-000000000000",
        ),
        type=StatuspageAccountType.STATUSPAGE_ACCOUNT,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = StatuspageIntegrationApi(api_client)
    response = api_instance.update_statuspage_account(body=body)

    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="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Update the Statuspage account returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new

body = DatadogAPIClient::V2::StatuspageAccountUpdateRequest.new({
  data: DatadogAPIClient::V2::StatuspageAccountUpdateData.new({
    attributes: DatadogAPIClient::V2::StatuspageAccountUpdateAttributes.new({
      api_key: "00000000-0000-0000-0000-000000000000",
    }),
    type: DatadogAPIClient::V2::StatuspageAccountType::STATUSPAGE_ACCOUNT,
  }),
})
p api_instance.update_statuspage_account(body)
```

#### 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="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Update the Statuspage account 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() {
	body := datadogV2.StatuspageAccountUpdateRequest{
		Data: datadogV2.StatuspageAccountUpdateData{
			Attributes: datadogV2.StatuspageAccountUpdateAttributes{
				ApiKey: datadog.PtrString("00000000-0000-0000-0000-000000000000"),
			},
			Type: datadogV2.STATUSPAGEACCOUNTTYPE_STATUSPAGE_ACCOUNT,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewStatuspageIntegrationApi(apiClient)
	resp, r, err := api.UpdateStatuspageAccount(ctx, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `StatuspageIntegrationApi.UpdateStatuspageAccount`:\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="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Update the Statuspage account returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.StatuspageIntegrationApi;
import com.datadog.api.client.v2.model.StatuspageAccountResponse;
import com.datadog.api.client.v2.model.StatuspageAccountType;
import com.datadog.api.client.v2.model.StatuspageAccountUpdateAttributes;
import com.datadog.api.client.v2.model.StatuspageAccountUpdateData;
import com.datadog.api.client.v2.model.StatuspageAccountUpdateRequest;

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

    StatuspageAccountUpdateRequest body =
        new StatuspageAccountUpdateRequest()
            .data(
                new StatuspageAccountUpdateData()
                    .attributes(
                        new StatuspageAccountUpdateAttributes()
                            .apiKey("00000000-0000-0000-0000-000000000000"))
                    .type(StatuspageAccountType.STATUSPAGE_ACCOUNT));

    try {
      StatuspageAccountResponse result = apiInstance.updateStatuspageAccount(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling StatuspageIntegrationApi#updateStatuspageAccount");
      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="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Update the Statuspage account returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_statuspage_integration::StatuspageIntegrationAPI;
use datadog_api_client::datadogV2::model::StatuspageAccountType;
use datadog_api_client::datadogV2::model::StatuspageAccountUpdateAttributes;
use datadog_api_client::datadogV2::model::StatuspageAccountUpdateData;
use datadog_api_client::datadogV2::model::StatuspageAccountUpdateRequest;

#[tokio::main]
async fn main() {
    let body = StatuspageAccountUpdateRequest::new(StatuspageAccountUpdateData::new(
        StatuspageAccountUpdateAttributes::new()
            .api_key("00000000-0000-0000-0000-000000000000".to_string()),
        StatuspageAccountType::STATUSPAGE_ACCOUNT,
    ));
    let configuration = datadog::Configuration::new();
    let api = StatuspageIntegrationAPI::with_config(configuration);
    let resp = api.update_statuspage_account(body).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="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Update the Statuspage account returns "OK" response
 */

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

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

const params: v2.StatuspageIntegrationApiUpdateStatuspageAccountRequest = {
  body: {
    data: {
      attributes: {
        apiKey: "00000000-0000-0000-0000-000000000000",
      },
      type: "statuspage-account",
    },
  },
};

apiInstance
  .updateStatuspageAccount(params)
  .then((data: v2.StatuspageAccountResponse) => {
    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="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}
