For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/es/api/latest/oauth2-client-public/upsert-an-oauth2-client-scopes-restriction.md. A documentation index is available at /llms.txt.
Language
Datadog site

Upsert an OAuth2 client scopes restriction

ADVERTENCIANote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/oauth2/clients/{client_uuid}/scopes_restrictionhttps://api.us3.datadoghq.com/api/v2/oauth2/clients/{client_uuid}/scopes_restrictionhttps://api.us5.datadoghq.com/api/v2/oauth2/clients/{client_uuid}/scopes_restrictionhttps://api.datadoghq.eu/api/v2/oauth2/clients/{client_uuid}/scopes_restrictionhttps://api.ap1.datadoghq.com/api/v2/oauth2/clients/{client_uuid}/scopes_restrictionhttps://api.ap2.datadoghq.com/api/v2/oauth2/clients/{client_uuid}/scopes_restrictionhttps://api.uk1.datadoghq.com/api/v2/oauth2/clients/{client_uuid}/scopes_restrictionhttps://api.ddog-gov.com/api/v2/oauth2/clients/{client_uuid}/scopes_restrictionhttps://api.us2.ddog-gov.com/api/v2/oauth2/clients/{client_uuid}/scopes_restriction

Descripción general

Create or update the scopes restriction configured for the OAuth2 client.

This endpoint requires the org_authorized_apps_write permission.

Argumentos

Parámetros de ruta

Nombre
Type
Descripción
client_uuid [required]
string

UUID of the OAuth2 client.

Solicitud

Body Data (required)

Campo
Type
Descripción
data [required]
object

Data object of an upsert OAuth2 scopes restriction request.

Respuesta

OK

Response payload describing the scopes restriction of an OAuth2 client.

Campo
Type
Descripción
data [required]
object

Data object of an OAuth2 client scopes restriction response.

Ejemplo de código

# Path parameters
export client_uuid="fafa8e1c-36a5-11f0-a83d-da7ad0900001"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/oauth2/clients/${client_uuid}/scopes_restriction" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "oidc_scopes": [
        "openid",
        "email"
      ],
      "permission_scopes": [
        "dashboards_read",
        "metrics_read"
      ]
    },
    "type": "upsert_scopes_restriction"
  }
}
EOF
# Path parameters
export client_uuid="fafa8e1c-36a5-11f0-a83d-da7ad0900001"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/oauth2/clients/${client_uuid}/scopes_restriction" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "oidc_scopes": [
        "openid",
        "email"
      ],
      "permission_scopes": [
        "dashboards_read",
        "metrics_read"
      ]
    },
    "type": "upsert_scopes_restriction"
  }
}
EOF
# Path parameters
export client_uuid="fafa8e1c-36a5-11f0-a83d-da7ad0900001"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/oauth2/clients/${client_uuid}/scopes_restriction" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "oidc_scopes": [
        "openid",
        "email"
      ],
      "permission_scopes": [
        "dashboards_read",
        "metrics_read"
      ]
    },
    "type": "upsert_scopes_restriction"
  }
}
EOF
# Path parameters
export client_uuid="fafa8e1c-36a5-11f0-a83d-da7ad0900001"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/oauth2/clients/${client_uuid}/scopes_restriction" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "oidc_scopes": [
        "openid",
        "email"
      ],
      "permission_scopes": [
        "dashboards_read",
        "metrics_read"
      ]
    },
    "type": "upsert_scopes_restriction"
  }
}
EOF
# Path parameters
export client_uuid="fafa8e1c-36a5-11f0-a83d-da7ad0900001"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/oauth2/clients/${client_uuid}/scopes_restriction" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "oidc_scopes": [
        "openid",
        "email"
      ],
      "permission_scopes": [
        "dashboards_read",
        "metrics_read"
      ]
    },
    "type": "upsert_scopes_restriction"
  }
}
EOF
# Path parameters
export client_uuid="fafa8e1c-36a5-11f0-a83d-da7ad0900001"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/oauth2/clients/${client_uuid}/scopes_restriction" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "oidc_scopes": [
        "openid",
        "email"
      ],
      "permission_scopes": [
        "dashboards_read",
        "metrics_read"
      ]
    },
    "type": "upsert_scopes_restriction"
  }
}
EOF
# Path parameters
export client_uuid="fafa8e1c-36a5-11f0-a83d-da7ad0900001"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/oauth2/clients/${client_uuid}/scopes_restriction" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "oidc_scopes": [
        "openid",
        "email"
      ],
      "permission_scopes": [
        "dashboards_read",
        "metrics_read"
      ]
    },
    "type": "upsert_scopes_restriction"
  }
}
EOF
# Path parameters
export client_uuid="fafa8e1c-36a5-11f0-a83d-da7ad0900001"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/oauth2/clients/${client_uuid}/scopes_restriction" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "oidc_scopes": [
        "openid",
        "email"
      ],
      "permission_scopes": [
        "dashboards_read",
        "metrics_read"
      ]
    },
    "type": "upsert_scopes_restriction"
  }
}
EOF
# Path parameters
export client_uuid="fafa8e1c-36a5-11f0-a83d-da7ad0900001"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/oauth2/clients/${client_uuid}/scopes_restriction" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "oidc_scopes": [
        "openid",
        "email"
      ],
      "permission_scopes": [
        "dashboards_read",
        "metrics_read"
      ]
    },
    "type": "upsert_scopes_restriction"
  }
}
EOF