For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/restriction-policies/update-a-restriction-policy.md. A documentation index is available at /llms.txt.
Language
Datadog site

Update a restriction policy

POSThttps://api.datadoghq.com/api/v2/restriction_policy/{resource_id}https://api.us3.datadoghq.com/api/v2/restriction_policy/{resource_id}https://api.us5.datadoghq.com/api/v2/restriction_policy/{resource_id}https://api.datadoghq.eu/api/v2/restriction_policy/{resource_id}https://api.ap1.datadoghq.com/api/v2/restriction_policy/{resource_id}https://api.ap2.datadoghq.com/api/v2/restriction_policy/{resource_id}https://api.uk1.datadoghq.com/api/v2/restriction_policy/{resource_id}https://api.ddog-gov.com/api/v2/restriction_policy/{resource_id}https://api.us2.ddog-gov.com/api/v2/restriction_policy/{resource_id}

Overview

Updates the restriction policy associated with a resource.

Supported resources

Restriction policies can be applied to the following resources:

  • Dashboards: dashboard
  • Integration Services: integration-service
  • Integration Webhooks: integration-webhook
  • Notebooks: notebook
  • Powerpacks: powerpack
  • Reference Tables: reference-table
  • Security Rules: security-rule
  • Service Level Objectives: slo
  • Synthetic Global Variables: synthetics-global-variable
  • Synthetic Tests: synthetics-test
  • Synthetic Private Locations: synthetics-private-location
  • Monitors: monitor
  • Workflows: workflow
  • App Builder Apps: app-builder-app
  • Connections: connection
  • Connection Groups: connection-group
  • RUM Applications: rum-application
  • Cross Org Connections: cross-org-connection
  • Spreadsheets: spreadsheet
  • On-Call Schedules: on-call-schedule
  • On-Call Escalation Policies: on-call-escalation-policy
  • On-Call Team Routing Rules: on-call-team-routing-rules
  • Logs Pipelines: logs-pipeline
  • Case Management Projects: case-management-project
  • Monitor Notification Rules: monitor-notification-rule
  • Status Pages: status-page
  • Feature Flags: feature-flag
  • Network Path Configs: network-path-config

Supported relations for resources

Resource Type Supported Relations
Dashboards viewer, editor
Integration Services viewer, editor
Integration Webhooks viewer, editor
Notebooks viewer, editor
Powerpacks viewer, editor
Security Rules viewer, editor
Service Level Objectives viewer, editor
Synthetic Global Variables viewer, editor
Synthetic Tests viewer, editor
Synthetic Private Locations viewer, editor
Monitors viewer, editor
Reference Tables viewer, editor
Workflows viewer, runner, editor
App Builder Apps viewer, editor
Connections viewer, resolver, editor
Connection Groups viewer, editor
RUM Application viewer, editor
Cross Org Connections viewer, editor
Spreadsheets viewer, editor
On-Call Schedules viewer, overrider, editor
On-Call Escalation Policies viewer, editor
On-Call Team Routing Rules viewer, editor
Logs Pipelines viewer, processors_editor, editor
Case Management Projects viewer, contributor, manager
Monitor Notification Rules viewer, editor
Status Pages viewer, responder, manager
Feature Flags viewer, contributor, editor
Network Path Configs viewer, editor

Arguments

Path Parameters

Name
Type
Description
resource_id [required]
string

Identifier, formatted as type:id. Supported types: dashboard, integration-service, integration-webhook, notebook, powerpack, reference-table, security-rule, slo, synthetics-global-variable, synthetics-test, synthetics-private-location, monitor, workflow, app-builder-app, connection, connection-group, rum-application, cross-org-connection, spreadsheet, on-call-schedule, on-call-escalation-policy, on-call-team-routing-rules, logs-pipeline, case-management-project, monitor-notification-rule, status-page, feature-flag, network-path-config.

Query Strings

Name
Type
Description
allow_self_lockout
boolean

