---
title: Org Groups
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Org Groups
---

# Org Groups

Manage organization groups, memberships, policies, policy overrides, and policy configurations.

## List org groups{% #list-org-groups %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                        |
| ----------------- | --------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/org_groups |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/org_groups |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/org_groups      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/org_groups      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/org_groups  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/org_groups     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/org_groups |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/org_groups |

### Overview

List all organization groups that the requesting organization has access to. This endpoint requires the `org_group_read` permission.

### Arguments

#### Query Strings

| Name         | Type    | Description                                                                                                                                          |
| ------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| page[number] | integer | The page number to return.                                                                                                                           |
| page[size]   | integer | The number of items per page. Maximum is 1000.                                                                                                       |
| sort         | enum    | Field to sort org groups by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`. Allowed enum values: `name, -name, uuid, -uuid` |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of org groups.

| Parent field | Field                            | Type      | Description                                                                  |
| ------------ | -------------------------------- | --------- | ---------------------------------------------------------------------------- |
|              | data [*required*]           | [object]  | An array of org groups.                                                      |
| data         | attributes [*required*]     | object    | Attributes of an org group.                                                  |
| attributes   | created_at [*required*]     | date-time | Timestamp when the org group was created.                                    |
| attributes   | modified_at [*required*]    | date-time | Timestamp when the org group was last modified.                              |
| attributes   | name [*required*]           | string    | The name of the org group.                                                   |
| attributes   | owner_org_site [*required*] | string    | The site of the organization that owns this org group.                       |
| attributes   | owner_org_uuid [*required*] | uuid      | The UUID of the organization that owns this org group.                       |
| data         | id [*required*]             | uuid      | The ID of the org group.                                                     |
| data         | type [*required*]           | enum      | Org groups resource type. Allowed enum values: `org_groups`                  |
|              | links                            | object    | Pagination links for navigating between pages of an org group list response. |
| links        | first                            | string    | Link to the first page.                                                      |
| links        | last                             | string    | Link to the last page.                                                       |
| links        | next                             | string    | Link to the next page.                                                       |
| links        | prev                             | string    | Link to the previous page.                                                   |
| links        | self                             | string    | Link to the current page.                                                    |
|              | meta                             | object    | Pagination metadata for org group list responses.                            |
| meta         | page                             | object    | Page-based pagination details for org group list responses.                  |
| page         | first_number                     | int64     | First page number.                                                           |
| page         | last_number                      | int64     | Last page number.                                                            |
| page         | next_number                      | int64     | Next page number.                                                            |
| page         | number                           | int64     | Page number.                                                                 |
| page         | prev_number                      | int64     | Previous page number.                                                        |
| page         | size                             | int64     | Page size.                                                                   |
| page         | total                            | int64     | Total number of results.                                                     |
| page         | type                             | string    | Pagination type.                                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2024-01-15T10:30:00Z",
        "modified_at": "2024-01-15T10:30:00Z",
        "name": "My Org Group",
        "owner_org_site": "us1",
        "owner_org_uuid": "b2c3d4e5-f6a7-8901-bcde-f01234567890"
      },
      "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
      "type": "org_groups"
    }
  ],
  "links": {
    "first": "string",
    "last": "string",
    "next": "string",
    "prev": "string",
    "self": "string"
  },
  "meta": {
    "page": {
      "first_number": "integer",
      "last_number": "integer",
      "next_number": "integer",
      "number": "integer",
      "prev_number": "integer",
      "size": "integer",
      "total": "integer",
      "type": "number_size"
    }
  }
}
```

{% /tab %}

{% /tab %}

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

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

```python
"""
List org groups returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi

configuration = Configuration()
configuration.unstable_operations["list_org_groups"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.list_org_groups()

    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
# List org groups returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_org_groups".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
p api_instance.list_org_groups()
```

#### 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
// List org groups 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListOrgGroups", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.ListOrgGroups(ctx, *datadogV2.NewListOrgGroupsOptionalParameters())

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.ListOrgGroups`:\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
// List org groups returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupListResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.listOrgGroups", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      OrgGroupListResponse result = apiInstance.listOrgGroups();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#listOrgGroups");
      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
// List org groups returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::ListOrgGroupsOptionalParams;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListOrgGroups", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .list_org_groups(ListOrgGroupsOptionalParams::default())
        .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
/**
 * List org groups returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listOrgGroups"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

apiInstance
  .listOrgGroups()
  .then((data: v2.OrgGroupListResponse) => {
    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 %}

## Get an org group{% #get-an-org-group %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                       |
| ----------------- | ------------------------------------------------------------------ |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/org_groups/{org_group_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/org_groups/{org_group_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/org_groups/{org_group_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/org_groups/{org_group_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/org_groups/{org_group_id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/org_groups/{org_group_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/org_groups/{org_group_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/org_groups/{org_group_id} |

### Overview

Get a specific organization group by its ID. This endpoint requires the `org_group_read` permission.

### Arguments

#### Path Parameters

| Name                           | Type   | Description              |
| ------------------------------ | ------ | ------------------------ |
| org_group_id [*required*] | string | The ID of the org group. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single org group.

| Parent field | Field                            | Type      | Description                                                 |
| ------------ | -------------------------------- | --------- | ----------------------------------------------------------- |
|              | data [*required*]           | object    | An org group resource.                                      |
| data         | attributes [*required*]     | object    | Attributes of an org group.                                 |
| attributes   | created_at [*required*]     | date-time | Timestamp when the org group was created.                   |
| attributes   | modified_at [*required*]    | date-time | Timestamp when the org group was last modified.             |
| attributes   | name [*required*]           | string    | The name of the org group.                                  |
| attributes   | owner_org_site [*required*] | string    | The site of the organization that owns this org group.      |
| attributes   | owner_org_uuid [*required*] | uuid      | The UUID of the organization that owns this org group.      |
| data         | id [*required*]             | uuid      | The ID of the org group.                                    |
| data         | type [*required*]           | enum      | Org groups resource type. Allowed enum values: `org_groups` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T10:30:00Z",
      "modified_at": "2024-01-15T10:30:00Z",
      "name": "My Org Group",
      "owner_org_site": "us1",
      "owner_org_uuid": "b2c3d4e5-f6a7-8901-bcde-f01234567890"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
    "type": "org_groups"
  }
}
```

{% /tab %}

{% /tab %}

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

##### 
                  \# Path parameters export org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/org_groups/${org_group_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get an org group returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["get_org_group"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.get_org_group(
        org_group_id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
    )

    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
