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

# Update an Opsgenie account{% #update-an-opsgenie-account %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                                          |
| ----------------- | ------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/integration/opsgenie/accounts/{account_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/integration/opsgenie/accounts/{account_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/integration/opsgenie/accounts/{account_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/integration/opsgenie/accounts/{account_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/integration/opsgenie/accounts/{account_id}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/integration/opsgenie/accounts/{account_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/integration/opsgenie/accounts/{account_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/integration/opsgenie/accounts/{account_id} |

### Overview

Update a single Opsgenie account in the Datadog Opsgenie integration. This endpoint requires the `manage_integrations` permission.

### Arguments

#### Path Parameters

| Name                         | Type   | Description                       |
| ---------------------------- | ------ | --------------------------------- |
| account_id [*required*] | string | The UUID of the Opsgenie account. |

### Request

#### Body Data (required)

Opsgenie account payload.

{% tab title="Model" %}

| Parent field | Field                        | Type   | Description                                                              |
| ------------ | ---------------------------- | ------ | ------------------------------------------------------------------------ |
|              | data [*required*]       | object | Opsgenie account data for an update request.                             |
| data         | attributes [*required*] | object | The Opsgenie account attributes for an update request.                   |
| attributes   | api_key                      | string | The Opsgenie API key for your Opsgenie account.                          |
| attributes   | region                       | enum   | The region for the Opsgenie service. Allowed enum values: `us,eu,custom` |
| data         | id [*required*]         | string | The ID of the Opsgenie account.                                          |
| data         | type [*required*]       | enum   | Opsgenie account resource type. Allowed enum values: `opsgenie-account`  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "api_key": "00000000-0000-0000-0000-000000000000",
      "region": "us"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "opsgenie-account"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing an Opsgenie account.

| Parent field | Field                        | Type   | Description                                                              |
| ------------ | ---------------------------- | ------ | ------------------------------------------------------------------------ |
|              | data [*required*]       | object | Opsgenie account data from a response.                                   |
| data         | attributes [*required*] | object | The attributes from an Opsgenie account response.                        |
| attributes   | region                       | enum   | The region for the Opsgenie service. Allowed enum values: `us,eu,custom` |
| data         | id [*required*]         | string | The ID of the Opsgenie account.                                          |
| data         | type [*required*]       | enum   | Opsgenie account resource type. Allowed enum values: `opsgenie-account`  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "region": "us"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "opsgenie-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="422" %}
The server cannot process the request because it contains invalid data.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "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
# 
 \# Path parameters export account_id="CHANGE_ME" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/integration/opsgenie/accounts/${account_id}" \
-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",
      "region": "us"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "opsgenie-account"
  }
}
EOF 
                
{% /tab %}
