---
title: "Update an existing scorecard rule"
method: PUT
path: "/api/v2/scorecard/rules/{rule_id}"
tags: ["Scorecards"]
---

# Update an existing scorecard rule

`PUT /api/v2/scorecard/rules/{rule_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/scorecard/rules/{rule_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `apm_service_catalog_write`

Updates an existing rule.

## Path parameters

- `rule_id` string, required

## Request body

- UpdateRuleRequest: Request to update a scorecard rule.
  - `data` UpdateRuleRequestData: Data for the request to update a scorecard rule.
    - `attributes` RuleAttributesRequest: Attributes for creating or updating a rule. Server-managed fields (created_at, modified_at, custom) are excluded.
      - `description` string: Explanation of the rule.
      - `enabled` boolean: If enabled, the rule is calculated as part of the score.
      - `level` integer: The maturity level of the rule (1, 2, or 3).
      - `name` string: Name of the rule.
      - `owner` string: Owner of the rule.
      - `scope_query` string: A query to filter which entities this rule applies to.
      - `scorecard_name` string: The scorecard name to which this rule must belong.
    - `type` 'rule': The JSON:API type for scorecard rules.

## Response `200`

Rule updated successfully

- UpdateRuleResponse: The response from a rule update request.
  - `data` UpdateRuleResponseData: The data for a rule update response.
    - `attributes` RuleAttributes: Details of a rule.
      - `category` string: The scorecard name to which this rule must belong.
      - `created_at` string, date-time: Creation time of the rule outcome.
      - `custom` boolean: Defines if the rule is a custom rule.
      - `description` string: Explanation of the rule.
      - `enabled` boolean: If enabled, the rule is calculated as part of the score.
      - `level` integer: The maturity level of the rule (1, 2, or 3).
      - `modified_at` string, date-time: Time of the last rule outcome modification.
      - `name` string: Name of the rule.
      - `owner` string: Owner of the rule.
      - `scope_query` string: A query to filter which entities this rule applies to.
      - `scorecard_name` string: The scorecard name to which this rule must belong.
    - `id` string: The unique ID for a scorecard rule.
    - `relationships` RelationshipToRule: Scorecard create rule response relationship.
      - `scorecard` RelationshipToRuleData: Relationship data for a rule.
        - `data` RelationshipToRuleDataObject: Rule relationship data.
          - `id` string: The unique ID for a scorecard.
          - `type` 'scorecard': The JSON:API type for scorecard.
    - `type` 'rule': The JSON:API type for scorecard rules.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