# Get an org group returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_org_group".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
p api_instance.get_org_group("a1b2c3d4-e5f6-7890-abcd-ef0123456789")
```

#### 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
// Get an org group 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetOrgGroup", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.GetOrgGroup(ctx, uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"))

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.GetOrgGroup`:\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
// Get an org group returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupResponse;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.getOrgGroup", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      OrgGroupResponse result =
          apiInstance.getOrgGroup(UUID.fromString("a1b2c3d4-e5f6-7890-abcd-ef0123456789"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#getOrgGroup");
      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
// Get an org group returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetOrgGroup", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .get_org_group(
            Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
        )
        .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
/**
 * Get an org group returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getOrgGroup"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiGetOrgGroupRequest = {
  orgGroupId: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
};

apiInstance
  .getOrgGroup(params)
  .then((data: v2.OrgGroupResponse) => {
    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 %}

## Create an org group{% #create-an-org-group %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                         |
| ----------------- | ---------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/org_groups |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/org_groups |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/org_groups      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/org_groups      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/org_groups  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/org_groups     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/org_groups |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/org_groups |

### Overview

Create a new organization group. This endpoint requires the `org_group_write` permission.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                        | Type   | Description                                                 |
| ------------ | ---------------------------- | ------ | ----------------------------------------------------------- |
|              | data [*required*]       | object | Data for creating an org group.                             |
| data         | attributes [*required*] | object | Attributes for creating an org group.                       |
| attributes   | name [*required*]       | string | The name of the org group.                                  |
| data         | type [*required*]       | enum   | Org groups resource type. Allowed enum values: `org_groups` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "name": "My Org Group"
    },
    "type": "org_groups"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing a single org group.

| Parent field | Field                            | Type      | Description                                                 |
| ------------ | -------------------------------- | --------- | ----------------------------------------------------------- |
|              | data [*required*]           | object    | An org group resource.                                      |
| data         | attributes [*required*]     | object    | Attributes of an org group.                                 |
| attributes   | created_at [*required*]     | date-time | Timestamp when the org group was created.                   |
| attributes   | modified_at [*required*]    | date-time | Timestamp when the org group was last modified.             |
| attributes   | name [*required*]           | string    | The name of the org group.                                  |
| attributes   | owner_org_site [*required*] | string    | The site of the organization that owns this org group.      |
| attributes   | owner_org_uuid [*required*] | uuid      | The UUID of the organization that owns this org group.      |
| data         | id [*required*]             | uuid      | The ID of the org group.                                    |
| data         | type [*required*]           | enum      | Org groups resource type. Allowed enum values: `org_groups` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T10:30:00Z",
      "modified_at": "2024-01-15T10:30:00Z",
      "name": "My Org Group",
      "owner_org_site": "us1",
      "owner_org_uuid": "b2c3d4e5-f6a7-8901-bcde-f01234567890"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
    "type": "org_groups"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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="401" %}
Unauthorized
{% 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="403" %}
Forbidden
{% 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="409" %}
Conflict
{% 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
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/org_groups" \
-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": {
      "name": "My Org Group"
    },
    "type": "org_groups"
  }
}
EOF 
                
##### 

```python
"""
Create an org group returns "Created" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from datadog_api_client.v2.model.org_group_create_attributes import OrgGroupCreateAttributes
from datadog_api_client.v2.model.org_group_create_data import OrgGroupCreateData
from datadog_api_client.v2.model.org_group_create_request import OrgGroupCreateRequest
from datadog_api_client.v2.model.org_group_type import OrgGroupType

body = OrgGroupCreateRequest(
    data=OrgGroupCreateData(
        attributes=OrgGroupCreateAttributes(
            name="My Org Group",
        ),
        type=OrgGroupType.ORG_GROUPS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_org_group"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.create_org_group(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
# Create an org group returns "Created" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.create_org_group".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new

body = DatadogAPIClient::V2::OrgGroupCreateRequest.new({
  data: DatadogAPIClient::V2::OrgGroupCreateData.new({
    attributes: DatadogAPIClient::V2::OrgGroupCreateAttributes.new({
      name: "My Org Group",
    }),
    type: DatadogAPIClient::V2::OrgGroupType::ORG_GROUPS,
  }),
})
p api_instance.create_org_group(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
// Create an org group returns "Created" 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.OrgGroupCreateRequest{
		Data: datadogV2.OrgGroupCreateData{
			Attributes: datadogV2.OrgGroupCreateAttributes{
				Name: "My Org Group",
			},
			Type: datadogV2.ORGGROUPTYPE_ORG_GROUPS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateOrgGroup", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.CreateOrgGroup(ctx, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.CreateOrgGroup`:\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
// Create an org group returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupCreateAttributes;
import com.datadog.api.client.v2.model.OrgGroupCreateData;
import com.datadog.api.client.v2.model.OrgGroupCreateRequest;
import com.datadog.api.client.v2.model.OrgGroupResponse;
import com.datadog.api.client.v2.model.OrgGroupType;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.createOrgGroup", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    OrgGroupCreateRequest body =
        new OrgGroupCreateRequest()
            .data(
                new OrgGroupCreateData()
                    .attributes(new OrgGroupCreateAttributes().name("My Org Group"))
                    .type(OrgGroupType.ORG_GROUPS));

    try {
      OrgGroupResponse result = apiInstance.createOrgGroup(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#createOrgGroup");
      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
// Create an org group returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use datadog_api_client::datadogV2::model::OrgGroupCreateAttributes;
use datadog_api_client::datadogV2::model::OrgGroupCreateData;
use datadog_api_client::datadogV2::model::OrgGroupCreateRequest;
use datadog_api_client::datadogV2::model::OrgGroupType;

#[tokio::main]
async fn main() {
    let body = OrgGroupCreateRequest::new(OrgGroupCreateData::new(
        OrgGroupCreateAttributes::new("My Org Group".to_string()),
        OrgGroupType::ORG_GROUPS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateOrgGroup", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api.create_org_group(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
/**
 * Create an org group returns "Created" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createOrgGroup"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiCreateOrgGroupRequest = {
  body: {
    data: {
      attributes: {
        name: "My Org Group",
      },
      type: "org_groups",
    },
  },
};

apiInstance
  .createOrgGroup(params)
  .then((data: v2.OrgGroupResponse) => {
    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 %}

## Update an org group{% #update-an-org-group %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                         |
| ----------------- | -------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/org_groups/{org_group_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/org_groups/{org_group_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/org_groups/{org_group_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/org_groups/{org_group_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/org_groups/{org_group_id}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/org_groups/{org_group_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/org_groups/{org_group_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/org_groups/{org_group_id} |

### Overview

Update the name of an existing organization group. This endpoint requires the `org_group_write` permission.

### Arguments

#### Path Parameters

| Name                           | Type   | Description              |
| ------------------------------ | ------ | ------------------------ |
| org_group_id [*required*] | string | The ID of the org group. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                        | Type   | Description                                                 |
| ------------ | ---------------------------- | ------ | ----------------------------------------------------------- |
|              | data [*required*]       | object | Data for updating an org group.                             |
| data         | attributes [*required*] | object | Attributes for updating an org group.                       |
| attributes   | name [*required*]       | string | The name of the org group.                                  |
| data         | id [*required*]         | uuid   | The ID of the org group.                                    |
| data         | type [*required*]       | enum   | Org groups resource type. Allowed enum values: `org_groups` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "name": "Updated Org Group Name"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
    "type": "org_groups"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single org group.

| Parent field | Field                            | Type      | Description                                                 |
| ------------ | -------------------------------- | --------- | ----------------------------------------------------------- |
|              | data [*required*]           | object    | An org group resource.                                      |
| data         | attributes [*required*]     | object    | Attributes of an org group.                                 |
| attributes   | created_at [*required*]     | date-time | Timestamp when the org group was created.                   |
| attributes   | modified_at [*required*]    | date-time | Timestamp when the org group was last modified.             |
| attributes   | name [*required*]           | string    | The name of the org group.                                  |
| attributes   | owner_org_site [*required*] | string    | The site of the organization that owns this org group.      |
| attributes   | owner_org_uuid [*required*] | uuid      | The UUID of the organization that owns this org group.      |
| data         | id [*required*]             | uuid      | The ID of the org group.                                    |
| data         | type [*required*]           | enum      | Org groups resource type. Allowed enum values: `org_groups` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T10:30:00Z",
      "modified_at": "2024-01-15T10:30:00Z",
      "name": "My Org Group",
      "owner_org_site": "us1",
      "owner_org_uuid": "b2c3d4e5-f6a7-8901-bcde-f01234567890"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
    "type": "org_groups"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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="401" %}
Unauthorized
{% 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="403" %}
Forbidden
{% 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="404" %}
Not Found
{% 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 org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/org_groups/${org_group_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": {
      "name": "Updated Org Group Name"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
    "type": "org_groups"
  }
}
EOF 
                
##### 

```python
"""
Update an org group returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from datadog_api_client.v2.model.org_group_type import OrgGroupType
from datadog_api_client.v2.model.org_group_update_attributes import OrgGroupUpdateAttributes
from datadog_api_client.v2.model.org_group_update_data import OrgGroupUpdateData
from datadog_api_client.v2.model.org_group_update_request import OrgGroupUpdateRequest
from uuid import UUID

body = OrgGroupUpdateRequest(
    data=OrgGroupUpdateData(
        attributes=OrgGroupUpdateAttributes(
            name="Updated Org Group Name",
        ),
        id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
        type=OrgGroupType.ORG_GROUPS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_org_group"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.update_org_group(org_group_id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"), 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 an org group returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.update_org_group".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new

body = DatadogAPIClient::V2::OrgGroupUpdateRequest.new({
  data: DatadogAPIClient::V2::OrgGroupUpdateData.new({
    attributes: DatadogAPIClient::V2::OrgGroupUpdateAttributes.new({
      name: "Updated Org Group Name",
    }),
    id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
    type: DatadogAPIClient::V2::OrgGroupType::ORG_GROUPS,
  }),
})
p api_instance.update_org_group("a1b2c3d4-e5f6-7890-abcd-ef0123456789", 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 an org group 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.OrgGroupUpdateRequest{
		Data: datadogV2.OrgGroupUpdateData{
			Attributes: datadogV2.OrgGroupUpdateAttributes{
				Name: "Updated Org Group Name",
			},
			Id:   uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
			Type: datadogV2.ORGGROUPTYPE_ORG_GROUPS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateOrgGroup", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.UpdateOrgGroup(ctx, uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"), body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.UpdateOrgGroup`:\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 an org group returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupResponse;
import com.datadog.api.client.v2.model.OrgGroupType;
import com.datadog.api.client.v2.model.OrgGroupUpdateAttributes;
import com.datadog.api.client.v2.model.OrgGroupUpdateData;
import com.datadog.api.client.v2.model.OrgGroupUpdateRequest;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.updateOrgGroup", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    OrgGroupUpdateRequest body =
        new OrgGroupUpdateRequest()
            .data(
                new OrgGroupUpdateData()
                    .attributes(new OrgGroupUpdateAttributes().name("Updated Org Group Name"))
                    .id(UUID.fromString("a1b2c3d4-e5f6-7890-abcd-ef0123456789"))
                    .type(OrgGroupType.ORG_GROUPS));

    try {
      OrgGroupResponse result =
          apiInstance.updateOrgGroup(UUID.fromString("a1b2c3d4-e5f6-7890-abcd-ef0123456789"), body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#updateOrgGroup");
      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 an org group returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use datadog_api_client::datadogV2::model::OrgGroupType;
use datadog_api_client::datadogV2::model::OrgGroupUpdateAttributes;
use datadog_api_client::datadogV2::model::OrgGroupUpdateData;
use datadog_api_client::datadogV2::model::OrgGroupUpdateRequest;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body = OrgGroupUpdateRequest::new(OrgGroupUpdateData::new(
        OrgGroupUpdateAttributes::new("Updated Org Group Name".to_string()),
        Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
        OrgGroupType::ORG_GROUPS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateOrgGroup", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .update_org_group(
            Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").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://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 an org group returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateOrgGroup"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiUpdateOrgGroupRequest = {
  body: {
    data: {
      attributes: {
        name: "Updated Org Group Name",
      },
      id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
      type: "org_groups",
    },
  },
  orgGroupId: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
};

apiInstance
  .updateOrgGroup(params)
  .then((data: v2.OrgGroupResponse) => {
    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 %}

## Delete an org group{% #delete-an-org-group %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                          |
| ----------------- | --------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/org_groups/{org_group_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/org_groups/{org_group_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/org_groups/{org_group_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/org_groups/{org_group_id}      |
| us2.ddog-gov.com  | DELETE https://api.us2.ddog-gov.com/api/v2/org_groups/{org_group_id}  |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/org_groups/{org_group_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/org_groups/{org_group_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/org_groups/{org_group_id} |

### Overview

Delete an organization group by its ID. This endpoint requires the `org_group_write` permission.

### Arguments

#### Path Parameters

| Name                           | Type   | Description              |
| ------------------------------ | ------ | ------------------------ |
| org_group_id [*required*] | string | The ID of the org group. |

### Response

{% tab title="204" %}
No Content
{% /tab %}

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

##### 
                  \# Path parameters export org_group_id="a1b2c3d4-e5f6-7890-abcd-ef0123456789" \# Curl command curl -X DELETE "https://api.datadoghq.com/api/v2/org_groups/${org_group_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Delete an org group returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["delete_org_group"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    api_instance.delete_org_group(
        org_group_id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
    )
```

#### 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
# Delete an org group returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.delete_org_group".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
api_instance.delete_org_group("a1b2c3d4-e5f6-7890-abcd-ef0123456789")
```

#### 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
// Delete an org group returns "No Content" response

package main

import (
	"context"
	"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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteOrgGroup", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	r, err := api.DeleteOrgGroup(ctx, uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"))

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

#### 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
// Delete an org group returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.deleteOrgGroup", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      apiInstance.deleteOrgGroup(UUID.fromString("a1b2c3d4-e5f6-7890-abcd-ef0123456789"));
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#deleteOrgGroup");
      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
// Delete an org group returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteOrgGroup", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .delete_org_group(
            Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
        )
        .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
/**
 * Delete an org group returns "No Content" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteOrgGroup"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiDeleteOrgGroupRequest = {
  orgGroupId: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
};

apiInstance
  .deleteOrgGroup(params)
  .then((data: any) => {
    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 %}

## List org group memberships{% #list-org-group-memberships %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                   |
| ----------------- | -------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/org_group_memberships |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/org_group_memberships |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/org_group_memberships      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/org_group_memberships      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/org_group_memberships  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/org_group_memberships     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/org_group_memberships |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/org_group_memberships |

### Overview

List organization group memberships. Filter by org group ID or org UUID. At least one of `filter[org_group_id]` or `filter[org_uuid]` must be provided. When filtering by org UUID, returns a single-item list with the membership for that org. This endpoint requires the `org_group_read` permission.

### Arguments

#### Query Strings

| Name                 | Type    | Description                                                                                                                                           |
| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter[org_group_id] | string  | Filter memberships by org group ID. Required when `filter[org_uuid]` is not provided.                                                                 |
| filter[org_uuid]     | string  | Filter memberships by org UUID. Returns a single-item list.                                                                                           |
| page[number]         | integer | The page number to return.                                                                                                                            |
| page[size]           | integer | The number of items per page. Maximum is 1000.                                                                                                        |
| sort                 | enum    | Field to sort memberships by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`. Allowed enum values: `name, -name, uuid, -uuid` |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of org group memberships.

| Parent field  | Field                         | Type      | Description                                                                       |
| ------------- | ----------------------------- | --------- | --------------------------------------------------------------------------------- |
|               | data [*required*]        | [object]  | An array of org group memberships.                                                |
| data          | attributes [*required*]  | object    | Attributes of an org group membership.                                            |
| attributes    | created_at [*required*]  | date-time | Timestamp when the membership was created.                                        |
| attributes    | modified_at [*required*] | date-time | Timestamp when the membership was last modified.                                  |
| attributes    | org_name [*required*]    | string    | The name of the member organization.                                              |
| attributes    | org_site [*required*]    | string    | The site of the member organization.                                              |
| attributes    | org_uuid [*required*]    | uuid      | The UUID of the member organization.                                              |
| data          | id [*required*]          | uuid      | The ID of the org group membership.                                               |
| data          | relationships                 | object    | Relationships of an org group membership.                                         |
| relationships | org_group                     | object    | Relationship to a single org group.                                               |
| org_group     | data [*required*]        | object    | A reference to an org group.                                                      |
| data          | id [*required*]          | uuid      | The ID of the org group.                                                          |
| data          | type [*required*]        | enum      | Org groups resource type. Allowed enum values: `org_groups`                       |
| data          | type [*required*]        | enum      | Org group memberships resource type. Allowed enum values: `org_group_memberships` |
|               | links                         | object    | Pagination links for navigating between pages of an org group list response.      |
| links         | first                         | string    | Link to the first page.                                                           |
| links         | last                          | string    | Link to the last page.                                                            |
| links         | next                          | string    | Link to the next page.                                                            |
| links         | prev                          | string    | Link to the previous page.                                                        |
| links         | self                          | string    | Link to the current page.                                                         |
|               | meta                          | object    | Pagination metadata for org group list responses.                                 |
| meta          | page                          | object    | Page-based pagination details for org group list responses.                       |
| page          | first_number                  | int64     | First page number.                                                                |
| page          | last_number                   | int64     | Last page number.                                                                 |
| page          | next_number                   | int64     | Next page number.                                                                 |
| page          | number                        | int64     | Page number.                                                                      |
| page          | prev_number                   | int64     | Previous page number.                                                             |
| page          | size                          | int64     | Page size.                                                                        |
| page          | total                         | int64     | Total number of results.                                                          |
| page          | type                          | string    | Pagination type.                                                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2024-01-15T10:30:00Z",
        "modified_at": "2024-01-15T10:30:00Z",
        "org_name": "Acme Corp",
        "org_site": "us1",
        "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
      },
      "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
      "relationships": {
        "org_group": {
          "data": {
            "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
            "type": "org_groups"
          }
        }
      },
      "type": "org_group_memberships"
    }
  ],
  "links": {
    "first": "string",
    "last": "string",
    "next": "string",
    "prev": "string",
    "self": "string"
  },
  "meta": {
    "page": {
      "first_number": "integer",
      "last_number": "integer",
      "next_number": "integer",
      "number": "integer",
      "prev_number": "integer",
      "size": "integer",
      "total": "integer",
      "type": "number_size"
    }
  }
}
```

{% /tab %}

{% /tab %}

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

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

```python
"""
List org group memberships returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi

configuration = Configuration()
configuration.unstable_operations["list_org_group_memberships"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.list_org_group_memberships()

    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
# List org group memberships returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_org_group_memberships".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
p api_instance.list_org_group_memberships()
```

#### 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
// List org group memberships 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListOrgGroupMemberships", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.ListOrgGroupMemberships(ctx, *datadogV2.NewListOrgGroupMembershipsOptionalParameters())

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.ListOrgGroupMemberships`:\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
// List org group memberships returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupMembershipListResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.listOrgGroupMemberships", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      OrgGroupMembershipListResponse result = apiInstance.listOrgGroupMemberships();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#listOrgGroupMemberships");
      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
// List org group memberships returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::ListOrgGroupMembershipsOptionalParams;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListOrgGroupMemberships", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .list_org_group_memberships(ListOrgGroupMembershipsOptionalParams::default())
        .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
/**
 * List org group memberships returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listOrgGroupMemberships"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

apiInstance
  .listOrgGroupMemberships()
  .then((data: v2.OrgGroupMembershipListResponse) => {
    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 %}

## Get an org group membership{% #get-an-org-group-membership %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                             |
| ----------------- | ---------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/org_group_memberships/{org_group_membership_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/org_group_memberships/{org_group_membership_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/org_group_memberships/{org_group_membership_id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id} |

### Overview

Get a specific organization group membership by its ID. This endpoint requires the `org_group_read` permission.

### Arguments

#### Path Parameters

| Name                                      | Type   | Description                         |
| ----------------------------------------- | ------ | ----------------------------------- |
| org_group_membership_id [*required*] | string | The ID of the org group membership. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single org group membership.

| Parent field  | Field                         | Type      | Description                                                                       |
| ------------- | ----------------------------- | --------- | --------------------------------------------------------------------------------- |
|               | data [*required*]        | object    | An org group membership resource.                                                 |
| data          | attributes [*required*]  | object    | Attributes of an org group membership.                                            |
| attributes    | created_at [*required*]  | date-time | Timestamp when the membership was created.                                        |
| attributes    | modified_at [*required*] | date-time | Timestamp when the membership was last modified.                                  |
| attributes    | org_name [*required*]    | string    | The name of the member organization.                                              |
| attributes    | org_site [*required*]    | string    | The site of the member organization.                                              |
| attributes    | org_uuid [*required*]    | uuid      | The UUID of the member organization.                                              |
| data          | id [*required*]          | uuid      | The ID of the org group membership.                                               |
| data          | relationships                 | object    | Relationships of an org group membership.                                         |
| relationships | org_group                     | object    | Relationship to a single org group.                                               |
| org_group     | data [*required*]        | object    | A reference to an org group.                                                      |
| data          | id [*required*]          | uuid      | The ID of the org group.                                                          |
| data          | type [*required*]        | enum      | Org groups resource type. Allowed enum values: `org_groups`                       |
| data          | type [*required*]        | enum      | Org group memberships resource type. Allowed enum values: `org_group_memberships` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T10:30:00Z",
      "modified_at": "2024-01-15T10:30:00Z",
      "org_name": "Acme Corp",
      "org_site": "us1",
      "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
    },
    "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_memberships"
  }
}
```

{% /tab %}

{% /tab %}

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

##### 
                  \# Path parameters export org_group_membership_id="f1e2d3c4-b5a6-7890-1234-567890abcdef" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/org_group_memberships/${org_group_membership_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get an org group membership returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["get_org_group_membership"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.get_org_group_membership(
        org_group_membership_id=UUID("f1e2d3c4-b5a6-7890-1234-567890abcdef"),
    )

    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
# Get an org group membership returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_org_group_membership".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
p api_instance.get_org_group_membership("f1e2d3c4-b5a6-7890-1234-567890abcdef")
```

#### 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
// Get an org group membership 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetOrgGroupMembership", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.GetOrgGroupMembership(ctx, uuid.MustParse("f1e2d3c4-b5a6-7890-1234-567890abcdef"))

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.GetOrgGroupMembership`:\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
// Get an org group membership returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupMembershipResponse;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.getOrgGroupMembership", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      OrgGroupMembershipResponse result =
          apiInstance.getOrgGroupMembership(
              UUID.fromString("f1e2d3c4-b5a6-7890-1234-567890abcdef"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#getOrgGroupMembership");
      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
// Get an org group membership returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetOrgGroupMembership", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .get_org_group_membership(
            Uuid::parse_str("f1e2d3c4-b5a6-7890-1234-567890abcdef").expect("invalid UUID"),
        )
        .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
/**
 * Get an org group membership returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getOrgGroupMembership"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiGetOrgGroupMembershipRequest = {
  orgGroupMembershipId: "f1e2d3c4-b5a6-7890-1234-567890abcdef",
};

apiInstance
  .getOrgGroupMembership(params)
  .then((data: v2.OrgGroupMembershipResponse) => {
    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 %}

## Update an org group membership{% #update-an-org-group-membership %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/org_group_memberships/{org_group_membership_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/org_group_memberships/{org_group_membership_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/org_group_memberships/{org_group_membership_id}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/org_group_memberships/{org_group_membership_id} |

### Overview

Move an organization to a different org group by updating its membership. This endpoint requires the `org_group_write` permission.

### Arguments

#### Path Parameters

| Name                                      | Type   | Description                         |
| ----------------------------------------- | ------ | ----------------------------------- |
| org_group_membership_id [*required*] | string | The ID of the org group membership. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field  | Field                           | Type   | Description                                                                       |
| ------------- | ------------------------------- | ------ | --------------------------------------------------------------------------------- |
|               | data [*required*]          | object | Data for updating an org group membership.                                        |
| data          | id [*required*]            | uuid   | The ID of the membership.                                                         |
| data          | relationships [*required*] | object | Relationships for updating a membership.                                          |
| relationships | org_group [*required*]     | object | Relationship to a single org group.                                               |
| org_group     | data [*required*]          | object | A reference to an org group.                                                      |
| data          | id [*required*]            | uuid   | The ID of the org group.                                                          |
| data          | type [*required*]          | enum   | Org groups resource type. Allowed enum values: `org_groups`                       |
| data          | type [*required*]          | enum   | Org group memberships resource type. Allowed enum values: `org_group_memberships` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_memberships"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single org group membership.

| Parent field  | Field                         | Type      | Description                                                                       |
| ------------- | ----------------------------- | --------- | --------------------------------------------------------------------------------- |
|               | data [*required*]        | object    | An org group membership resource.                                                 |
| data          | attributes [*required*]  | object    | Attributes of an org group membership.                                            |
| attributes    | created_at [*required*]  | date-time | Timestamp when the membership was created.                                        |
| attributes    | modified_at [*required*] | date-time | Timestamp when the membership was last modified.                                  |
| attributes    | org_name [*required*]    | string    | The name of the member organization.                                              |
| attributes    | org_site [*required*]    | string    | The site of the member organization.                                              |
| attributes    | org_uuid [*required*]    | uuid      | The UUID of the member organization.                                              |
| data          | id [*required*]          | uuid      | The ID of the org group membership.                                               |
| data          | relationships                 | object    | Relationships of an org group membership.                                         |
| relationships | org_group                     | object    | Relationship to a single org group.                                               |
| org_group     | data [*required*]        | object    | A reference to an org group.                                                      |
| data          | id [*required*]          | uuid      | The ID of the org group.                                                          |
| data          | type [*required*]        | enum      | Org groups resource type. Allowed enum values: `org_groups`                       |
| data          | type [*required*]        | enum      | Org group memberships resource type. Allowed enum values: `org_group_memberships` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T10:30:00Z",
      "modified_at": "2024-01-15T10:30:00Z",
      "org_name": "Acme Corp",
      "org_site": "us1",
      "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
    },
    "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_memberships"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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="401" %}
Unauthorized
{% 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="403" %}
Forbidden
{% 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="404" %}
Not Found
{% 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 org_group_membership_id="f1e2d3c4-b5a6-7890-1234-567890abcdef" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/org_group_memberships/${org_group_membership_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": {
    "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_memberships"
  }
}
EOF 
                
##### 

```python
"""
Update an org group membership returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from datadog_api_client.v2.model.org_group_membership_type import OrgGroupMembershipType
from datadog_api_client.v2.model.org_group_membership_update_data import OrgGroupMembershipUpdateData
from datadog_api_client.v2.model.org_group_membership_update_relationships import OrgGroupMembershipUpdateRelationships
from datadog_api_client.v2.model.org_group_membership_update_request import OrgGroupMembershipUpdateRequest
from datadog_api_client.v2.model.org_group_relationship_to_one import OrgGroupRelationshipToOne
from datadog_api_client.v2.model.org_group_relationship_to_one_data import OrgGroupRelationshipToOneData
from datadog_api_client.v2.model.org_group_type import OrgGroupType
from uuid import UUID

body = OrgGroupMembershipUpdateRequest(
    data=OrgGroupMembershipUpdateData(
        id=UUID("f1e2d3c4-b5a6-7890-1234-567890abcdef"),
        relationships=OrgGroupMembershipUpdateRelationships(
            org_group=OrgGroupRelationshipToOne(
                data=OrgGroupRelationshipToOneData(
                    id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
                    type=OrgGroupType.ORG_GROUPS,
                ),
            ),
        ),
        type=OrgGroupMembershipType.ORG_GROUP_MEMBERSHIPS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_org_group_membership"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.update_org_group_membership(
        org_group_membership_id=UUID("f1e2d3c4-b5a6-7890-1234-567890abcdef"), 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 an org group membership returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.update_org_group_membership".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new

body = DatadogAPIClient::V2::OrgGroupMembershipUpdateRequest.new({
  data: DatadogAPIClient::V2::OrgGroupMembershipUpdateData.new({
    id: "f1e2d3c4-b5a6-7890-1234-567890abcdef",
    relationships: DatadogAPIClient::V2::OrgGroupMembershipUpdateRelationships.new({
      org_group: DatadogAPIClient::V2::OrgGroupRelationshipToOne.new({
        data: DatadogAPIClient::V2::OrgGroupRelationshipToOneData.new({
          id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          type: DatadogAPIClient::V2::OrgGroupType::ORG_GROUPS,
        }),
      }),
    }),
    type: DatadogAPIClient::V2::OrgGroupMembershipType::ORG_GROUP_MEMBERSHIPS,
  }),
})
p api_instance.update_org_group_membership("f1e2d3c4-b5a6-7890-1234-567890abcdef", 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 an org group membership 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.OrgGroupMembershipUpdateRequest{
		Data: datadogV2.OrgGroupMembershipUpdateData{
			Id: uuid.MustParse("f1e2d3c4-b5a6-7890-1234-567890abcdef"),
			Relationships: datadogV2.OrgGroupMembershipUpdateRelationships{
				OrgGroup: datadogV2.OrgGroupRelationshipToOne{
					Data: datadogV2.OrgGroupRelationshipToOneData{
						Id:   uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
						Type: datadogV2.ORGGROUPTYPE_ORG_GROUPS,
					},
				},
			},
			Type: datadogV2.ORGGROUPMEMBERSHIPTYPE_ORG_GROUP_MEMBERSHIPS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateOrgGroupMembership", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.UpdateOrgGroupMembership(ctx, uuid.MustParse("f1e2d3c4-b5a6-7890-1234-567890abcdef"), body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.UpdateOrgGroupMembership`:\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 an org group membership returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupMembershipResponse;
import com.datadog.api.client.v2.model.OrgGroupMembershipType;
import com.datadog.api.client.v2.model.OrgGroupMembershipUpdateData;
import com.datadog.api.client.v2.model.OrgGroupMembershipUpdateRelationships;
import com.datadog.api.client.v2.model.OrgGroupMembershipUpdateRequest;
import com.datadog.api.client.v2.model.OrgGroupRelationshipToOne;
import com.datadog.api.client.v2.model.OrgGroupRelationshipToOneData;
import com.datadog.api.client.v2.model.OrgGroupType;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.updateOrgGroupMembership", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    OrgGroupMembershipUpdateRequest body =
        new OrgGroupMembershipUpdateRequest()
            .data(
                new OrgGroupMembershipUpdateData()
                    .id(UUID.fromString("f1e2d3c4-b5a6-7890-1234-567890abcdef"))
                    .relationships(
                        new OrgGroupMembershipUpdateRelationships()
                            .orgGroup(
                                new OrgGroupRelationshipToOne()
                                    .data(
                                        new OrgGroupRelationshipToOneData()
                                            .id(
                                                UUID.fromString(
                                                    "a1b2c3d4-e5f6-7890-abcd-ef0123456789"))
                                            .type(OrgGroupType.ORG_GROUPS))))
                    .type(OrgGroupMembershipType.ORG_GROUP_MEMBERSHIPS));

    try {
      OrgGroupMembershipResponse result =
          apiInstance.updateOrgGroupMembership(
              UUID.fromString("f1e2d3c4-b5a6-7890-1234-567890abcdef"), body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#updateOrgGroupMembership");
      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 an org group membership returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use datadog_api_client::datadogV2::model::OrgGroupMembershipType;
use datadog_api_client::datadogV2::model::OrgGroupMembershipUpdateData;
use datadog_api_client::datadogV2::model::OrgGroupMembershipUpdateRelationships;
use datadog_api_client::datadogV2::model::OrgGroupMembershipUpdateRequest;
use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOne;
use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOneData;
use datadog_api_client::datadogV2::model::OrgGroupType;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body = OrgGroupMembershipUpdateRequest::new(OrgGroupMembershipUpdateData::new(
        Uuid::parse_str("f1e2d3c4-b5a6-7890-1234-567890abcdef").expect("invalid UUID"),
        OrgGroupMembershipUpdateRelationships::new(OrgGroupRelationshipToOne::new(
            OrgGroupRelationshipToOneData::new(
                Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
                OrgGroupType::ORG_GROUPS,
            ),
        )),
        OrgGroupMembershipType::ORG_GROUP_MEMBERSHIPS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateOrgGroupMembership", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .update_org_group_membership(
            Uuid::parse_str("f1e2d3c4-b5a6-7890-1234-567890abcdef").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://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 an org group membership returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateOrgGroupMembership"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiUpdateOrgGroupMembershipRequest = {
  body: {
    data: {
      id: "f1e2d3c4-b5a6-7890-1234-567890abcdef",
      relationships: {
        orgGroup: {
          data: {
            id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
            type: "org_groups",
          },
        },
      },
      type: "org_group_memberships",
    },
  },
  orgGroupMembershipId: "f1e2d3c4-b5a6-7890-1234-567890abcdef",
};

apiInstance
  .updateOrgGroupMembership(params)
  .then((data: v2.OrgGroupMembershipResponse) => {
    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 %}

## Bulk update org group memberships{% #bulk-update-org-group-memberships %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                          |
| ----------------- | --------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/org_group_memberships/bulk |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/org_group_memberships/bulk |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/org_group_memberships/bulk      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/org_group_memberships/bulk      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/org_group_memberships/bulk  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/org_group_memberships/bulk     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/org_group_memberships/bulk |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/org_group_memberships/bulk |

### Overview

Move a batch of organizations from one org group to another. This is an atomic operation. Maximum 100 orgs per request. This endpoint requires the `org_group_write` permission.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field     | Field                              | Type     | Description                                                                                              |
| ---------------- | ---------------------------------- | -------- | -------------------------------------------------------------------------------------------------------- |
|                  | data [*required*]             | object   | Data for bulk updating org group memberships.                                                            |
| data             | attributes [*required*]       | object   | Attributes for bulk updating org group memberships.                                                      |
| attributes       | orgs [*required*]             | [object] | List of organizations to move. Maximum 100 per request.                                                  |
| orgs             | org_site [*required*]         | string   | The site of the organization.                                                                            |
| orgs             | org_uuid [*required*]         | uuid     | The UUID of the organization.                                                                            |
| data             | relationships [*required*]    | object   | Relationships for bulk updating memberships.                                                             |
| relationships    | source_org_group [*required*] | object   | Relationship to a single org group.                                                                      |
| source_org_group | data [*required*]             | object   | A reference to an org group.                                                                             |
| data             | id [*required*]               | uuid     | The ID of the org group.                                                                                 |
| data             | type [*required*]             | enum     | Org groups resource type. Allowed enum values: `org_groups`                                              |
| relationships    | target_org_group [*required*] | object   | Relationship to a single org group.                                                                      |
| target_org_group | data [*required*]             | object   | A reference to an org group.                                                                             |
| data             | id [*required*]               | uuid     | The ID of the org group.                                                                                 |
| data             | type [*required*]             | enum     | Org groups resource type. Allowed enum values: `org_groups`                                              |
| data             | type [*required*]             | enum     | Org group membership bulk update resource type. Allowed enum values: `org_group_membership_bulk_updates` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "orgs": [
        {
          "org_site": "us1",
          "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
        }
      ]
    },
    "relationships": {
      "source_org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      },
      "target_org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_membership_bulk_updates"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of org group memberships.

| Parent field  | Field                         | Type      | Description                                                                       |
| ------------- | ----------------------------- | --------- | --------------------------------------------------------------------------------- |
|               | data [*required*]        | [object]  | An array of org group memberships.                                                |
| data          | attributes [*required*]  | object    | Attributes of an org group membership.                                            |
| attributes    | created_at [*required*]  | date-time | Timestamp when the membership was created.                                        |
| attributes    | modified_at [*required*] | date-time | Timestamp when the membership was last modified.                                  |
| attributes    | org_name [*required*]    | string    | The name of the member organization.                                              |
| attributes    | org_site [*required*]    | string    | The site of the member organization.                                              |
| attributes    | org_uuid [*required*]    | uuid      | The UUID of the member organization.                                              |
| data          | id [*required*]          | uuid      | The ID of the org group membership.                                               |
| data          | relationships                 | object    | Relationships of an org group membership.                                         |
| relationships | org_group                     | object    | Relationship to a single org group.                                               |
| org_group     | data [*required*]        | object    | A reference to an org group.                                                      |
| data          | id [*required*]          | uuid      | The ID of the org group.                                                          |
| data          | type [*required*]        | enum      | Org groups resource type. Allowed enum values: `org_groups`                       |
| data          | type [*required*]        | enum      | Org group memberships resource type. Allowed enum values: `org_group_memberships` |
|               | links                         | object    | Pagination links for navigating between pages of an org group list response.      |
| links         | first                         | string    | Link to the first page.                                                           |
| links         | last                          | string    | Link to the last page.                                                            |
| links         | next                          | string    | Link to the next page.                                                            |
| links         | prev                          | string    | Link to the previous page.                                                        |
| links         | self                          | string    | Link to the current page.                                                         |
|               | meta                          | object    | Pagination metadata for org group list responses.                                 |
| meta          | page                          | object    | Page-based pagination details for org group list responses.                       |
| page          | first_number                  | int64     | First page number.                                                                |
| page          | last_number                   | int64     | Last page number.                                                                 |
| page          | next_number                   | int64     | Next page number.                                                                 |
| page          | number                        | int64     | Page number.                                                                      |
| page          | prev_number                   | int64     | Previous page number.                                                             |
| page          | size                          | int64     | Page size.                                                                        |
| page          | total                         | int64     | Total number of results.                                                          |
| page          | type                          | string    | Pagination type.                                                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2024-01-15T10:30:00Z",
        "modified_at": "2024-01-15T10:30:00Z",
        "org_name": "Acme Corp",
        "org_site": "us1",
        "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
      },
      "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
      "relationships": {
        "org_group": {
          "data": {
            "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
            "type": "org_groups"
          }
        }
      },
      "type": "org_group_memberships"
    }
  ],
  "links": {
    "first": "string",
    "last": "string",
    "next": "string",
    "prev": "string",
    "self": "string"
  },
  "meta": {
    "page": {
      "first_number": "integer",
      "last_number": "integer",
      "next_number": "integer",
      "number": "integer",
      "prev_number": "integer",
      "size": "integer",
      "total": "integer",
      "type": "number_size"
    }
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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="401" %}
Unauthorized
{% 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="403" %}
Forbidden
{% 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="404" %}
Not Found
{% 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
# 
 \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/org_group_memberships/bulk" \
-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": {
      "orgs": [
        {
          "org_site": "us1",
          "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
        }
      ]
    },
    "relationships": {
      "source_org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      },
      "target_org_group": {
        "data": {
          "id": "d4e5f6a7-b890-1234-cdef-567890abcdef",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_membership_bulk_updates"
  }
}
EOF 
                
##### 

```python
"""
Bulk update org group memberships returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from datadog_api_client.v2.model.global_org_identifier import GlobalOrgIdentifier
from datadog_api_client.v2.model.org_group_membership_bulk_update_attributes import (
    OrgGroupMembershipBulkUpdateAttributes,
)
from datadog_api_client.v2.model.org_group_membership_bulk_update_data import OrgGroupMembershipBulkUpdateData
from datadog_api_client.v2.model.org_group_membership_bulk_update_relationships import (
    OrgGroupMembershipBulkUpdateRelationships,
)
from datadog_api_client.v2.model.org_group_membership_bulk_update_request import OrgGroupMembershipBulkUpdateRequest
from datadog_api_client.v2.model.org_group_membership_bulk_update_type import OrgGroupMembershipBulkUpdateType
from datadog_api_client.v2.model.org_group_relationship_to_one import OrgGroupRelationshipToOne
from datadog_api_client.v2.model.org_group_relationship_to_one_data import OrgGroupRelationshipToOneData
from datadog_api_client.v2.model.org_group_type import OrgGroupType
from uuid import UUID

body = OrgGroupMembershipBulkUpdateRequest(
    data=OrgGroupMembershipBulkUpdateData(
        attributes=OrgGroupMembershipBulkUpdateAttributes(
            orgs=[
                GlobalOrgIdentifier(
                    org_site="us1",
                    org_uuid=UUID("c3d4e5f6-a7b8-9012-cdef-012345678901"),
                ),
            ],
        ),
        relationships=OrgGroupMembershipBulkUpdateRelationships(
            source_org_group=OrgGroupRelationshipToOne(
                data=OrgGroupRelationshipToOneData(
                    id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
                    type=OrgGroupType.ORG_GROUPS,
                ),
            ),
            target_org_group=OrgGroupRelationshipToOne(
                data=OrgGroupRelationshipToOneData(
                    id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
                    type=OrgGroupType.ORG_GROUPS,
                ),
            ),
        ),
        type=OrgGroupMembershipBulkUpdateType.ORG_GROUP_MEMBERSHIP_BULK_UPDATES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["bulk_update_org_group_memberships"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.bulk_update_org_group_memberships(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
# Bulk update org group memberships returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.bulk_update_org_group_memberships".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new

body = DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateRequest.new({
  data: DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateData.new({
    attributes: DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateAttributes.new({
      orgs: [
        DatadogAPIClient::V2::GlobalOrgIdentifier.new({
          org_site: "us1",
          org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901",
        }),
      ],
    }),
    relationships: DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateRelationships.new({
      source_org_group: DatadogAPIClient::V2::OrgGroupRelationshipToOne.new({
        data: DatadogAPIClient::V2::OrgGroupRelationshipToOneData.new({
          id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          type: DatadogAPIClient::V2::OrgGroupType::ORG_GROUPS,
        }),
      }),
      target_org_group: DatadogAPIClient::V2::OrgGroupRelationshipToOne.new({
        data: DatadogAPIClient::V2::OrgGroupRelationshipToOneData.new({
          id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          type: DatadogAPIClient::V2::OrgGroupType::ORG_GROUPS,
        }),
      }),
    }),
    type: DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateType::ORG_GROUP_MEMBERSHIP_BULK_UPDATES,
  }),
})
p api_instance.bulk_update_org_group_memberships(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
// Bulk update org group memberships 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.OrgGroupMembershipBulkUpdateRequest{
		Data: datadogV2.OrgGroupMembershipBulkUpdateData{
			Attributes: datadogV2.OrgGroupMembershipBulkUpdateAttributes{
				Orgs: []datadogV2.GlobalOrgIdentifier{
					{
						OrgSite: "us1",
						OrgUuid: uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-012345678901"),
					},
				},
			},
			Relationships: datadogV2.OrgGroupMembershipBulkUpdateRelationships{
				SourceOrgGroup: datadogV2.OrgGroupRelationshipToOne{
					Data: datadogV2.OrgGroupRelationshipToOneData{
						Id:   uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
						Type: datadogV2.ORGGROUPTYPE_ORG_GROUPS,
					},
				},
				TargetOrgGroup: datadogV2.OrgGroupRelationshipToOne{
					Data: datadogV2.OrgGroupRelationshipToOneData{
						Id:   uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
						Type: datadogV2.ORGGROUPTYPE_ORG_GROUPS,
					},
				},
			},
			Type: datadogV2.ORGGROUPMEMBERSHIPBULKUPDATETYPE_ORG_GROUP_MEMBERSHIP_BULK_UPDATES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.BulkUpdateOrgGroupMemberships", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.BulkUpdateOrgGroupMemberships(ctx, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.BulkUpdateOrgGroupMemberships`:\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
// Bulk update org group memberships returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.GlobalOrgIdentifier;
import com.datadog.api.client.v2.model.OrgGroupMembershipBulkUpdateAttributes;
import com.datadog.api.client.v2.model.OrgGroupMembershipBulkUpdateData;
import com.datadog.api.client.v2.model.OrgGroupMembershipBulkUpdateRelationships;
import com.datadog.api.client.v2.model.OrgGroupMembershipBulkUpdateRequest;
import com.datadog.api.client.v2.model.OrgGroupMembershipBulkUpdateType;
import com.datadog.api.client.v2.model.OrgGroupMembershipListResponse;
import com.datadog.api.client.v2.model.OrgGroupRelationshipToOne;
import com.datadog.api.client.v2.model.OrgGroupRelationshipToOneData;
import com.datadog.api.client.v2.model.OrgGroupType;
import java.util.Collections;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.bulkUpdateOrgGroupMemberships", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    OrgGroupMembershipBulkUpdateRequest body =
        new OrgGroupMembershipBulkUpdateRequest()
            .data(
                new OrgGroupMembershipBulkUpdateData()
                    .attributes(
                        new OrgGroupMembershipBulkUpdateAttributes()
                            .orgs(
                                Collections.singletonList(
                                    new GlobalOrgIdentifier()
                                        .orgSite("us1")
                                        .orgUuid(
                                            UUID.fromString(
                                                "c3d4e5f6-a7b8-9012-cdef-012345678901")))))
                    .relationships(
                        new OrgGroupMembershipBulkUpdateRelationships()
                            .sourceOrgGroup(
                                new OrgGroupRelationshipToOne()
                                    .data(
                                        new OrgGroupRelationshipToOneData()
                                            .id(
                                                UUID.fromString(
                                                    "a1b2c3d4-e5f6-7890-abcd-ef0123456789"))
                                            .type(OrgGroupType.ORG_GROUPS)))
                            .targetOrgGroup(
                                new OrgGroupRelationshipToOne()
                                    .data(
                                        new OrgGroupRelationshipToOneData()
                                            .id(
                                                UUID.fromString(
                                                    "a1b2c3d4-e5f6-7890-abcd-ef0123456789"))
                                            .type(OrgGroupType.ORG_GROUPS))))
                    .type(OrgGroupMembershipBulkUpdateType.ORG_GROUP_MEMBERSHIP_BULK_UPDATES));

    try {
      OrgGroupMembershipListResponse result = apiInstance.bulkUpdateOrgGroupMemberships(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#bulkUpdateOrgGroupMemberships");
      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
// Bulk update org group memberships returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use datadog_api_client::datadogV2::model::GlobalOrgIdentifier;
use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateAttributes;
use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateData;
use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateRelationships;
use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateRequest;
use datadog_api_client::datadogV2::model::OrgGroupMembershipBulkUpdateType;
use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOne;
use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOneData;
use datadog_api_client::datadogV2::model::OrgGroupType;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body = OrgGroupMembershipBulkUpdateRequest::new(OrgGroupMembershipBulkUpdateData::new(
        OrgGroupMembershipBulkUpdateAttributes::new(vec![GlobalOrgIdentifier::new(
            "us1".to_string(),
            Uuid::parse_str("c3d4e5f6-a7b8-9012-cdef-012345678901").expect("invalid UUID"),
        )]),
        OrgGroupMembershipBulkUpdateRelationships::new(
            OrgGroupRelationshipToOne::new(OrgGroupRelationshipToOneData::new(
                Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
                OrgGroupType::ORG_GROUPS,
            )),
            OrgGroupRelationshipToOne::new(OrgGroupRelationshipToOneData::new(
                Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
                OrgGroupType::ORG_GROUPS,
            )),
        ),
        OrgGroupMembershipBulkUpdateType::ORG_GROUP_MEMBERSHIP_BULK_UPDATES,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.BulkUpdateOrgGroupMemberships", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api.bulk_update_org_group_memberships(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
/**
 * Bulk update org group memberships returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.bulkUpdateOrgGroupMemberships"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiBulkUpdateOrgGroupMembershipsRequest = {
  body: {
    data: {
      attributes: {
        orgs: [
          {
            orgSite: "us1",
            orgUuid: "c3d4e5f6-a7b8-9012-cdef-012345678901",
          },
        ],
      },
      relationships: {
        sourceOrgGroup: {
          data: {
            id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
            type: "org_groups",
          },
        },
        targetOrgGroup: {
          data: {
            id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
            type: "org_groups",
          },
        },
      },
      type: "org_group_membership_bulk_updates",
    },
  },
};

apiInstance
  .bulkUpdateOrgGroupMemberships(params)
  .then((data: v2.OrgGroupMembershipListResponse) => {
    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 %}

## List org group policies{% #list-org-group-policies %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                |
| ----------------- | ----------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/org_group_policies |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/org_group_policies |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/org_group_policies      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/org_group_policies      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/org_group_policies  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/org_group_policies     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/org_group_policies |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/org_group_policies |

### Overview

List policies for an organization group. Requires a filter on org group ID. This endpoint requires the `org_group_read` permission.

### Arguments

#### Query Strings

| Name                                   | Type    | Description                                                                                                                              |
| -------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| filter[org_group_id] [*required*] | string  | Filter policies by org group ID.                                                                                                         |
| filter[policy_name]                    | string  | Filter policies by policy name.                                                                                                          |
| page[number]                           | integer | The page number to return.                                                                                                               |
| page[size]                             | integer | The number of items per page. Maximum is 1000.                                                                                           |
| sort                                   | enum    | Field to sort policies by. Supported values: `id`, `name`, `-id`, `-name`. Defaults to `id`. Allowed enum values: `id, -id, name, -name` |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of org group policies.

| Parent field  | Field                              | Type      | Description                                                                                                                                                                                                                                                                                                                                |
| ------------- | ---------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|               | data [*required*]             | [object]  | An array of org group policies.                                                                                                                                                                                                                                                                                                            |
| data          | attributes [*required*]       | object    | Attributes of an org group policy.                                                                                                                                                                                                                                                                                                         |
| attributes    | content                            | object    | The policy content as key-value pairs.                                                                                                                                                                                                                                                                                                     |
| attributes    | enforcement_tier [*required*] | enum      | The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. Allowed enum values: `OVERRIDE_ALLOWED,GROUP_MANAGED,DELEGATE` |
| attributes    | modified_at [*required*]      | date-time | Timestamp when the policy was last modified.                                                                                                                                                                                                                                                                                               |
| attributes    | policy_name [*required*]      | string    | The name of the policy.                                                                                                                                                                                                                                                                                                                    |
| attributes    | policy_type [*required*]      | enum      | The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. Allowed enum values: `org_config`                                                                                                                                                                             |
| data          | id [*required*]               | uuid      | The ID of the org group policy.                                                                                                                                                                                                                                                                                                            |
| data          | relationships                      | object    | Relationships of an org group policy.                                                                                                                                                                                                                                                                                                      |
| relationships | org_group                          | object    | Relationship to a single org group.                                                                                                                                                                                                                                                                                                        |
| org_group     | data [*required*]             | object    | A reference to an org group.                                                                                                                                                                                                                                                                                                               |
| data          | id [*required*]               | uuid      | The ID of the org group.                                                                                                                                                                                                                                                                                                                   |
| data          | type [*required*]             | enum      | Org groups resource type. Allowed enum values: `org_groups`                                                                                                                                                                                                                                                                                |
| data          | type [*required*]             | enum      | Org group policies resource type. Allowed enum values: `org_group_policies`                                                                                                                                                                                                                                                                |
|               | links                              | object    | Pagination links for navigating between pages of an org group list response.                                                                                                                                                                                                                                                               |
| links         | first                              | string    | Link to the first page.                                                                                                                                                                                                                                                                                                                    |
| links         | last                               | string    | Link to the last page.                                                                                                                                                                                                                                                                                                                     |
| links         | next                               | string    | Link to the next page.                                                                                                                                                                                                                                                                                                                     |
| links         | prev                               | string    | Link to the previous page.                                                                                                                                                                                                                                                                                                                 |
| links         | self                               | string    | Link to the current page.                                                                                                                                                                                                                                                                                                                  |
|               | meta                               | object    | Pagination metadata for org group list responses.                                                                                                                                                                                                                                                                                          |
| meta          | page                               | object    | Page-based pagination details for org group list responses.                                                                                                                                                                                                                                                                                |
| page          | first_number                       | int64     | First page number.                                                                                                                                                                                                                                                                                                                         |
| page          | last_number                        | int64     | Last page number.                                                                                                                                                                                                                                                                                                                          |
| page          | next_number                        | int64     | Next page number.                                                                                                                                                                                                                                                                                                                          |
| page          | number                             | int64     | Page number.                                                                                                                                                                                                                                                                                                                               |
| page          | prev_number                        | int64     | Previous page number.                                                                                                                                                                                                                                                                                                                      |
| page          | size                               | int64     | Page size.                                                                                                                                                                                                                                                                                                                                 |
| page          | total                              | int64     | Total number of results.                                                                                                                                                                                                                                                                                                                   |
| page          | type                               | string    | Pagination type.                                                                                                                                                                                                                                                                                                                           |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "content": {
          "value": "UTC"
        },
        "enforcement_tier": "OVERRIDE_ALLOWED",
        "modified_at": "2024-01-15T10:30:00Z",
        "policy_name": "monitor_timezone",
        "policy_type": "org_config"
      },
      "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
      "relationships": {
        "org_group": {
          "data": {
            "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
            "type": "org_groups"
          }
        }
      },
      "type": "org_group_policies"
    }
  ],
  "links": {
    "first": "string",
    "last": "string",
    "next": "string",
    "prev": "string",
    "self": "string"
  },
  "meta": {
    "page": {
      "first_number": "integer",
      "last_number": "integer",
      "next_number": "integer",
      "number": "integer",
      "prev_number": "integer",
      "size": "integer",
      "total": "integer",
      "type": "number_size"
    }
  }
}
```

{% /tab %}

{% /tab %}

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

##### 
                  \# Required query arguments export filter[org_group_id]="a1b2c3d4-e5f6-7890-abcd-ef0123456789" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/org_group_policies?filter[org_group_id]=${filter[org_group_id]}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
List org group policies returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["list_org_group_policies"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.list_org_group_policies(
        filter_org_group_id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
    )

    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
# List org group policies returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_org_group_policies".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
p api_instance.list_org_group_policies("a1b2c3d4-e5f6-7890-abcd-ef0123456789")
```

#### 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
// List org group policies 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListOrgGroupPolicies", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.ListOrgGroupPolicies(ctx, uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"), *datadogV2.NewListOrgGroupPoliciesOptionalParameters())

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.ListOrgGroupPolicies`:\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
// List org group policies returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupPolicyListResponse;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.listOrgGroupPolicies", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      OrgGroupPolicyListResponse result =
          apiInstance.listOrgGroupPolicies(UUID.fromString("a1b2c3d4-e5f6-7890-abcd-ef0123456789"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#listOrgGroupPolicies");
      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
// List org group policies returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::ListOrgGroupPoliciesOptionalParams;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListOrgGroupPolicies", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .list_org_group_policies(
            Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
            ListOrgGroupPoliciesOptionalParams::default(),
        )
        .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
/**
 * List org group policies returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listOrgGroupPolicies"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiListOrgGroupPoliciesRequest = {
  filterOrgGroupId: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
};

apiInstance
  .listOrgGroupPolicies(params)
  .then((data: v2.OrgGroupPolicyListResponse) => {
    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 %}

## Get an org group policy{% #get-an-org-group-policy %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                      |
| ----------------- | --------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/org_group_policies/{org_group_policy_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/org_group_policies/{org_group_policy_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/org_group_policies/{org_group_policy_id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |

### Overview

Get a specific organization group policy by its ID. This endpoint requires the `org_group_read` permission.

### Arguments

#### Path Parameters

| Name                                  | Type   | Description                     |
| ------------------------------------- | ------ | ------------------------------- |
| org_group_policy_id [*required*] | string | The ID of the org group policy. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single org group policy.

| Parent field  | Field                              | Type      | Description                                                                                                                                                                                                                                                                                                                                |
| ------------- | ---------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|               | data [*required*]             | object    | An org group policy resource.                                                                                                                                                                                                                                                                                                              |
| data          | attributes [*required*]       | object    | Attributes of an org group policy.                                                                                                                                                                                                                                                                                                         |
| attributes    | content                            | object    | The policy content as key-value pairs.                                                                                                                                                                                                                                                                                                     |
| attributes    | enforcement_tier [*required*] | enum      | The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. Allowed enum values: `OVERRIDE_ALLOWED,GROUP_MANAGED,DELEGATE` |
| attributes    | modified_at [*required*]      | date-time | Timestamp when the policy was last modified.                                                                                                                                                                                                                                                                                               |
| attributes    | policy_name [*required*]      | string    | The name of the policy.                                                                                                                                                                                                                                                                                                                    |
| attributes    | policy_type [*required*]      | enum      | The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. Allowed enum values: `org_config`                                                                                                                                                                             |
| data          | id [*required*]               | uuid      | The ID of the org group policy.                                                                                                                                                                                                                                                                                                            |
| data          | relationships                      | object    | Relationships of an org group policy.                                                                                                                                                                                                                                                                                                      |
| relationships | org_group                          | object    | Relationship to a single org group.                                                                                                                                                                                                                                                                                                        |
| org_group     | data [*required*]             | object    | A reference to an org group.                                                                                                                                                                                                                                                                                                               |
| data          | id [*required*]               | uuid      | The ID of the org group.                                                                                                                                                                                                                                                                                                                   |
| data          | type [*required*]             | enum      | Org groups resource type. Allowed enum values: `org_groups`                                                                                                                                                                                                                                                                                |
| data          | type [*required*]             | enum      | Org group policies resource type. Allowed enum values: `org_group_policies`                                                                                                                                                                                                                                                                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "content": {
        "value": "UTC"
      },
      "enforcement_tier": "OVERRIDE_ALLOWED",
      "modified_at": "2024-01-15T10:30:00Z",
      "policy_name": "monitor_timezone",
      "policy_type": "org_config"
    },
    "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_policies"
  }
}
```

{% /tab %}

{% /tab %}

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

##### 
                  \# Path parameters export org_group_policy_id="1a2b3c4d-5e6f-7890-abcd-ef0123456789" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/org_group_policies/${org_group_policy_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get an org group policy returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["get_org_group_policy"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.get_org_group_policy(
        org_group_policy_id=UUID("1a2b3c4d-5e6f-7890-abcd-ef0123456789"),
    )

    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
# Get an org group policy returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_org_group_policy".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
p api_instance.get_org_group_policy("1a2b3c4d-5e6f-7890-abcd-ef0123456789")
```

#### 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
// Get an org group policy 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetOrgGroupPolicy", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.GetOrgGroupPolicy(ctx, uuid.MustParse("1a2b3c4d-5e6f-7890-abcd-ef0123456789"))

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.GetOrgGroupPolicy`:\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
// Get an org group policy returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupPolicyResponse;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.getOrgGroupPolicy", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      OrgGroupPolicyResponse result =
          apiInstance.getOrgGroupPolicy(UUID.fromString("1a2b3c4d-5e6f-7890-abcd-ef0123456789"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#getOrgGroupPolicy");
      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
// Get an org group policy returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetOrgGroupPolicy", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .get_org_group_policy(
            Uuid::parse_str("1a2b3c4d-5e6f-7890-abcd-ef0123456789").expect("invalid UUID"),
        )
        .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
/**
 * Get an org group policy returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getOrgGroupPolicy"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiGetOrgGroupPolicyRequest = {
  orgGroupPolicyId: "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
};

apiInstance
  .getOrgGroupPolicy(params)
  .then((data: v2.OrgGroupPolicyResponse) => {
    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 %}

## Create an org group policy{% #create-an-org-group-policy %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                 |
| ----------------- | ------------------------------------------------------------ |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/org_group_policies |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/org_group_policies |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/org_group_policies      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/org_group_policies      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/org_group_policies  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/org_group_policies     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/org_group_policies |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/org_group_policies |

### Overview

Create a new policy for an organization group. This endpoint requires the `org_group_write` permission.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field  | Field                           | Type   | Description                                                                                                                                                                                                                                                                                                                                |
| ------------- | ------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|               | data [*required*]          | object | Data for creating an org group policy.                                                                                                                                                                                                                                                                                                     |
| data          | attributes [*required*]    | object | Attributes for creating an org group policy. If `policy_type` or `enforcement_tier` are not provided, they default to `org_config` and `DEFAULT` respectively.                                                                                                                                                                             |
| attributes    | content [*required*]       | object | The policy content as key-value pairs.                                                                                                                                                                                                                                                                                                     |
| attributes    | enforcement_tier                | enum   | The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. Allowed enum values: `OVERRIDE_ALLOWED,GROUP_MANAGED,DELEGATE` |
| attributes    | policy_name [*required*]   | string | The name of the policy.                                                                                                                                                                                                                                                                                                                    |
| attributes    | policy_type                     | enum   | The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. Allowed enum values: `org_config`                                                                                                                                                                             |
| data          | relationships [*required*] | object | Relationships for creating a policy.                                                                                                                                                                                                                                                                                                       |
| relationships | org_group [*required*]     | object | Relationship to a single org group.                                                                                                                                                                                                                                                                                                        |
| org_group     | data [*required*]          | object | A reference to an org group.                                                                                                                                                                                                                                                                                                               |
| data          | id [*required*]            | uuid   | The ID of the org group.                                                                                                                                                                                                                                                                                                                   |
| data          | type [*required*]          | enum   | Org groups resource type. Allowed enum values: `org_groups`                                                                                                                                                                                                                                                                                |
| data          | type [*required*]          | enum   | Org group policies resource type. Allowed enum values: `org_group_policies`                                                                                                                                                                                                                                                                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "content": {
        "value": "UTC"
      },
      "enforcement_tier": "OVERRIDE_ALLOWED",
      "policy_name": "monitor_timezone",
      "policy_type": "org_config"
    },
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_policies"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing a single org group policy.

| Parent field  | Field                              | Type      | Description                                                                                                                                                                                                                                                                                                                                |
| ------------- | ---------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|               | data [*required*]             | object    | An org group policy resource.                                                                                                                                                                                                                                                                                                              |
| data          | attributes [*required*]       | object    | Attributes of an org group policy.                                                                                                                                                                                                                                                                                                         |
| attributes    | content                            | object    | The policy content as key-value pairs.                                                                                                                                                                                                                                                                                                     |
| attributes    | enforcement_tier [*required*] | enum      | The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. Allowed enum values: `OVERRIDE_ALLOWED,GROUP_MANAGED,DELEGATE` |
| attributes    | modified_at [*required*]      | date-time | Timestamp when the policy was last modified.                                                                                                                                                                                                                                                                                               |
| attributes    | policy_name [*required*]      | string    | The name of the policy.                                                                                                                                                                                                                                                                                                                    |
| attributes    | policy_type [*required*]      | enum      | The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. Allowed enum values: `org_config`                                                                                                                                                                             |
| data          | id [*required*]               | uuid      | The ID of the org group policy.                                                                                                                                                                                                                                                                                                            |
| data          | relationships                      | object    | Relationships of an org group policy.                                                                                                                                                                                                                                                                                                      |
| relationships | org_group                          | object    | Relationship to a single org group.                                                                                                                                                                                                                                                                                                        |
| org_group     | data [*required*]             | object    | A reference to an org group.                                                                                                                                                                                                                                                                                                               |
| data          | id [*required*]               | uuid      | The ID of the org group.                                                                                                                                                                                                                                                                                                                   |
| data          | type [*required*]             | enum      | Org groups resource type. Allowed enum values: `org_groups`                                                                                                                                                                                                                                                                                |
| data          | type [*required*]             | enum      | Org group policies resource type. Allowed enum values: `org_group_policies`                                                                                                                                                                                                                                                                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "content": {
        "value": "UTC"
      },
      "enforcement_tier": "OVERRIDE_ALLOWED",
      "modified_at": "2024-01-15T10:30:00Z",
      "policy_name": "monitor_timezone",
      "policy_type": "org_config"
    },
    "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_policies"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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="401" %}
Unauthorized
{% 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="403" %}
Forbidden
{% 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="409" %}
Conflict
{% 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
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/org_group_policies" \
-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": {
      "content": {
        "value": "UTC"
      },
      "enforcement_tier": "OVERRIDE_ALLOWED",
      "policy_name": "monitor_timezone",
      "policy_type": "org_config"
    },
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_policies"
  }
}
EOF 
                
##### 

```python
"""
Create an org group policy returns "Created" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from datadog_api_client.v2.model.org_group_policy_create_attributes import OrgGroupPolicyCreateAttributes
from datadog_api_client.v2.model.org_group_policy_create_data import OrgGroupPolicyCreateData
from datadog_api_client.v2.model.org_group_policy_create_relationships import OrgGroupPolicyCreateRelationships
from datadog_api_client.v2.model.org_group_policy_create_request import OrgGroupPolicyCreateRequest
from datadog_api_client.v2.model.org_group_policy_enforcement_tier import OrgGroupPolicyEnforcementTier
from datadog_api_client.v2.model.org_group_policy_policy_type import OrgGroupPolicyPolicyType
from datadog_api_client.v2.model.org_group_policy_type import OrgGroupPolicyType
from datadog_api_client.v2.model.org_group_relationship_to_one import OrgGroupRelationshipToOne
from datadog_api_client.v2.model.org_group_relationship_to_one_data import OrgGroupRelationshipToOneData
from datadog_api_client.v2.model.org_group_type import OrgGroupType
from uuid import UUID

body = OrgGroupPolicyCreateRequest(
    data=OrgGroupPolicyCreateData(
        attributes=OrgGroupPolicyCreateAttributes(
            content=dict([("value", "UTC")]),
            enforcement_tier=OrgGroupPolicyEnforcementTier.DEFAULT,
            policy_name="monitor_timezone",
            policy_type=OrgGroupPolicyPolicyType.ORG_CONFIG,
        ),
        relationships=OrgGroupPolicyCreateRelationships(
            org_group=OrgGroupRelationshipToOne(
                data=OrgGroupRelationshipToOneData(
                    id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
                    type=OrgGroupType.ORG_GROUPS,
                ),
            ),
        ),
        type=OrgGroupPolicyType.ORG_GROUP_POLICIES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_org_group_policy"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.create_org_group_policy(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
# Create an org group policy returns "Created" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.create_org_group_policy".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new

body = DatadogAPIClient::V2::OrgGroupPolicyCreateRequest.new({
  data: DatadogAPIClient::V2::OrgGroupPolicyCreateData.new({
    attributes: DatadogAPIClient::V2::OrgGroupPolicyCreateAttributes.new({
      content: {
        "value": "UTC",
      },
      enforcement_tier: DatadogAPIClient::V2::OrgGroupPolicyEnforcementTier::DEFAULT,
      policy_name: "monitor_timezone",
      policy_type: DatadogAPIClient::V2::OrgGroupPolicyPolicyType::ORG_CONFIG,
    }),
    relationships: DatadogAPIClient::V2::OrgGroupPolicyCreateRelationships.new({
      org_group: DatadogAPIClient::V2::OrgGroupRelationshipToOne.new({
        data: DatadogAPIClient::V2::OrgGroupRelationshipToOneData.new({
          id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          type: DatadogAPIClient::V2::OrgGroupType::ORG_GROUPS,
        }),
      }),
    }),
    type: DatadogAPIClient::V2::OrgGroupPolicyType::ORG_GROUP_POLICIES,
  }),
})
p api_instance.create_org_group_policy(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
// Create an org group policy returns "Created" 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.OrgGroupPolicyCreateRequest{
		Data: datadogV2.OrgGroupPolicyCreateData{
			Attributes: datadogV2.OrgGroupPolicyCreateAttributes{
				Content: map[string]interface{}{
					"value": "UTC",
				},
				EnforcementTier: datadogV2.ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT.Ptr(),
				PolicyName:      "monitor_timezone",
				PolicyType:      datadogV2.ORGGROUPPOLICYPOLICYTYPE_ORG_CONFIG.Ptr(),
			},
			Relationships: datadogV2.OrgGroupPolicyCreateRelationships{
				OrgGroup: datadogV2.OrgGroupRelationshipToOne{
					Data: datadogV2.OrgGroupRelationshipToOneData{
						Id:   uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
						Type: datadogV2.ORGGROUPTYPE_ORG_GROUPS,
					},
				},
			},
			Type: datadogV2.ORGGROUPPOLICYTYPE_ORG_GROUP_POLICIES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateOrgGroupPolicy", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.CreateOrgGroupPolicy(ctx, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.CreateOrgGroupPolicy`:\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
// Create an org group policy returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupPolicyCreateAttributes;
import com.datadog.api.client.v2.model.OrgGroupPolicyCreateData;
import com.datadog.api.client.v2.model.OrgGroupPolicyCreateRelationships;
import com.datadog.api.client.v2.model.OrgGroupPolicyCreateRequest;
import com.datadog.api.client.v2.model.OrgGroupPolicyEnforcementTier;
import com.datadog.api.client.v2.model.OrgGroupPolicyPolicyType;
import com.datadog.api.client.v2.model.OrgGroupPolicyResponse;
import com.datadog.api.client.v2.model.OrgGroupPolicyType;
import com.datadog.api.client.v2.model.OrgGroupRelationshipToOne;
import com.datadog.api.client.v2.model.OrgGroupRelationshipToOneData;
import com.datadog.api.client.v2.model.OrgGroupType;
import java.util.Map;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.createOrgGroupPolicy", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    OrgGroupPolicyCreateRequest body =
        new OrgGroupPolicyCreateRequest()
            .data(
                new OrgGroupPolicyCreateData()
                    .attributes(
                        new OrgGroupPolicyCreateAttributes()
                            .content(Map.ofEntries(Map.entry("value", "UTC")))
                            .enforcementTier(OrgGroupPolicyEnforcementTier.DEFAULT)
                            .policyName("monitor_timezone")
                            .policyType(OrgGroupPolicyPolicyType.ORG_CONFIG))
                    .relationships(
                        new OrgGroupPolicyCreateRelationships()
                            .orgGroup(
                                new OrgGroupRelationshipToOne()
                                    .data(
                                        new OrgGroupRelationshipToOneData()
                                            .id(
                                                UUID.fromString(
                                                    "a1b2c3d4-e5f6-7890-abcd-ef0123456789"))
                                            .type(OrgGroupType.ORG_GROUPS))))
                    .type(OrgGroupPolicyType.ORG_GROUP_POLICIES));

    try {
      OrgGroupPolicyResponse result = apiInstance.createOrgGroupPolicy(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#createOrgGroupPolicy");
      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
// Create an org group policy returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use datadog_api_client::datadogV2::model::OrgGroupPolicyCreateAttributes;
use datadog_api_client::datadogV2::model::OrgGroupPolicyCreateData;
use datadog_api_client::datadogV2::model::OrgGroupPolicyCreateRelationships;
use datadog_api_client::datadogV2::model::OrgGroupPolicyCreateRequest;
use datadog_api_client::datadogV2::model::OrgGroupPolicyEnforcementTier;
use datadog_api_client::datadogV2::model::OrgGroupPolicyPolicyType;
use datadog_api_client::datadogV2::model::OrgGroupPolicyType;
use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOne;
use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOneData;
use datadog_api_client::datadogV2::model::OrgGroupType;
use serde_json::Value;
use std::collections::BTreeMap;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body = OrgGroupPolicyCreateRequest::new(OrgGroupPolicyCreateData::new(
        OrgGroupPolicyCreateAttributes::new(
            BTreeMap::from([("value".to_string(), Value::from("UTC"))]),
            "monitor_timezone".to_string(),
        )
        .enforcement_tier(OrgGroupPolicyEnforcementTier::DEFAULT)
        .policy_type(OrgGroupPolicyPolicyType::ORG_CONFIG),
        OrgGroupPolicyCreateRelationships::new(OrgGroupRelationshipToOne::new(
            OrgGroupRelationshipToOneData::new(
                Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
                OrgGroupType::ORG_GROUPS,
            ),
        )),
        OrgGroupPolicyType::ORG_GROUP_POLICIES,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateOrgGroupPolicy", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api.create_org_group_policy(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
/**
 * Create an org group policy returns "Created" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createOrgGroupPolicy"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiCreateOrgGroupPolicyRequest = {
  body: {
    data: {
      attributes: {
        content: {
          value: "UTC",
        },
        enforcementTier: "DEFAULT",
        policyName: "monitor_timezone",
        policyType: "org_config",
      },
      relationships: {
        orgGroup: {
          data: {
            id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
            type: "org_groups",
          },
        },
      },
      type: "org_group_policies",
    },
  },
};

apiInstance
  .createOrgGroupPolicy(params)
  .then((data: v2.OrgGroupPolicyResponse) => {
    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 %}

## Update an org group policy{% #update-an-org-group-policy %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                        |
| ----------------- | ----------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/org_group_policies/{org_group_policy_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/org_group_policies/{org_group_policy_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/org_group_policies/{org_group_policy_id}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |

### Overview

Update an existing organization group policy. This endpoint requires the `org_group_write` permission.

### Arguments

#### Path Parameters

| Name                                  | Type   | Description                     |
| ------------------------------------- | ------ | ------------------------------- |
| org_group_policy_id [*required*] | string | The ID of the org group policy. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                        | Type   | Description                                                                                                                                                                                                                                                                                                                                |
| ------------ | ---------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]       | object | Data for updating an org group policy.                                                                                                                                                                                                                                                                                                     |
| data         | attributes [*required*] | object | Attributes for updating an org group policy.                                                                                                                                                                                                                                                                                               |
| attributes   | content                      | object | The policy content as key-value pairs.                                                                                                                                                                                                                                                                                                     |
| attributes   | enforcement_tier             | enum   | The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. Allowed enum values: `OVERRIDE_ALLOWED,GROUP_MANAGED,DELEGATE` |
| data         | id [*required*]         | uuid   | The ID of the policy.                                                                                                                                                                                                                                                                                                                      |
| data         | type [*required*]       | enum   | Org group policies resource type. Allowed enum values: `org_group_policies`                                                                                                                                                                                                                                                                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "content": {
        "value": "UTC"
      },
      "enforcement_tier": "OVERRIDE_ALLOWED"
    },
    "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
    "type": "org_group_policies"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single org group policy.

| Parent field  | Field                              | Type      | Description                                                                                                                                                                                                                                                                                                                                |
| ------------- | ---------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|               | data [*required*]             | object    | An org group policy resource.                                                                                                                                                                                                                                                                                                              |
| data          | attributes [*required*]       | object    | Attributes of an org group policy.                                                                                                                                                                                                                                                                                                         |
| attributes    | content                            | object    | The policy content as key-value pairs.                                                                                                                                                                                                                                                                                                     |
| attributes    | enforcement_tier [*required*] | enum      | The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. Allowed enum values: `OVERRIDE_ALLOWED,GROUP_MANAGED,DELEGATE` |
| attributes    | modified_at [*required*]      | date-time | Timestamp when the policy was last modified.                                                                                                                                                                                                                                                                                               |
| attributes    | policy_name [*required*]      | string    | The name of the policy.                                                                                                                                                                                                                                                                                                                    |
| attributes    | policy_type [*required*]      | enum      | The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. Allowed enum values: `org_config`                                                                                                                                                                             |
| data          | id [*required*]               | uuid      | The ID of the org group policy.                                                                                                                                                                                                                                                                                                            |
| data          | relationships                      | object    | Relationships of an org group policy.                                                                                                                                                                                                                                                                                                      |
| relationships | org_group                          | object    | Relationship to a single org group.                                                                                                                                                                                                                                                                                                        |
| org_group     | data [*required*]             | object    | A reference to an org group.                                                                                                                                                                                                                                                                                                               |
| data          | id [*required*]               | uuid      | The ID of the org group.                                                                                                                                                                                                                                                                                                                   |
| data          | type [*required*]             | enum      | Org groups resource type. Allowed enum values: `org_groups`                                                                                                                                                                                                                                                                                |
| data          | type [*required*]             | enum      | Org group policies resource type. Allowed enum values: `org_group_policies`                                                                                                                                                                                                                                                                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "content": {
        "value": "UTC"
      },
      "enforcement_tier": "OVERRIDE_ALLOWED",
      "modified_at": "2024-01-15T10:30:00Z",
      "policy_name": "monitor_timezone",
      "policy_type": "org_config"
    },
    "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      }
    },
    "type": "org_group_policies"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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="401" %}
Unauthorized
{% 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="403" %}
Forbidden
{% 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="404" %}
Not Found
{% 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 org_group_policy_id="1a2b3c4d-5e6f-7890-abcd-ef0123456789" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/org_group_policies/${org_group_policy_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": {
      "content": {
        "value": "US/Eastern"
      },
      "enforcement_tier": "GROUP_MANAGED"
    },
    "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
    "type": "org_group_policies"
  }
}
EOF 
                
##### 

```python
"""
Update an org group policy returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from datadog_api_client.v2.model.org_group_policy_enforcement_tier import OrgGroupPolicyEnforcementTier
from datadog_api_client.v2.model.org_group_policy_type import OrgGroupPolicyType
from datadog_api_client.v2.model.org_group_policy_update_attributes import OrgGroupPolicyUpdateAttributes
from datadog_api_client.v2.model.org_group_policy_update_data import OrgGroupPolicyUpdateData
from datadog_api_client.v2.model.org_group_policy_update_request import OrgGroupPolicyUpdateRequest
from uuid import UUID

body = OrgGroupPolicyUpdateRequest(
    data=OrgGroupPolicyUpdateData(
        attributes=OrgGroupPolicyUpdateAttributes(
            content=dict([("value", "UTC")]),
            enforcement_tier=OrgGroupPolicyEnforcementTier.DEFAULT,
        ),
        id=UUID("1a2b3c4d-5e6f-7890-abcd-ef0123456789"),
        type=OrgGroupPolicyType.ORG_GROUP_POLICIES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_org_group_policy"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.update_org_group_policy(
        org_group_policy_id=UUID("1a2b3c4d-5e6f-7890-abcd-ef0123456789"), 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 an org group policy returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.update_org_group_policy".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new

body = DatadogAPIClient::V2::OrgGroupPolicyUpdateRequest.new({
  data: DatadogAPIClient::V2::OrgGroupPolicyUpdateData.new({
    attributes: DatadogAPIClient::V2::OrgGroupPolicyUpdateAttributes.new({
      content: {
        "value": "UTC",
      },
      enforcement_tier: DatadogAPIClient::V2::OrgGroupPolicyEnforcementTier::DEFAULT,
    }),
    id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
    type: DatadogAPIClient::V2::OrgGroupPolicyType::ORG_GROUP_POLICIES,
  }),
})
p api_instance.update_org_group_policy("1a2b3c4d-5e6f-7890-abcd-ef0123456789", 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 an org group policy 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.OrgGroupPolicyUpdateRequest{
		Data: datadogV2.OrgGroupPolicyUpdateData{
			Attributes: datadogV2.OrgGroupPolicyUpdateAttributes{
				Content: map[string]interface{}{
					"value": "UTC",
				},
				EnforcementTier: datadogV2.ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT.Ptr(),
			},
			Id:   uuid.MustParse("1a2b3c4d-5e6f-7890-abcd-ef0123456789"),
			Type: datadogV2.ORGGROUPPOLICYTYPE_ORG_GROUP_POLICIES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateOrgGroupPolicy", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.UpdateOrgGroupPolicy(ctx, uuid.MustParse("1a2b3c4d-5e6f-7890-abcd-ef0123456789"), body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.UpdateOrgGroupPolicy`:\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 an org group policy returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupPolicyEnforcementTier;
import com.datadog.api.client.v2.model.OrgGroupPolicyResponse;
import com.datadog.api.client.v2.model.OrgGroupPolicyType;
import com.datadog.api.client.v2.model.OrgGroupPolicyUpdateAttributes;
import com.datadog.api.client.v2.model.OrgGroupPolicyUpdateData;
import com.datadog.api.client.v2.model.OrgGroupPolicyUpdateRequest;
import java.util.Map;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.updateOrgGroupPolicy", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    OrgGroupPolicyUpdateRequest body =
        new OrgGroupPolicyUpdateRequest()
            .data(
                new OrgGroupPolicyUpdateData()
                    .attributes(
                        new OrgGroupPolicyUpdateAttributes()
                            .content(Map.ofEntries(Map.entry("value", "UTC")))
                            .enforcementTier(OrgGroupPolicyEnforcementTier.DEFAULT))
                    .id(UUID.fromString("1a2b3c4d-5e6f-7890-abcd-ef0123456789"))
                    .type(OrgGroupPolicyType.ORG_GROUP_POLICIES));

    try {
      OrgGroupPolicyResponse result =
          apiInstance.updateOrgGroupPolicy(
              UUID.fromString("1a2b3c4d-5e6f-7890-abcd-ef0123456789"), body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#updateOrgGroupPolicy");
      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 an org group policy returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use datadog_api_client::datadogV2::model::OrgGroupPolicyEnforcementTier;
use datadog_api_client::datadogV2::model::OrgGroupPolicyType;
use datadog_api_client::datadogV2::model::OrgGroupPolicyUpdateAttributes;
use datadog_api_client::datadogV2::model::OrgGroupPolicyUpdateData;
use datadog_api_client::datadogV2::model::OrgGroupPolicyUpdateRequest;
use serde_json::Value;
use std::collections::BTreeMap;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body = OrgGroupPolicyUpdateRequest::new(OrgGroupPolicyUpdateData::new(
        OrgGroupPolicyUpdateAttributes::new()
            .content(BTreeMap::from([("value".to_string(), Value::from("UTC"))]))
            .enforcement_tier(OrgGroupPolicyEnforcementTier::DEFAULT),
        Uuid::parse_str("1a2b3c4d-5e6f-7890-abcd-ef0123456789").expect("invalid UUID"),
        OrgGroupPolicyType::ORG_GROUP_POLICIES,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateOrgGroupPolicy", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .update_org_group_policy(
            Uuid::parse_str("1a2b3c4d-5e6f-7890-abcd-ef0123456789").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://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 an org group policy returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateOrgGroupPolicy"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiUpdateOrgGroupPolicyRequest = {
  body: {
    data: {
      attributes: {
        content: {
          value: "UTC",
        },
        enforcementTier: "DEFAULT",
      },
      id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
      type: "org_group_policies",
    },
  },
  orgGroupPolicyId: "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
};

apiInstance
  .updateOrgGroupPolicy(params)
  .then((data: v2.OrgGroupPolicyResponse) => {
    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 %}

## Delete an org group policy{% #delete-an-org-group-policy %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                         |
| ----------------- | ------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/org_group_policies/{org_group_policy_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/org_group_policies/{org_group_policy_id}      |
| us2.ddog-gov.com  | DELETE https://api.us2.ddog-gov.com/api/v2/org_group_policies/{org_group_policy_id}  |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/org_group_policies/{org_group_policy_id} |

### Overview

Delete an organization group policy by its ID. This endpoint requires the `org_group_write` permission.

### Arguments

#### Path Parameters

| Name                                  | Type   | Description                     |
| ------------------------------------- | ------ | ------------------------------- |
| org_group_policy_id [*required*] | string | The ID of the org group policy. |

### Response

{% tab title="204" %}
No Content
{% /tab %}

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

##### 
                  \# Path parameters export org_group_policy_id="1a2b3c4d-5e6f-7890-abcd-ef0123456789" \# Curl command curl -X DELETE "https://api.datadoghq.com/api/v2/org_group_policies/${org_group_policy_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Delete an org group policy returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["delete_org_group_policy"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    api_instance.delete_org_group_policy(
        org_group_policy_id=UUID("1a2b3c4d-5e6f-7890-abcd-ef0123456789"),
    )
```

#### 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
# Delete an org group policy returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.delete_org_group_policy".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
api_instance.delete_org_group_policy("1a2b3c4d-5e6f-7890-abcd-ef0123456789")
```

#### 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
// Delete an org group policy returns "No Content" response

package main

import (
	"context"
	"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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteOrgGroupPolicy", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	r, err := api.DeleteOrgGroupPolicy(ctx, uuid.MustParse("1a2b3c4d-5e6f-7890-abcd-ef0123456789"))

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

#### 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
// Delete an org group policy returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.deleteOrgGroupPolicy", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      apiInstance.deleteOrgGroupPolicy(UUID.fromString("1a2b3c4d-5e6f-7890-abcd-ef0123456789"));
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#deleteOrgGroupPolicy");
      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
// Delete an org group policy returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteOrgGroupPolicy", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .delete_org_group_policy(
            Uuid::parse_str("1a2b3c4d-5e6f-7890-abcd-ef0123456789").expect("invalid UUID"),
        )
        .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
/**
 * Delete an org group policy returns "No Content" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteOrgGroupPolicy"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiDeleteOrgGroupPolicyRequest = {
  orgGroupPolicyId: "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
};

apiInstance
  .deleteOrgGroupPolicy(params)
  .then((data: any) => {
    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 %}

## List org group policy overrides{% #list-org-group-policy-overrides %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                        |
| ----------------- | ------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/org_group_policy_overrides |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/org_group_policy_overrides |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/org_group_policy_overrides      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/org_group_policy_overrides      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/org_group_policy_overrides  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/org_group_policy_overrides     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/org_group_policy_overrides |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/org_group_policy_overrides |

### Overview

List policy overrides for an organization group. Requires a filter on org group ID. Optionally filter by policy ID. This endpoint requires the `org_group_read` permission.

### Arguments

#### Query Strings

| Name                                   | Type    | Description                                                                                                                                               |
| -------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter[org_group_id] [*required*] | string  | Filter policy overrides by org group ID.                                                                                                                  |
| filter[policy_id]                      | string  | Filter policy overrides by policy ID.                                                                                                                     |
| page[number]                           | integer | The page number to return.                                                                                                                                |
| page[size]                             | integer | The number of items per page. Maximum is 1000.                                                                                                            |
| sort                                   | enum    | Field to sort overrides by. Supported values: `id`, `org_uuid`, `-id`, `-org_uuid`. Defaults to `id`. Allowed enum values: `id, -id, org_uuid, -org_uuid` |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of org group policy overrides.

| Parent field     | Field                         | Type      | Description                                                                                 |
| ---------------- | ----------------------------- | --------- | ------------------------------------------------------------------------------------------- |
|                  | data [*required*]        | [object]  | An array of org group policy overrides.                                                     |
| data             | attributes [*required*]  | object    | Attributes of an org group policy override.                                                 |
| attributes       | content                       | object    | The override content as key-value pairs.                                                    |
| attributes       | created_at [*required*]  | date-time | Timestamp when the override was created.                                                    |
| attributes       | modified_at [*required*] | date-time | Timestamp when the override was last modified.                                              |
| attributes       | org_site [*required*]    | string    | The site of the organization that has the override.                                         |
| attributes       | org_uuid [*required*]    | uuid      | The UUID of the organization that has the override.                                         |
| data             | id [*required*]          | uuid      | The ID of the policy override.                                                              |
| data             | relationships                 | object    | Relationships of an org group policy override.                                              |
| relationships    | org_group                     | object    | Relationship to a single org group.                                                         |
| org_group        | data [*required*]        | object    | A reference to an org group.                                                                |
| data             | id [*required*]          | uuid      | The ID of the org group.                                                                    |
| data             | type [*required*]        | enum      | Org groups resource type. Allowed enum values: `org_groups`                                 |
| relationships    | org_group_policy              | object    | Relationship to a single org group policy.                                                  |
| org_group_policy | data [*required*]        | object    | A reference to an org group policy.                                                         |
| data             | id [*required*]          | uuid      | The ID of the policy.                                                                       |
| data             | type [*required*]        | enum      | Org group policies resource type. Allowed enum values: `org_group_policies`                 |
| data             | type [*required*]        | enum      | Org group policy overrides resource type. Allowed enum values: `org_group_policy_overrides` |
|                  | links                         | object    | Pagination links for navigating between pages of an org group list response.                |
| links            | first                         | string    | Link to the first page.                                                                     |
| links            | last                          | string    | Link to the last page.                                                                      |
| links            | next                          | string    | Link to the next page.                                                                      |
| links            | prev                          | string    | Link to the previous page.                                                                  |
| links            | self                          | string    | Link to the current page.                                                                   |
|                  | meta                          | object    | Pagination metadata for org group list responses.                                           |
| meta             | page                          | object    | Page-based pagination details for org group list responses.                                 |
| page             | first_number                  | int64     | First page number.                                                                          |
| page             | last_number                   | int64     | Last page number.                                                                           |
| page             | next_number                   | int64     | Next page number.                                                                           |
| page             | number                        | int64     | Page number.                                                                                |
| page             | prev_number                   | int64     | Previous page number.                                                                       |
| page             | size                          | int64     | Page size.                                                                                  |
| page             | total                         | int64     | Total number of results.                                                                    |
| page             | type                          | string    | Pagination type.                                                                            |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "content": {},
        "created_at": "2024-01-15T10:30:00Z",
        "modified_at": "2024-01-15T10:30:00Z",
        "org_site": "us1",
        "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
      },
      "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
      "relationships": {
        "org_group": {
          "data": {
            "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
            "type": "org_groups"
          }
        },
        "org_group_policy": {
          "data": {
            "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
            "type": "org_group_policies"
          }
        }
      },
      "type": "org_group_policy_overrides"
    }
  ],
  "links": {
    "first": "string",
    "last": "string",
    "next": "string",
    "prev": "string",
    "self": "string"
  },
  "meta": {
    "page": {
      "first_number": "integer",
      "last_number": "integer",
      "next_number": "integer",
      "number": "integer",
      "prev_number": "integer",
      "size": "integer",
      "total": "integer",
      "type": "number_size"
    }
  }
}
```

{% /tab %}

{% /tab %}

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

##### 
                  \# Required query arguments export filter[org_group_id]="a1b2c3d4-e5f6-7890-abcd-ef0123456789" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/org_group_policy_overrides?filter[org_group_id]=${filter[org_group_id]}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
List org group policy overrides returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["list_org_group_policy_overrides"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.list_org_group_policy_overrides(
        filter_org_group_id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
    )

    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
# List org group policy overrides returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_org_group_policy_overrides".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
p api_instance.list_org_group_policy_overrides("a1b2c3d4-e5f6-7890-abcd-ef0123456789")
```

#### 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
// List org group policy overrides 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListOrgGroupPolicyOverrides", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.ListOrgGroupPolicyOverrides(ctx, uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"), *datadogV2.NewListOrgGroupPolicyOverridesOptionalParameters())

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.ListOrgGroupPolicyOverrides`:\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
// List org group policy overrides returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideListResponse;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.listOrgGroupPolicyOverrides", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      OrgGroupPolicyOverrideListResponse result =
          apiInstance.listOrgGroupPolicyOverrides(
              UUID.fromString("a1b2c3d4-e5f6-7890-abcd-ef0123456789"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#listOrgGroupPolicyOverrides");
      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
// List org group policy overrides returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::ListOrgGroupPolicyOverridesOptionalParams;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListOrgGroupPolicyOverrides", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .list_org_group_policy_overrides(
            Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
            ListOrgGroupPolicyOverridesOptionalParams::default(),
        )
        .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
/**
 * List org group policy overrides returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listOrgGroupPolicyOverrides"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiListOrgGroupPolicyOverridesRequest = {
  filterOrgGroupId: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
};

apiInstance
  .listOrgGroupPolicyOverrides(params)
  .then((data: v2.OrgGroupPolicyOverrideListResponse) => {
    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 %}

## Get an org group policy override{% #get-an-org-group-policy-override %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                       |
| ----------------- | -------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/org_group_policy_overrides/{org_group_policy_override_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |

### Overview

Get a specific organization group policy override by its ID. This endpoint requires the `org_group_read` permission.

### Arguments

#### Path Parameters

| Name                                           | Type   | Description                              |
| ---------------------------------------------- | ------ | ---------------------------------------- |
| org_group_policy_override_id [*required*] | string | The ID of the org group policy override. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single org group policy override.

| Parent field     | Field                         | Type      | Description                                                                                 |
| ---------------- | ----------------------------- | --------- | ------------------------------------------------------------------------------------------- |
|                  | data [*required*]        | object    | An org group policy override resource.                                                      |
| data             | attributes [*required*]  | object    | Attributes of an org group policy override.                                                 |
| attributes       | content                       | object    | The override content as key-value pairs.                                                    |
| attributes       | created_at [*required*]  | date-time | Timestamp when the override was created.                                                    |
| attributes       | modified_at [*required*] | date-time | Timestamp when the override was last modified.                                              |
| attributes       | org_site [*required*]    | string    | The site of the organization that has the override.                                         |
| attributes       | org_uuid [*required*]    | uuid      | The UUID of the organization that has the override.                                         |
| data             | id [*required*]          | uuid      | The ID of the policy override.                                                              |
| data             | relationships                 | object    | Relationships of an org group policy override.                                              |
| relationships    | org_group                     | object    | Relationship to a single org group.                                                         |
| org_group        | data [*required*]        | object    | A reference to an org group.                                                                |
| data             | id [*required*]          | uuid      | The ID of the org group.                                                                    |
| data             | type [*required*]        | enum      | Org groups resource type. Allowed enum values: `org_groups`                                 |
| relationships    | org_group_policy              | object    | Relationship to a single org group policy.                                                  |
| org_group_policy | data [*required*]        | object    | A reference to an org group policy.                                                         |
| data             | id [*required*]          | uuid      | The ID of the policy.                                                                       |
| data             | type [*required*]        | enum      | Org group policies resource type. Allowed enum values: `org_group_policies`                 |
| data             | type [*required*]        | enum      | Org group policy overrides resource type. Allowed enum values: `org_group_policy_overrides` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "content": {},
      "created_at": "2024-01-15T10:30:00Z",
      "modified_at": "2024-01-15T10:30:00Z",
      "org_site": "us1",
      "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
    },
    "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      },
      "org_group_policy": {
        "data": {
          "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
          "type": "org_group_policies"
        }
      }
    },
    "type": "org_group_policy_overrides"
  }
}
```

{% /tab %}

{% /tab %}

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

##### 
                  \# Path parameters export org_group_policy_override_id="9f8e7d6c-5b4a-3210-fedc-ba0987654321" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/org_group_policy_overrides/${org_group_policy_override_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get an org group policy override returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["get_org_group_policy_override"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.get_org_group_policy_override(
        org_group_policy_override_id=UUID("9f8e7d6c-5b4a-3210-fedc-ba0987654321"),
    )

    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
# Get an org group policy override returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_org_group_policy_override".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
p api_instance.get_org_group_policy_override("9f8e7d6c-5b4a-3210-fedc-ba0987654321")
```

#### 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
// Get an org group policy override 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetOrgGroupPolicyOverride", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.GetOrgGroupPolicyOverride(ctx, uuid.MustParse("9f8e7d6c-5b4a-3210-fedc-ba0987654321"))

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.GetOrgGroupPolicyOverride`:\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
// Get an org group policy override returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideResponse;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.getOrgGroupPolicyOverride", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      OrgGroupPolicyOverrideResponse result =
          apiInstance.getOrgGroupPolicyOverride(
              UUID.fromString("9f8e7d6c-5b4a-3210-fedc-ba0987654321"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#getOrgGroupPolicyOverride");
      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
// Get an org group policy override returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetOrgGroupPolicyOverride", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .get_org_group_policy_override(
            Uuid::parse_str("9f8e7d6c-5b4a-3210-fedc-ba0987654321").expect("invalid UUID"),
        )
        .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
/**
 * Get an org group policy override returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getOrgGroupPolicyOverride"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiGetOrgGroupPolicyOverrideRequest = {
  orgGroupPolicyOverrideId: "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
};

apiInstance
  .getOrgGroupPolicyOverride(params)
  .then((data: v2.OrgGroupPolicyOverrideResponse) => {
    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 %}

## Create an org group policy override{% #create-an-org-group-policy-override %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                         |
| ----------------- | -------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/org_group_policy_overrides |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/org_group_policy_overrides |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/org_group_policy_overrides      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/org_group_policy_overrides      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/org_group_policy_overrides  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/org_group_policy_overrides     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/org_group_policy_overrides |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/org_group_policy_overrides |

### Overview

Create a new policy override for an organization within an org group. This endpoint requires the `org_group_write` permission.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field     | Field                              | Type   | Description                                                                                 |
| ---------------- | ---------------------------------- | ------ | ------------------------------------------------------------------------------------------- |
|                  | data [*required*]             | object | Data for creating an org group policy override.                                             |
| data             | attributes [*required*]       | object | Attributes for creating a policy override.                                                  |
| attributes       | org_site [*required*]         | string | The site of the organization.                                                               |
| attributes       | org_uuid [*required*]         | uuid   | The UUID of the organization to grant the override.                                         |
| data             | relationships [*required*]    | object | Relationships for creating a policy override.                                               |
| relationships    | org_group [*required*]        | object | Relationship to a single org group.                                                         |
| org_group        | data [*required*]             | object | A reference to an org group.                                                                |
| data             | id [*required*]               | uuid   | The ID of the org group.                                                                    |
| data             | type [*required*]             | enum   | Org groups resource type. Allowed enum values: `org_groups`                                 |
| relationships    | org_group_policy [*required*] | object | Relationship to a single org group policy.                                                  |
| org_group_policy | data [*required*]             | object | A reference to an org group policy.                                                         |
| data             | id [*required*]               | uuid   | The ID of the policy.                                                                       |
| data             | type [*required*]             | enum   | Org group policies resource type. Allowed enum values: `org_group_policies`                 |
| data             | type [*required*]             | enum   | Org group policy overrides resource type. Allowed enum values: `org_group_policy_overrides` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "org_site": "us1",
      "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
    },
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      },
      "org_group_policy": {
        "data": {
          "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
          "type": "org_group_policies"
        }
      }
    },
    "type": "org_group_policy_overrides"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing a single org group policy override.

| Parent field     | Field                         | Type      | Description                                                                                 |
| ---------------- | ----------------------------- | --------- | ------------------------------------------------------------------------------------------- |
|                  | data [*required*]        | object    | An org group policy override resource.                                                      |
| data             | attributes [*required*]  | object    | Attributes of an org group policy override.                                                 |
| attributes       | content                       | object    | The override content as key-value pairs.                                                    |
| attributes       | created_at [*required*]  | date-time | Timestamp when the override was created.                                                    |
| attributes       | modified_at [*required*] | date-time | Timestamp when the override was last modified.                                              |
| attributes       | org_site [*required*]    | string    | The site of the organization that has the override.                                         |
| attributes       | org_uuid [*required*]    | uuid      | The UUID of the organization that has the override.                                         |
| data             | id [*required*]          | uuid      | The ID of the policy override.                                                              |
| data             | relationships                 | object    | Relationships of an org group policy override.                                              |
| relationships    | org_group                     | object    | Relationship to a single org group.                                                         |
| org_group        | data [*required*]        | object    | A reference to an org group.                                                                |
| data             | id [*required*]          | uuid      | The ID of the org group.                                                                    |
| data             | type [*required*]        | enum      | Org groups resource type. Allowed enum values: `org_groups`                                 |
| relationships    | org_group_policy              | object    | Relationship to a single org group policy.                                                  |
| org_group_policy | data [*required*]        | object    | A reference to an org group policy.                                                         |
| data             | id [*required*]          | uuid      | The ID of the policy.                                                                       |
| data             | type [*required*]        | enum      | Org group policies resource type. Allowed enum values: `org_group_policies`                 |
| data             | type [*required*]        | enum      | Org group policy overrides resource type. Allowed enum values: `org_group_policy_overrides` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "content": {},
      "created_at": "2024-01-15T10:30:00Z",
      "modified_at": "2024-01-15T10:30:00Z",
      "org_site": "us1",
      "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
    },
    "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      },
      "org_group_policy": {
        "data": {
          "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
          "type": "org_group_policies"
        }
      }
    },
    "type": "org_group_policy_overrides"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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="401" %}
Unauthorized
{% 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="403" %}
Forbidden
{% 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="409" %}
Conflict
{% 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
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/org_group_policy_overrides" \
-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": {
      "org_site": "us1",
      "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
    },
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      },
      "org_group_policy": {
        "data": {
          "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
          "type": "org_group_policies"
        }
      }
    },
    "type": "org_group_policy_overrides"
  }
}
EOF 
                
##### 

```python
"""
Create an org group policy override returns "Created" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from datadog_api_client.v2.model.org_group_policy_override_create_attributes import (
    OrgGroupPolicyOverrideCreateAttributes,
)
from datadog_api_client.v2.model.org_group_policy_override_create_data import OrgGroupPolicyOverrideCreateData
from datadog_api_client.v2.model.org_group_policy_override_create_relationships import (
    OrgGroupPolicyOverrideCreateRelationships,
)
from datadog_api_client.v2.model.org_group_policy_override_create_request import OrgGroupPolicyOverrideCreateRequest
from datadog_api_client.v2.model.org_group_policy_override_type import OrgGroupPolicyOverrideType
from datadog_api_client.v2.model.org_group_policy_relationship_to_one import OrgGroupPolicyRelationshipToOne
from datadog_api_client.v2.model.org_group_policy_relationship_to_one_data import OrgGroupPolicyRelationshipToOneData
from datadog_api_client.v2.model.org_group_policy_type import OrgGroupPolicyType
from datadog_api_client.v2.model.org_group_relationship_to_one import OrgGroupRelationshipToOne
from datadog_api_client.v2.model.org_group_relationship_to_one_data import OrgGroupRelationshipToOneData
from datadog_api_client.v2.model.org_group_type import OrgGroupType
from uuid import UUID

body = OrgGroupPolicyOverrideCreateRequest(
    data=OrgGroupPolicyOverrideCreateData(
        attributes=OrgGroupPolicyOverrideCreateAttributes(
            org_site="us1",
            org_uuid=UUID("c3d4e5f6-a7b8-9012-cdef-012345678901"),
        ),
        relationships=OrgGroupPolicyOverrideCreateRelationships(
            org_group=OrgGroupRelationshipToOne(
                data=OrgGroupRelationshipToOneData(
                    id=UUID("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
                    type=OrgGroupType.ORG_GROUPS,
                ),
            ),
            org_group_policy=OrgGroupPolicyRelationshipToOne(
                data=OrgGroupPolicyRelationshipToOneData(
                    id=UUID("1a2b3c4d-5e6f-7890-abcd-ef0123456789"),
                    type=OrgGroupPolicyType.ORG_GROUP_POLICIES,
                ),
            ),
        ),
        type=OrgGroupPolicyOverrideType.ORG_GROUP_POLICY_OVERRIDES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_org_group_policy_override"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.create_org_group_policy_override(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
# Create an org group policy override returns "Created" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.create_org_group_policy_override".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new

body = DatadogAPIClient::V2::OrgGroupPolicyOverrideCreateRequest.new({
  data: DatadogAPIClient::V2::OrgGroupPolicyOverrideCreateData.new({
    attributes: DatadogAPIClient::V2::OrgGroupPolicyOverrideCreateAttributes.new({
      org_site: "us1",
      org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901",
    }),
    relationships: DatadogAPIClient::V2::OrgGroupPolicyOverrideCreateRelationships.new({
      org_group: DatadogAPIClient::V2::OrgGroupRelationshipToOne.new({
        data: DatadogAPIClient::V2::OrgGroupRelationshipToOneData.new({
          id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          type: DatadogAPIClient::V2::OrgGroupType::ORG_GROUPS,
        }),
      }),
      org_group_policy: DatadogAPIClient::V2::OrgGroupPolicyRelationshipToOne.new({
        data: DatadogAPIClient::V2::OrgGroupPolicyRelationshipToOneData.new({
          id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
          type: DatadogAPIClient::V2::OrgGroupPolicyType::ORG_GROUP_POLICIES,
        }),
      }),
    }),
    type: DatadogAPIClient::V2::OrgGroupPolicyOverrideType::ORG_GROUP_POLICY_OVERRIDES,
  }),
})
p api_instance.create_org_group_policy_override(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
// Create an org group policy override returns "Created" 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.OrgGroupPolicyOverrideCreateRequest{
		Data: datadogV2.OrgGroupPolicyOverrideCreateData{
			Attributes: datadogV2.OrgGroupPolicyOverrideCreateAttributes{
				OrgSite: "us1",
				OrgUuid: uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-012345678901"),
			},
			Relationships: datadogV2.OrgGroupPolicyOverrideCreateRelationships{
				OrgGroup: datadogV2.OrgGroupRelationshipToOne{
					Data: datadogV2.OrgGroupRelationshipToOneData{
						Id:   uuid.MustParse("a1b2c3d4-e5f6-7890-abcd-ef0123456789"),
						Type: datadogV2.ORGGROUPTYPE_ORG_GROUPS,
					},
				},
				OrgGroupPolicy: datadogV2.OrgGroupPolicyRelationshipToOne{
					Data: datadogV2.OrgGroupPolicyRelationshipToOneData{
						Id:   uuid.MustParse("1a2b3c4d-5e6f-7890-abcd-ef0123456789"),
						Type: datadogV2.ORGGROUPPOLICYTYPE_ORG_GROUP_POLICIES,
					},
				},
			},
			Type: datadogV2.ORGGROUPPOLICYOVERRIDETYPE_ORG_GROUP_POLICY_OVERRIDES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateOrgGroupPolicyOverride", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.CreateOrgGroupPolicyOverride(ctx, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.CreateOrgGroupPolicyOverride`:\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
// Create an org group policy override returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideCreateAttributes;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideCreateData;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideCreateRelationships;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideCreateRequest;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideResponse;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideType;
import com.datadog.api.client.v2.model.OrgGroupPolicyRelationshipToOne;
import com.datadog.api.client.v2.model.OrgGroupPolicyRelationshipToOneData;
import com.datadog.api.client.v2.model.OrgGroupPolicyType;
import com.datadog.api.client.v2.model.OrgGroupRelationshipToOne;
import com.datadog.api.client.v2.model.OrgGroupRelationshipToOneData;
import com.datadog.api.client.v2.model.OrgGroupType;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.createOrgGroupPolicyOverride", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    OrgGroupPolicyOverrideCreateRequest body =
        new OrgGroupPolicyOverrideCreateRequest()
            .data(
                new OrgGroupPolicyOverrideCreateData()
                    .attributes(
                        new OrgGroupPolicyOverrideCreateAttributes()
                            .orgSite("us1")
                            .orgUuid(UUID.fromString("c3d4e5f6-a7b8-9012-cdef-012345678901")))
                    .relationships(
                        new OrgGroupPolicyOverrideCreateRelationships()
                            .orgGroup(
                                new OrgGroupRelationshipToOne()
                                    .data(
                                        new OrgGroupRelationshipToOneData()
                                            .id(
                                                UUID.fromString(
                                                    "a1b2c3d4-e5f6-7890-abcd-ef0123456789"))
                                            .type(OrgGroupType.ORG_GROUPS)))
                            .orgGroupPolicy(
                                new OrgGroupPolicyRelationshipToOne()
                                    .data(
                                        new OrgGroupPolicyRelationshipToOneData()
                                            .id(
                                                UUID.fromString(
                                                    "1a2b3c4d-5e6f-7890-abcd-ef0123456789"))
                                            .type(OrgGroupPolicyType.ORG_GROUP_POLICIES))))
                    .type(OrgGroupPolicyOverrideType.ORG_GROUP_POLICY_OVERRIDES));

    try {
      OrgGroupPolicyOverrideResponse result = apiInstance.createOrgGroupPolicyOverride(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#createOrgGroupPolicyOverride");
      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
// Create an org group policy override returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideCreateAttributes;
use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideCreateData;
use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideCreateRelationships;
use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideCreateRequest;
use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideType;
use datadog_api_client::datadogV2::model::OrgGroupPolicyRelationshipToOne;
use datadog_api_client::datadogV2::model::OrgGroupPolicyRelationshipToOneData;
use datadog_api_client::datadogV2::model::OrgGroupPolicyType;
use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOne;
use datadog_api_client::datadogV2::model::OrgGroupRelationshipToOneData;
use datadog_api_client::datadogV2::model::OrgGroupType;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body = OrgGroupPolicyOverrideCreateRequest::new(OrgGroupPolicyOverrideCreateData::new(
        OrgGroupPolicyOverrideCreateAttributes::new(
            "us1".to_string(),
            Uuid::parse_str("c3d4e5f6-a7b8-9012-cdef-012345678901").expect("invalid UUID"),
        ),
        OrgGroupPolicyOverrideCreateRelationships::new(
            OrgGroupRelationshipToOne::new(OrgGroupRelationshipToOneData::new(
                Uuid::parse_str("a1b2c3d4-e5f6-7890-abcd-ef0123456789").expect("invalid UUID"),
                OrgGroupType::ORG_GROUPS,
            )),
            OrgGroupPolicyRelationshipToOne::new(OrgGroupPolicyRelationshipToOneData::new(
                Uuid::parse_str("1a2b3c4d-5e6f-7890-abcd-ef0123456789").expect("invalid UUID"),
                OrgGroupPolicyType::ORG_GROUP_POLICIES,
            )),
        ),
        OrgGroupPolicyOverrideType::ORG_GROUP_POLICY_OVERRIDES,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateOrgGroupPolicyOverride", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api.create_org_group_policy_override(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
/**
 * Create an org group policy override returns "Created" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createOrgGroupPolicyOverride"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiCreateOrgGroupPolicyOverrideRequest = {
  body: {
    data: {
      attributes: {
        orgSite: "us1",
        orgUuid: "c3d4e5f6-a7b8-9012-cdef-012345678901",
      },
      relationships: {
        orgGroup: {
          data: {
            id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
            type: "org_groups",
          },
        },
        orgGroupPolicy: {
          data: {
            id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
            type: "org_group_policies",
          },
        },
      },
      type: "org_group_policy_overrides",
    },
  },
};

apiInstance
  .createOrgGroupPolicyOverride(params)
  .then((data: v2.OrgGroupPolicyOverrideResponse) => {
    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 %}

## Update an org group policy override{% #update-an-org-group-policy-override %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                         |
| ----------------- | ---------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/org_group_policy_overrides/{org_group_policy_override_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |

### Overview

Update an existing organization group policy override. This endpoint requires the `org_group_write` permission.

### Arguments

#### Path Parameters

| Name                                           | Type   | Description                              |
| ---------------------------------------------- | ------ | ---------------------------------------- |
| org_group_policy_override_id [*required*] | string | The ID of the org group policy override. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                        | Type   | Description                                                                                                                             |
| ------------ | ---------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | Data for updating a policy override.                                                                                                    |
| data         | attributes [*required*] | object | Attributes for updating a policy override. The `org_uuid` and `org_site` fields must match the existing override and cannot be changed. |
| attributes   | org_site [*required*]   | string | The site of the organization.                                                                                                           |
| attributes   | org_uuid [*required*]   | uuid   | The UUID of the organization.                                                                                                           |
| data         | id [*required*]         | uuid   | The ID of the policy override.                                                                                                          |
| data         | type [*required*]       | enum   | Org group policy overrides resource type. Allowed enum values: `org_group_policy_overrides`                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "org_site": "us1",
      "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
    },
    "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
    "type": "org_group_policy_overrides"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single org group policy override.

| Parent field     | Field                         | Type      | Description                                                                                 |
| ---------------- | ----------------------------- | --------- | ------------------------------------------------------------------------------------------- |
|                  | data [*required*]        | object    | An org group policy override resource.                                                      |
| data             | attributes [*required*]  | object    | Attributes of an org group policy override.                                                 |
| attributes       | content                       | object    | The override content as key-value pairs.                                                    |
| attributes       | created_at [*required*]  | date-time | Timestamp when the override was created.                                                    |
| attributes       | modified_at [*required*] | date-time | Timestamp when the override was last modified.                                              |
| attributes       | org_site [*required*]    | string    | The site of the organization that has the override.                                         |
| attributes       | org_uuid [*required*]    | uuid      | The UUID of the organization that has the override.                                         |
| data             | id [*required*]          | uuid      | The ID of the policy override.                                                              |
| data             | relationships                 | object    | Relationships of an org group policy override.                                              |
| relationships    | org_group                     | object    | Relationship to a single org group.                                                         |
| org_group        | data [*required*]        | object    | A reference to an org group.                                                                |
| data             | id [*required*]          | uuid      | The ID of the org group.                                                                    |
| data             | type [*required*]        | enum      | Org groups resource type. Allowed enum values: `org_groups`                                 |
| relationships    | org_group_policy              | object    | Relationship to a single org group policy.                                                  |
| org_group_policy | data [*required*]        | object    | A reference to an org group policy.                                                         |
| data             | id [*required*]          | uuid      | The ID of the policy.                                                                       |
| data             | type [*required*]        | enum      | Org group policies resource type. Allowed enum values: `org_group_policies`                 |
| data             | type [*required*]        | enum      | Org group policy overrides resource type. Allowed enum values: `org_group_policy_overrides` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "content": {},
      "created_at": "2024-01-15T10:30:00Z",
      "modified_at": "2024-01-15T10:30:00Z",
      "org_site": "us1",
      "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
    },
    "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
    "relationships": {
      "org_group": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
          "type": "org_groups"
        }
      },
      "org_group_policy": {
        "data": {
          "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
          "type": "org_group_policies"
        }
      }
    },
    "type": "org_group_policy_overrides"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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="401" %}
Unauthorized
{% 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="403" %}
Forbidden
{% 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="404" %}
Not Found
{% 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 org_group_policy_override_id="9f8e7d6c-5b4a-3210-fedc-ba0987654321" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/org_group_policy_overrides/${org_group_policy_override_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": {
      "org_site": "us1",
      "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"
    },
    "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
    "type": "org_group_policy_overrides"
  }
}
EOF 
                
##### 

```python
"""
Update an org group policy override returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from datadog_api_client.v2.model.org_group_policy_override_type import OrgGroupPolicyOverrideType
from datadog_api_client.v2.model.org_group_policy_override_update_attributes import (
    OrgGroupPolicyOverrideUpdateAttributes,
)
from datadog_api_client.v2.model.org_group_policy_override_update_data import OrgGroupPolicyOverrideUpdateData
from datadog_api_client.v2.model.org_group_policy_override_update_request import OrgGroupPolicyOverrideUpdateRequest
from uuid import UUID

body = OrgGroupPolicyOverrideUpdateRequest(
    data=OrgGroupPolicyOverrideUpdateData(
        attributes=OrgGroupPolicyOverrideUpdateAttributes(
            org_site="us1",
            org_uuid=UUID("c3d4e5f6-a7b8-9012-cdef-012345678901"),
        ),
        id=UUID("9f8e7d6c-5b4a-3210-fedc-ba0987654321"),
        type=OrgGroupPolicyOverrideType.ORG_GROUP_POLICY_OVERRIDES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_org_group_policy_override"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.update_org_group_policy_override(
        org_group_policy_override_id=UUID("9f8e7d6c-5b4a-3210-fedc-ba0987654321"), 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 an org group policy override returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.update_org_group_policy_override".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new

body = DatadogAPIClient::V2::OrgGroupPolicyOverrideUpdateRequest.new({
  data: DatadogAPIClient::V2::OrgGroupPolicyOverrideUpdateData.new({
    attributes: DatadogAPIClient::V2::OrgGroupPolicyOverrideUpdateAttributes.new({
      org_site: "us1",
      org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901",
    }),
    id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
    type: DatadogAPIClient::V2::OrgGroupPolicyOverrideType::ORG_GROUP_POLICY_OVERRIDES,
  }),
})
p api_instance.update_org_group_policy_override("9f8e7d6c-5b4a-3210-fedc-ba0987654321", 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 an org group policy override 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.OrgGroupPolicyOverrideUpdateRequest{
		Data: datadogV2.OrgGroupPolicyOverrideUpdateData{
			Attributes: datadogV2.OrgGroupPolicyOverrideUpdateAttributes{
				OrgSite: "us1",
				OrgUuid: uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-012345678901"),
			},
			Id:   uuid.MustParse("9f8e7d6c-5b4a-3210-fedc-ba0987654321"),
			Type: datadogV2.ORGGROUPPOLICYOVERRIDETYPE_ORG_GROUP_POLICY_OVERRIDES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateOrgGroupPolicyOverride", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.UpdateOrgGroupPolicyOverride(ctx, uuid.MustParse("9f8e7d6c-5b4a-3210-fedc-ba0987654321"), body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.UpdateOrgGroupPolicyOverride`:\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 an org group policy override returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideResponse;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideType;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideUpdateAttributes;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideUpdateData;
import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideUpdateRequest;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.updateOrgGroupPolicyOverride", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    OrgGroupPolicyOverrideUpdateRequest body =
        new OrgGroupPolicyOverrideUpdateRequest()
            .data(
                new OrgGroupPolicyOverrideUpdateData()
                    .attributes(
                        new OrgGroupPolicyOverrideUpdateAttributes()
                            .orgSite("us1")
                            .orgUuid(UUID.fromString("c3d4e5f6-a7b8-9012-cdef-012345678901")))
                    .id(UUID.fromString("9f8e7d6c-5b4a-3210-fedc-ba0987654321"))
                    .type(OrgGroupPolicyOverrideType.ORG_GROUP_POLICY_OVERRIDES));

    try {
      OrgGroupPolicyOverrideResponse result =
          apiInstance.updateOrgGroupPolicyOverride(
              UUID.fromString("9f8e7d6c-5b4a-3210-fedc-ba0987654321"), body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#updateOrgGroupPolicyOverride");
      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 an org group policy override returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideType;
use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideUpdateAttributes;
use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideUpdateData;
use datadog_api_client::datadogV2::model::OrgGroupPolicyOverrideUpdateRequest;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body = OrgGroupPolicyOverrideUpdateRequest::new(OrgGroupPolicyOverrideUpdateData::new(
        OrgGroupPolicyOverrideUpdateAttributes::new(
            "us1".to_string(),
            Uuid::parse_str("c3d4e5f6-a7b8-9012-cdef-012345678901").expect("invalid UUID"),
        ),
        Uuid::parse_str("9f8e7d6c-5b4a-3210-fedc-ba0987654321").expect("invalid UUID"),
        OrgGroupPolicyOverrideType::ORG_GROUP_POLICY_OVERRIDES,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateOrgGroupPolicyOverride", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .update_org_group_policy_override(
            Uuid::parse_str("9f8e7d6c-5b4a-3210-fedc-ba0987654321").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://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 an org group policy override returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateOrgGroupPolicyOverride"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiUpdateOrgGroupPolicyOverrideRequest = {
  body: {
    data: {
      attributes: {
        orgSite: "us1",
        orgUuid: "c3d4e5f6-a7b8-9012-cdef-012345678901",
      },
      id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
      type: "org_group_policy_overrides",
    },
  },
  orgGroupPolicyOverrideId: "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
};

apiInstance
  .updateOrgGroupPolicyOverride(params)
  .then((data: v2.OrgGroupPolicyOverrideResponse) => {
    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 %}

## Delete an org group policy override{% #delete-an-org-group-policy-override %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                          |
| ----------------- | ----------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/org_group_policy_overrides/{org_group_policy_override_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id}      |
| us2.ddog-gov.com  | DELETE https://api.us2.ddog-gov.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id}  |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/org_group_policy_overrides/{org_group_policy_override_id} |

### Overview

Delete an organization group policy override by its ID. This endpoint requires the `org_group_write` permission.

### Arguments

#### Path Parameters

| Name                                           | Type   | Description                              |
| ---------------------------------------------- | ------ | ---------------------------------------- |
| org_group_policy_override_id [*required*] | string | The ID of the org group policy override. |

### Response

{% tab title="204" %}
No Content
{% /tab %}

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

##### 
                  \# Path parameters export org_group_policy_override_id="9f8e7d6c-5b4a-3210-fedc-ba0987654321" \# Curl command curl -X DELETE "https://api.datadoghq.com/api/v2/org_group_policy_overrides/${org_group_policy_override_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Delete an org group policy override returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["delete_org_group_policy_override"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    api_instance.delete_org_group_policy_override(
        org_group_policy_override_id=UUID("9f8e7d6c-5b4a-3210-fedc-ba0987654321"),
    )
```

#### 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
# Delete an org group policy override returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.delete_org_group_policy_override".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
api_instance.delete_org_group_policy_override("9f8e7d6c-5b4a-3210-fedc-ba0987654321")
```

#### 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
// Delete an org group policy override returns "No Content" response

package main

import (
	"context"
	"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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteOrgGroupPolicyOverride", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	r, err := api.DeleteOrgGroupPolicyOverride(ctx, uuid.MustParse("9f8e7d6c-5b4a-3210-fedc-ba0987654321"))

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

#### 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
// Delete an org group policy override returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.deleteOrgGroupPolicyOverride", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      apiInstance.deleteOrgGroupPolicyOverride(
          UUID.fromString("9f8e7d6c-5b4a-3210-fedc-ba0987654321"));
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#deleteOrgGroupPolicyOverride");
      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
// Delete an org group policy override returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteOrgGroupPolicyOverride", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api
        .delete_org_group_policy_override(
            Uuid::parse_str("9f8e7d6c-5b4a-3210-fedc-ba0987654321").expect("invalid UUID"),
        )
        .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
/**
 * Delete an org group policy override returns "No Content" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteOrgGroupPolicyOverride"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

const params: v2.OrgGroupsApiDeleteOrgGroupPolicyOverrideRequest = {
  orgGroupPolicyOverrideId: "9f8e7d6c-5b4a-3210-fedc-ba0987654321",
};

apiInstance
  .deleteOrgGroupPolicyOverride(params)
  .then((data: any) => {
    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 %}

## List org group policy configs{% #list-org-group-policy-configs %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                      |
| ----------------- | ----------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/org_group_policy_configs |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/org_group_policy_configs |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/org_group_policy_configs      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/org_group_policy_configs      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/org_group_policy_configs  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/org_group_policy_configs     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/org_group_policy_configs |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/org_group_policy_configs |

### Overview

List all org configs that are eligible to be used as organization group policies. This endpoint requires the `org_group_read` permission.

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of org group policy configs.

| Parent field | Field                            | Type     | Description                                                                             |
| ------------ | -------------------------------- | -------- | --------------------------------------------------------------------------------------- |
|              | data [*required*]           | [object] | An array of org group policy configs.                                                   |
| data         | attributes [*required*]     | object   | Attributes of an org group policy config.                                               |
| attributes   | allowed_values [*required*] | [string] | The allowed values for this config.                                                     |
| attributes   | default_value [*required*]  |          | The default value for this config.                                                      |
| attributes   | description [*required*]    | string   | The description of the policy config.                                                   |
| attributes   | name [*required*]           | string   | The name of the policy config.                                                          |
| attributes   | value_type [*required*]     | string   | The type of the value for this config.                                                  |
| data         | id [*required*]             | string   | The identifier of the policy config (uses the config name).                             |
| data         | type [*required*]           | enum     | Org group policy configs resource type. Allowed enum values: `org_group_policy_configs` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "allowed_values": [
          "UTC",
          "US/Eastern",
          "US/Pacific"
        ],
        "default_value": "UTC",
        "description": "The default timezone for monitors.",
        "name": "monitor_timezone",
        "value_type": "string"
      },
      "id": "monitor_timezone",
      "type": "org_group_policy_configs"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Unauthorized
{% 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="403" %}
Forbidden
{% 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

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

```python
"""
List org group policy configs returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi

configuration = Configuration()
configuration.unstable_operations["list_org_group_policy_configs"] = True
with ApiClient(configuration) as api_client:
    api_instance = OrgGroupsApi(api_client)
    response = api_instance.list_org_group_policy_configs()

    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
# List org group policy configs returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_org_group_policy_configs".to_sym] = true
end
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
p api_instance.list_org_group_policy_configs()
```

#### 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
// List org group policy configs 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListOrgGroupPolicyConfigs", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewOrgGroupsApi(apiClient)
	resp, r, err := api.ListOrgGroupPolicyConfigs(ctx)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.ListOrgGroupPolicyConfigs`:\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
// List org group policy configs returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OrgGroupsApi;
import com.datadog.api.client.v2.model.OrgGroupPolicyConfigListResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.listOrgGroupPolicyConfigs", true);
    OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient);

    try {
      OrgGroupPolicyConfigListResponse result = apiInstance.listOrgGroupPolicyConfigs();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OrgGroupsApi#listOrgGroupPolicyConfigs");
      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
// List org group policy configs returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_org_groups::OrgGroupsAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListOrgGroupPolicyConfigs", true);
    let api = OrgGroupsAPI::with_config(configuration);
    let resp = api.list_org_group_policy_configs().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
/**
 * List org group policy configs returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listOrgGroupPolicyConfigs"] = true;
const apiInstance = new v2.OrgGroupsApi(configuration);

apiInstance
  .listOrgGroupPolicyConfigs()
  .then((data: v2.OrgGroupPolicyConfigListResponse) => {
    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 %}
