Domain Allowlist

Configure your Datadog Email Domain Allowlist directly through the Datadog API. The Email Domain Allowlist controls the domains that certain datadog emails can be sent to. For more information, see the Domain Allowlist docs page

GET https://api.ap1.datadoghq.com/api/v2/domain_allowlisthttps://api.datadoghq.eu/api/v2/domain_allowlisthttps://api.ddog-gov.com/api/v2/domain_allowlisthttps://api.datadoghq.com/api/v2/domain_allowlisthttps://api.us3.datadoghq.com/api/v2/domain_allowlisthttps://api.us5.datadoghq.com/api/v2/domain_allowlist

概要

Get the domain allowlist for an organization. This endpoint requires the org_management permission.

OAuth apps require the org_management authorization scope to access this endpoint.

応答

OK

Response containing information about the email domain allowlist.

Expand All

フィールド

種類

説明

data

object

The email domain allowlist response for an org.

attributes

object

The details of the email domain allowlist.

domains

[string]

The list of domains in the email domain allowlist.

enabled

boolean

Whether the email domain allowlist is enabled for the org.

id

string

The unique identifier of the org.

type [required]

enum

Email domain allowlist allowlist type. Allowed enum values: domain_allowlist

default: domain_allowlist

{
  "data": {
    "attributes": {
      "domains": [],
      "enabled": false
    },
    "id": "string",
    "type": "domain_allowlist"
  }
}

Too many requests

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例

// Get Domain Allowlist returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DomainAllowlistApi;
import com.datadog.api.client.v2.model.DomainAllowlistResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    DomainAllowlistApi apiInstance = new DomainAllowlistApi(defaultClient);

    try {
      DomainAllowlistResponse result = apiInstance.getDomainAllowlist();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DomainAllowlistApi#getDomainAllowlist");
      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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"

PATCH https://api.ap1.datadoghq.com/api/v2/domain_allowlisthttps://api.datadoghq.eu/api/v2/domain_allowlisthttps://api.ddog-gov.com/api/v2/domain_allowlisthttps://api.datadoghq.com/api/v2/domain_allowlisthttps://api.us3.datadoghq.com/api/v2/domain_allowlisthttps://api.us5.datadoghq.com/api/v2/domain_allowlist

概要

Update the domain allowlist for an organization. This endpoint requires the org_management permission.

OAuth apps require the org_management authorization scope to access this endpoint.

リクエスト

Body Data (required)

Expand All

フィールド

種類

説明

data [required]

object

The email domain allowlist for an org.

attributes

object

The details of the email domain allowlist.

domains

[string]

The list of domains in the email domain allowlist.

enabled

boolean

Whether the email domain allowlist is enabled for the org.

id

string

The unique identifier of the org.

type [required]

enum

Email domain allowlist allowlist type. Allowed enum values: domain_allowlist

default: domain_allowlist

{
  "data": {
    "attributes": {
      "domains": [
        "@static-test-domain.test"
      ],
      "enabled": false
    },
    "type": "domain_allowlist"
  }
}

応答

OK

Response containing information about the email domain allowlist.

Expand All

フィールド

種類

説明

data

object

The email domain allowlist response for an org.

attributes

object

The details of the email domain allowlist.

domains

[string]

The list of domains in the email domain allowlist.

enabled

boolean

Whether the email domain allowlist is enabled for the org.

id

string

The unique identifier of the org.

type [required]

enum

Email domain allowlist allowlist type. Allowed enum values: domain_allowlist

default: domain_allowlist

{
  "data": {
    "attributes": {
      "domains": [],
      "enabled": false
    },
    "id": "string",
    "type": "domain_allowlist"
  }
}

Too many requests

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例

// Sets Domain Allowlist returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DomainAllowlistApi;
import com.datadog.api.client.v2.model.DomainAllowlist;
import com.datadog.api.client.v2.model.DomainAllowlistAttributes;
import com.datadog.api.client.v2.model.DomainAllowlistRequest;
import com.datadog.api.client.v2.model.DomainAllowlistResponse;
import com.datadog.api.client.v2.model.DomainAllowlistType;
import java.util.Collections;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    DomainAllowlistApi apiInstance = new DomainAllowlistApi(defaultClient);

    DomainAllowlistRequest body =
        new DomainAllowlistRequest()
            .data(
                new DomainAllowlist()
                    .attributes(
                        new DomainAllowlistAttributes()
                            .domains(Collections.singletonList("@static-test-domain.test"))
                            .enabled(false))
                    .type(DomainAllowlistType.DOMAIN_ALLOWLIST));

    try {
      DomainAllowlistResponse result = apiInstance.patchDomainAllowlist(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DomainAllowlistApi#patchDomainAllowlist");
      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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"

PREVIEWING: dgreen15/fixing-image-self-service-actions