For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ja/api/latest/on-call/update-an-on-call-notification-rule-for-a-user.md. A documentation index is available at /llms.txt.
Language
Datadog site
注意This product is not supported for your selected Datadog site. (US2-FED).

Update an On-Call notification rule for a user

PUThttps://api.datadoghq.com/api/v2/on-call/users/{user_id}/notification-rules/{rule_id}https://api.us3.datadoghq.com/api/v2/on-call/users/{user_id}/notification-rules/{rule_id}https://api.us5.datadoghq.com/api/v2/on-call/users/{user_id}/notification-rules/{rule_id}https://api.datadoghq.eu/api/v2/on-call/users/{user_id}/notification-rules/{rule_id}https://api.ap1.datadoghq.com/api/v2/on-call/users/{user_id}/notification-rules/{rule_id}https://api.ap2.datadoghq.com/api/v2/on-call/users/{user_id}/notification-rules/{rule_id}https://api.uk1.datadoghq.com/api/v2/on-call/users/{user_id}/notification-rules/{rule_id}https://api.ddog-gov.com/api/v2/on-call/users/{user_id}/notification-rules/{rule_id}https://api.us2.ddog-gov.com/api/v2/on-call/users/{user_id}/notification-rules/{rule_id}

概要

Update a notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission

This endpoint requires the on_call_read permission.

引数

パスパラメーター

名前
タイプ
説明
user_id [required]
string

The user ID

rule_id [required]
string

The rule ID

クエリ文字列

名前
タイプ
説明
include
string

Comma-separated list of included relationships to be returned. Allowed values: channel.

リクエスト

Body Data (required)

フィールド
タイプ
説明
data [required]
object

Data for updating an on-call notification rule

応答

OK

A top-level wrapper for a notification rule

フィールド
タイプ
説明
data [required]
object

Data for an on-call notification rule

included
[<oneOf>]

コード例

Update an On-Call notification rule for a user returns "OK" response
# Path parameters
export user_id="00000000-0000-0000-0000-000000000000"
export rule_id="00000000-0000-0000-0000-000000000000"

# 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 PUT "https://api.${DD_SITE}/api/v2/on-call/users/${user_id}/notification-rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "high_urgency",
      "delay_minutes": 1
    },
    "id": "4d00de6b-e1c1-e5fa-b238-57acec728d0d",
    "relationships": {
      "channel": {
        "data": {
          "id": "7c1ce93f-30a5-596a-0f7b-06bfe153704c",
          "type": "notification_channels"
        }
      }
    },
    "type": "notification_rules"
  }
}
EOF
# Path parameters
export user_id="00000000-0000-0000-0000-000000000000"
export rule_id="00000000-0000-0000-0000-000000000000"

# 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 PUT "https://api.${DD_SITE}/api/v2/on-call/users/${user_id}/notification-rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "high_urgency",
      "delay_minutes": 1
    },
    "id": "4d00de6b-e1c1-e5fa-b238-57acec728d0d",
    "relationships": {
      "channel": {
        "data": {
          "id": "7c1ce93f-30a5-596a-0f7b-06bfe153704c",
          "type": "notification_channels"
        }
      }
    },
    "type": "notification_rules"
  }
}
EOF
# Path parameters
export user_id="00000000-0000-0000-0000-000000000000"
export rule_id="00000000-0000-0000-0000-000000000000"

# 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 PUT "https://api.${DD_SITE}/api/v2/on-call/users/${user_id}/notification-rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "high_urgency",
      "delay_minutes": 1
    },
    "id": "4d00de6b-e1c1-e5fa-b238-57acec728d0d",
    "relationships": {
      "channel": {
        "data": {
          "id": "7c1ce93f-30a5-596a-0f7b-06bfe153704c",
          "type": "notification_channels"
        }
      }
    },
    "type": "notification_rules"
  }
}
EOF
# Path parameters
export user_id="00000000-0000-0000-0000-000000000000"
export rule_id="00000000-0000-0000-0000-000000000000"

# 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 PUT "https://api.${DD_SITE}/api/v2/on-call/users/${user_id}/notification-rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "high_urgency",
      "delay_minutes": 1
    },
    "id": "4d00de6b-e1c1-e5fa-b238-57acec728d0d",
    "relationships": {
      "channel": {
        "data": {
          "id": "7c1ce93f-30a5-596a-0f7b-06bfe153704c",
          "type": "notification_channels"
        }
      }
    },
    "type": "notification_rules"
  }
}
EOF
# Path parameters
export user_id="00000000-0000-0000-0000-000000000000"
export rule_id="00000000-0000-0000-0000-000000000000"

# 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 PUT "https://api.${DD_SITE}/api/v2/on-call/users/${user_id}/notification-rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "high_urgency",
      "delay_minutes": 1
    },
    "id": "4d00de6b-e1c1-e5fa-b238-57acec728d0d",
    "relationships": {
      "channel": {
        "data": {
          "id": "7c1ce93f-30a5-596a-0f7b-06bfe153704c",
          "type": "notification_channels"
        }
      }
    },
    "type": "notification_rules"
  }
}
EOF
# Path parameters
export user_id="00000000-0000-0000-0000-000000000000"
export rule_id="00000000-0000-0000-0000-000000000000"

# 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 PUT "https://api.${DD_SITE}/api/v2/on-call/users/${user_id}/notification-rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "high_urgency",
      "delay_minutes": 1
    },
    "id": "4d00de6b-e1c1-e5fa-b238-57acec728d0d",
    "relationships": {
      "channel": {
        "data": {
          "id": "7c1ce93f-30a5-596a-0f7b-06bfe153704c",
          "type": "notification_channels"
        }
      }
    },
    "type": "notification_rules"
  }
}
EOF
# Path parameters
export user_id="00000000-0000-0000-0000-000000000000"
export rule_id="00000000-0000-0000-0000-000000000000"

# 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 PUT "https://api.${DD_SITE}/api/v2/on-call/users/${user_id}/notification-rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "high_urgency",
      "delay_minutes": 1
    },
    "id": "4d00de6b-e1c1-e5fa-b238-57acec728d0d",
    "relationships": {
      "channel": {
        "data": {
          "id": "7c1ce93f-30a5-596a-0f7b-06bfe153704c",
          "type": "notification_channels"
        }
      }
    },
    "type": "notification_rules"
  }
}
EOF
# Path parameters
export user_id="00000000-0000-0000-0000-000000000000"
export rule_id="00000000-0000-0000-0000-000000000000"

# 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 PUT "https://api.${DD_SITE}/api/v2/on-call/users/${user_id}/notification-rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "high_urgency",
      "delay_minutes": 1
    },
    "id": "4d00de6b-e1c1-e5fa-b238-57acec728d0d",
    "relationships": {
      "channel": {
        "data": {
          "id": "7c1ce93f-30a5-596a-0f7b-06bfe153704c",
          "type": "notification_channels"
        }
      }
    },
    "type": "notification_rules"
  }
}
EOF
# Path parameters
export user_id="00000000-0000-0000-0000-000000000000"
export rule_id="00000000-0000-0000-0000-000000000000"

# 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 PUT "https://api.${DD_SITE}/api/v2/on-call/users/${user_id}/notification-rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "category": "high_urgency",
      "delay_minutes": 1
    },
    "id": "4d00de6b-e1c1-e5fa-b238-57acec728d0d",
    "relationships": {
      "channel": {
        "data": {
          "id": "7c1ce93f-30a5-596a-0f7b-06bfe153704c",
          "type": "notification_channels"
        }
      }
    },
    "type": "notification_rules"
  }
}
EOF