---
title: Get all Opsgenie accounts
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Opsgenie Integration
---

# Get all Opsgenie accounts{% #get-all-opsgenie-accounts %}
Copy pageCopied
{% tab title="v2" %}

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

### Overview

Get a list of all Opsgenie accounts from the Datadog Opsgenie integration. This endpoint requires the `integrations_read` permission.

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a list of Opsgenie accounts.

| Parent field | Field                        | Type     | Description                                                              |
| ------------ | ---------------------------- | -------- | ------------------------------------------------------------------------ |
|              | data [*required*]       | [object] | An array of Opsgenie accounts.                                           |
| 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="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="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

##### 
                  \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/integration/opsgenie/accounts" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
{% /tab %}
