This page is not yet available in Spanish. We are working on its translation.
If you have any questions or feedback about our current translation project, feel free to reach out to us!

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

Información general

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.

Respuesta

OK

Response containing information about the email domain allowlist.

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Get Domain Allowlist returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.domain_allowlist_api import DomainAllowlistApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DomainAllowlistApi(api_client)
    response = api_instance.get_domain_allowlist()

    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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

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

Información general

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.

Solicitud

Body Data (required)

Expand All

Campo

Tipo

Descripción

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"
  }
}

Respuesta

OK

Response containing information about the email domain allowlist.

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Sets Domain Allowlist returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.domain_allowlist_api import DomainAllowlistApi
from datadog_api_client.v2.model.domain_allowlist import DomainAllowlist
from datadog_api_client.v2.model.domain_allowlist_attributes import DomainAllowlistAttributes
from datadog_api_client.v2.model.domain_allowlist_request import DomainAllowlistRequest
from datadog_api_client.v2.model.domain_allowlist_type import DomainAllowlistType

body = DomainAllowlistRequest(
    data=DomainAllowlist(
        attributes=DomainAllowlistAttributes(
            domains=[
                "@static-test-domain.test",
            ],
            enabled=False,
        ),
        type=DomainAllowlistType.DOMAIN_ALLOWLIST,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = DomainAllowlistApi(api_client)
    response = api_instance.patch_domain_allowlist(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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

PREVIEWING: mahashree.rajendran/update-streams