---
title: Disable the authenticated customer organization
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Customer Org
---

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

# Disable the authenticated customer organization{% #disable-the-authenticated-customer-organization %}
Copy pageCopied
{% 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/disable |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/org/disable |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/org/disable      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/org/disable      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/org/disable  |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/org/disable |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/org/disable     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/org/disable |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/org/disable |

### Overview

Disable the Datadog organization associated with the authenticated user or API key. The request body uses JSON:API format. If `org_uuid` is supplied, it must match the authenticated org or the request is rejected. Successful calls disable the org and return the resulting state from the downstream service. Requires the `org_management` permission.

OAuth apps require the `org_management` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#customer-org) to access this endpoint.



### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                  | Type   | Description                                                                                                                                             |
| ------------ | ---------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*] | object | Data object for a customer org disable request.                                                                                                         |
| data         | attributes             | object | Optional attributes for a customer org disable request. When supplied, `org_uuid` must match the authenticated organization or the request is rejected. |
| attributes   | org_uuid               | string | Datadog organization UUID. If supplied, must match the authenticated organization.                                                                      |
| data         | id                     | string | Optional client-supplied identifier for the request. Useful for client-side correlation; the server does not use this value.                            |
| data         | type [*required*] | enum   | JSON:API resource type for a customer org disable request. Allowed enum values: `customer_org_disable`                                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "org_uuid": "abcdef01-2345-6789-abcd-ef0123456789"
    },
    "id": "1",
    "type": "customer_org_disable"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response describing the outcome of disabling the customer organization.

| Parent field | Field                        | Type   | Description                                                                                                              |
| ------------ | ---------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]       | object | Data object returned after disabling the customer organization.                                                          |
| data         | attributes [*required*] | object | Attributes describing the outcome of the disable action on the customer organization.                                    |
| attributes   | status [*required*]     | enum   | Resulting lifecycle status of the organization after the disable action. Allowed enum values: `disabled,pending_disable` |
| data         | id [*required*]         | string | Identifier of the disabled organization.                                                                                 |
| data         | type [*required*]       | enum   | JSON:API resource type for a customer org disable response. Allowed enum values: `org_disable`                           |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "status": "disabled"
    },
    "id": "abcdef01-2345-6789-abcd-ef0123456789",
    "type": "org_disable"
  }
}
```

{% /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 %}

{% tab title="500" %}
Internal Server Error
{% 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 %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/org/disable" \
-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_uuid": "abcdef01-2345-6789-abcd-ef0123456789"
    },
    "id": "1",
    "type": "customer_org_disable"
  }
}
EOF 
                
##### 

```python
"""
Disable the authenticated customer organization returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.customer_org_api import CustomerOrgApi
from datadog_api_client.v2.model.customer_org_disable_request import CustomerOrgDisableRequest
from datadog_api_client.v2.model.customer_org_disable_request_attributes import CustomerOrgDisableRequestAttributes
from datadog_api_client.v2.model.customer_org_disable_request_data import CustomerOrgDisableRequestData
from datadog_api_client.v2.model.customer_org_disable_type import CustomerOrgDisableType

body = CustomerOrgDisableRequest(
    data=CustomerOrgDisableRequestData(
        attributes=CustomerOrgDisableRequestAttributes(
            org_uuid="abcdef01-2345-6789-abcd-ef0123456789",
        ),
        id="1",
        type=CustomerOrgDisableType.CUSTOMER_ORG_DISABLE,
    ),
)

configuration = Configuration()
configuration.unstable_operations["disable_customer_org"] = True
with ApiClient(configuration) as api_client:
    api_instance = CustomerOrgApi(api_client)
    response = api_instance.disable_customer_org(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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Disable the authenticated customer organization returns "OK" response

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

body = DatadogAPIClient::V2::CustomerOrgDisableRequest.new({
  data: DatadogAPIClient::V2::CustomerOrgDisableRequestData.new({
    attributes: DatadogAPIClient::V2::CustomerOrgDisableRequestAttributes.new({
      org_uuid: "abcdef01-2345-6789-abcd-ef0123456789",
    }),
    id: "1",
    type: DatadogAPIClient::V2::CustomerOrgDisableType::CUSTOMER_ORG_DISABLE,
  }),
})
p api_instance.disable_customer_org(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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Disable the authenticated customer organization returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	body := datadogV2.CustomerOrgDisableRequest{
		Data: datadogV2.CustomerOrgDisableRequestData{
			Attributes: &datadogV2.CustomerOrgDisableRequestAttributes{
				OrgUuid: datadog.PtrString("abcdef01-2345-6789-abcd-ef0123456789"),
			},
			Id:   datadog.PtrString("1"),
			Type: datadogV2.CUSTOMERORGDISABLETYPE_CUSTOMER_ORG_DISABLE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DisableCustomerOrg", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCustomerOrgApi(apiClient)
	resp, r, err := api.DisableCustomerOrg(ctx, body)

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

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

```java
// Disable the authenticated customer organization returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CustomerOrgApi;
import com.datadog.api.client.v2.model.CustomerOrgDisableRequest;
import com.datadog.api.client.v2.model.CustomerOrgDisableRequestAttributes;
import com.datadog.api.client.v2.model.CustomerOrgDisableRequestData;
import com.datadog.api.client.v2.model.CustomerOrgDisableResponse;
import com.datadog.api.client.v2.model.CustomerOrgDisableType;

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

    CustomerOrgDisableRequest body =
        new CustomerOrgDisableRequest()
            .data(
                new CustomerOrgDisableRequestData()
                    .attributes(
                        new CustomerOrgDisableRequestAttributes()
                            .orgUuid("abcdef01-2345-6789-abcd-ef0123456789"))
                    .id("1")
                    .type(CustomerOrgDisableType.CUSTOMER_ORG_DISABLE));

    try {
      CustomerOrgDisableResponse result = apiInstance.disableCustomerOrg(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CustomerOrgApi#disableCustomerOrg");
      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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Disable the authenticated customer organization returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_customer_org::CustomerOrgAPI;
use datadog_api_client::datadogV2::model::CustomerOrgDisableRequest;
use datadog_api_client::datadogV2::model::CustomerOrgDisableRequestAttributes;
use datadog_api_client::datadogV2::model::CustomerOrgDisableRequestData;
use datadog_api_client::datadogV2::model::CustomerOrgDisableType;

#[tokio::main]
async fn main() {
    let body = CustomerOrgDisableRequest::new(
        CustomerOrgDisableRequestData::new(CustomerOrgDisableType::CUSTOMER_ORG_DISABLE)
            .attributes(
                CustomerOrgDisableRequestAttributes::new()
                    .org_uuid("abcdef01-2345-6789-abcd-ef0123456789".to_string()),
            )
            .id("1".to_string()),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DisableCustomerOrg", true);
    let api = CustomerOrgAPI::with_config(configuration);
    let resp = api.disable_customer_org(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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Disable the authenticated customer organization returns "OK" response
 */

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

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

const params: v2.CustomerOrgApiDisableCustomerOrgRequest = {
  body: {
    data: {
      attributes: {
        orgUuid: "abcdef01-2345-6789-abcd-ef0123456789",
      },
      id: "1",
      type: "customer_org_disable",
    },
  },
};

apiInstance
  .disableCustomerOrg(params)
  .then((data: v2.CustomerOrgDisableResponse) => {
    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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