Allows admins (users with the user_access_manage permission) to remove their own access from the resource if set to true. By default, this is set to false, preventing admins from locking themselves out.

Request

Body Data (required)

Restriction policy payload

Field
Type
Description
data [required]
object

Restriction policy object.

Response

OK

Response containing information about a single restriction policy.

Field
Type
Description
data [required]
object

Restriction policy object.

Code Example

# Path parameters
export resource_id="dashboard:abc-def-ghi"

# 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/restriction_policy/${resource_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "bindings": [
        {
          "principals": [
            "user:4dee724d-00cc-11ea-a77b-570c9d03c6c5"
          ],
          "relation": "editor"
        }
      ]
    },
    "id": "dashboard:abc-def-ghi",
    "type": "restriction_policy"
  }
}
EOF
# Path parameters
export resource_id="dashboard:abc-def-ghi"

# 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/restriction_policy/${resource_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "bindings": [
        {
          "principals": [
            "user:4dee724d-00cc-11ea-a77b-570c9d03c6c5"
          ],
          "relation": "editor"
        }
      ]
    },
    "id": "dashboard:abc-def-ghi",
    "type": "restriction_policy"
  }
}
EOF
# Path parameters
export resource_id="dashboard:abc-def-ghi"

# 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/restriction_policy/${resource_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "bindings": [
        {
          "principals": [
            "user:4dee724d-00cc-11ea-a77b-570c9d03c6c5"
          ],
          "relation": "editor"
        }
      ]
    },
    "id": "dashboard:abc-def-ghi",
    "type": "restriction_policy"
  }
}
EOF
# Path parameters
export resource_id="dashboard:abc-def-ghi"

# 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/restriction_policy/${resource_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "bindings": [
        {
          "principals": [
            "user:4dee724d-00cc-11ea-a77b-570c9d03c6c5"
          ],
          "relation": "editor"
        }
      ]
    },
    "id": "dashboard:abc-def-ghi",
    "type": "restriction_policy"
  }
}
EOF
# Path parameters
export resource_id="dashboard:abc-def-ghi"

# 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/restriction_policy/${resource_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "bindings": [
        {
          "principals": [
            "user:4dee724d-00cc-11ea-a77b-570c9d03c6c5"
          ],
          "relation": "editor"
        }
      ]
    },
    "id": "dashboard:abc-def-ghi",
    "type": "restriction_policy"
  }
}
EOF
# Path parameters
export resource_id="dashboard:abc-def-ghi"

# 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/restriction_policy/${resource_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "bindings": [
        {
          "principals": [
            "user:4dee724d-00cc-11ea-a77b-570c9d03c6c5"
          ],
          "relation": "editor"
        }
      ]
    },
    "id": "dashboard:abc-def-ghi",
    "type": "restriction_policy"
  }
}
EOF
# Path parameters
export resource_id="dashboard:abc-def-ghi"

# 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/restriction_policy/${resource_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "bindings": [
        {
          "principals": [
            "user:4dee724d-00cc-11ea-a77b-570c9d03c6c5"
          ],
          "relation": "editor"
        }
      ]
    },
    "id": "dashboard:abc-def-ghi",
    "type": "restriction_policy"
  }
}
EOF
# Path parameters
export resource_id="dashboard:abc-def-ghi"

# 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/restriction_policy/${resource_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "bindings": [
        {
          "principals": [
            "user:4dee724d-00cc-11ea-a77b-570c9d03c6c5"
          ],
          "relation": "editor"
        }
      ]
    },
    "id": "dashboard:abc-def-ghi",
    "type": "restriction_policy"
  }
}
EOF
# Path parameters
export resource_id="dashboard:abc-def-ghi"

# 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/restriction_policy/${resource_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "bindings": [
        {
          "principals": [
            "user:4dee724d-00cc-11ea-a77b-570c9d03c6c5"
          ],
          "relation": "editor"
        }
      ]
    },
    "id": "dashboard:abc-def-ghi",
    "type": "restriction_policy"
  }
}
EOF