For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/api/latest/customer-org/disable-the-authenticated-customer-organization.md. A documentation index is available at /llms.txt.

Disable the authenticated customer organization

Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/org/disablehttps://api.ap2.datadoghq.com/api/v2/org/disablehttps://api.datadoghq.eu/api/v2/org/disablehttps://api.ddog-gov.com/api/v2/org/disablehttps://api.us2.ddog-gov.com/api/v2/org/disablehttps://api.uk1.datadoghq.com/api/v2/org/disablehttps://api.datadoghq.com/api/v2/org/disablehttps://api.us3.datadoghq.com/api/v2/org/disablehttps://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 to access this endpoint.

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Data object for a customer org disable request.

attributes

object

Optional attributes for a customer org disable request. When supplied, org_uuid must match the authenticated organization or the request is rejected.

org_uuid

string

Datadog organization UUID. If supplied, must match the authenticated organization.

id

string

Optional client-supplied identifier for the request. Useful for client-side correlation; the server does not use this value.

type [required]

enum

JSON:API resource type for a customer org disable request. Allowed enum values: customer_org_disable

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

Response

OK

Response describing the outcome of disabling the customer organization.

Expand All

Field

Type

Description

data [required]

object

Data object returned after disabling the customer organization.

attributes [required]

object

Attributes describing the outcome of the disable action on the customer organization.

status [required]

enum

Resulting lifecycle status of the organization after the disable action. Allowed enum values: disabled,pending_disable

id [required]

string

Identifier of the disabled organization.

type [required]

enum

JSON:API resource type for a customer org disable response. Allowed enum values: org_disable

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

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Internal Server Error

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                  ## default
# 

# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.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
"""
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 and then save the example to example.py and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# 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 and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// 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 and then save the example to main.go and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// 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 and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// 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 and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * 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 and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"