---
title: Scorecards
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Scorecards
---

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ().
{% /alert %}

{% /callout %}

# Scorecards

API to create and update scorecard rules and outcomes. See [Scorecards](https://docs.datadoghq.com/service_catalog/scorecards.md) for more information.

## Create a new rule{% #create-a-new-rule %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                              |
| ----------------- | --------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/scorecard/rules |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/scorecard/rules |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/scorecard/rules      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/scorecard/rules      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/scorecard/rules     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/scorecard/rules |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/scorecard/rules |

### Overview

Creates a new rule.

OAuth apps require the `apm_service_catalog_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Request

#### Body Data (required)

Rule attributes.

{% tab title="Model" %}

| Parent field | Field          | Type    | Description                                                                                                       |
| ------------ | -------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
|              | data           | object  | Scorecard create rule request data.                                                                               |
| data         | attributes     | object  | Attributes for creating or updating a rule. Server-managed fields (created_at, modified_at, custom) are excluded. |
| attributes   | description    | string  | Explanation of the rule.                                                                                          |
| attributes   | enabled        | boolean | If enabled, the rule is calculated as part of the score.                                                          |
| attributes   | level          | int32   | The maturity level of the rule (1, 2, or 3).                                                                      |
| attributes   | name           | string  | Name of the rule.                                                                                                 |
| attributes   | owner          | string  | Owner of the rule.                                                                                                |
| attributes   | scope_query    | string  | A query to filter which entities this rule applies to.                                                            |
| attributes   | scorecard_name | string  | The scorecard name to which this rule must belong.                                                                |
| data         | type           | enum    | The JSON:API type for scorecard rules. Allowed enum values: `rule`                                                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Example-Scorecard",
      "scorecard_name": "Observability Best Practices"
    },
    "type": "rule"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Created rule in response.

| Parent field  | Field          | Type      | Description                                                        |
| ------------- | -------------- | --------- | ------------------------------------------------------------------ |
|               | data           | object    | Create rule response data.                                         |
| data          | attributes     | object    | Details of a rule.                                                 |
| attributes    | category       | string    | **DEPRECATED**: The scorecard name to which this rule must belong. |
| attributes    | created_at     | date-time | Creation time of the rule outcome.                                 |
| attributes    | custom         | boolean   | Defines if the rule is a custom rule.                              |
| attributes    | description    | string    | Explanation of the rule.                                           |
| attributes    | enabled        | boolean   | If enabled, the rule is calculated as part of the score.           |
| attributes    | level          | int32     | The maturity level of the rule (1, 2, or 3).                       |
| attributes    | modified_at    | date-time | Time of the last rule outcome modification.                        |
| attributes    | name           | string    | Name of the rule.                                                  |
| attributes    | owner          | string    | Owner of the rule.                                                 |
| attributes    | scope_query    | string    | A query to filter which entities this rule applies to.             |
| attributes    | scorecard_name | string    | The scorecard name to which this rule must belong.                 |
| data          | id             | string    | The unique ID for a scorecard rule.                                |
| data          | relationships  | object    | Scorecard create rule response relationship.                       |
| relationships | scorecard      | object    | Relationship data for a rule.                                      |
| scorecard     | data           | object    | Rule relationship data.                                            |
| data          | id             | string    | The unique ID for a scorecard.                                     |
| data          | type           | enum      | The JSON:API type for scorecard. Allowed enum values: `scorecard`  |
| data          | type           | enum      | The JSON:API type for scorecard rules. Allowed enum values: `rule` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "category": "string",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom": false,
      "description": "string",
      "enabled": true,
      "level": 2,
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Team Defined",
      "owner": "string",
      "scope_query": "kind:service",
      "scorecard_name": "Deployments automated via Deployment Trains"
    },
    "id": "q8MQxk8TCqrHnWkx",
    "relationships": {
      "scorecard": {
        "data": {
          "id": "q8MQxk8TCqrHnWkp",
          "type": "scorecard"
        }
      }
    },
    "type": "rule"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                          \## default
# 
\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/rules" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "My Rule",
      "owner": "Datadog",
      "scorecard_name": "My Scorecard"
    },
    "type": "rule"
  }
}
EOF
                        
{% /tab %}

## Update an existing scorecard rule{% #update-an-existing-scorecard-rule %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                       |
| ----------------- | ------------------------------------------------------------------ |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/scorecard/rules/{rule_id} |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/scorecard/rules/{rule_id} |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/scorecard/rules/{rule_id}      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/scorecard/rules/{rule_id}      |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/scorecard/rules/{rule_id}     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/scorecard/rules/{rule_id} |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v2/scorecard/rules/{rule_id} |

### Overview

Updates an existing rule.

OAuth apps require the `apm_service_catalog_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Arguments

#### Path Parameters

| Name                      | Type   | Description         |
| ------------------------- | ------ | ------------------- |
| rule_id [*required*] | string | The ID of the rule. |

### Request

#### Body Data (required)

Rule attributes.

{% tab title="Model" %}

| Parent field | Field          | Type    | Description                                                                                                       |
| ------------ | -------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
|              | data           | object  | Data for the request to update a scorecard rule.                                                                  |
| data         | attributes     | object  | Attributes for creating or updating a rule. Server-managed fields (created_at, modified_at, custom) are excluded. |
| attributes   | description    | string  | Explanation of the rule.                                                                                          |
| attributes   | enabled        | boolean | If enabled, the rule is calculated as part of the score.                                                          |
| attributes   | level          | int32   | The maturity level of the rule (1, 2, or 3).                                                                      |
| attributes   | name           | string  | Name of the rule.                                                                                                 |
| attributes   | owner          | string  | Owner of the rule.                                                                                                |
| attributes   | scope_query    | string  | A query to filter which entities this rule applies to.                                                            |
| attributes   | scorecard_name | string  | The scorecard name to which this rule must belong.                                                                |
| data         | type           | enum    | The JSON:API type for scorecard rules. Allowed enum values: `rule`                                                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "type": "rule",
    "attributes": {
      "enabled": true,
      "name": "Team Defined",
      "scorecard_name": "Deployments automated via Deployment Trains",
      "description": "Updated description via test"
    }
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
Rule updated successfully
{% tab title="Model" %}
The response from a rule update request.

| Parent field  | Field          | Type      | Description                                                        |
| ------------- | -------------- | --------- | ------------------------------------------------------------------ |
|               | data           | object    | The data for a rule update response.                               |
| data          | attributes     | object    | Details of a rule.                                                 |
| attributes    | category       | string    | **DEPRECATED**: The scorecard name to which this rule must belong. |
| attributes    | created_at     | date-time | Creation time of the rule outcome.                                 |
| attributes    | custom         | boolean   | Defines if the rule is a custom rule.                              |
| attributes    | description    | string    | Explanation of the rule.                                           |
| attributes    | enabled        | boolean   | If enabled, the rule is calculated as part of the score.           |
| attributes    | level          | int32     | The maturity level of the rule (1, 2, or 3).                       |
| attributes    | modified_at    | date-time | Time of the last rule outcome modification.                        |
| attributes    | name           | string    | Name of the rule.                                                  |
| attributes    | owner          | string    | Owner of the rule.                                                 |
| attributes    | scope_query    | string    | A query to filter which entities this rule applies to.             |
| attributes    | scorecard_name | string    | The scorecard name to which this rule must belong.                 |
| data          | id             | string    | The unique ID for a scorecard rule.                                |
| data          | relationships  | object    | Scorecard create rule response relationship.                       |
| relationships | scorecard      | object    | Relationship data for a rule.                                      |
| scorecard     | data           | object    | Rule relationship data.                                            |
| data          | id             | string    | The unique ID for a scorecard.                                     |
| data          | type           | enum      | The JSON:API type for scorecard. Allowed enum values: `scorecard`  |
| data          | type           | enum      | The JSON:API type for scorecard rules. Allowed enum values: `rule` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "category": "string",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom": false,
      "description": "string",
      "enabled": true,
      "level": 2,
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Team Defined",
      "owner": "string",
      "scope_query": "kind:service",
      "scorecard_name": "Deployments automated via Deployment Trains"
    },
    "id": "q8MQxk8TCqrHnWkx",
    "relationships": {
      "scorecard": {
        "data": {
          "id": "q8MQxk8TCqrHnWkp",
          "type": "scorecard"
        }
      }
    },
    "type": "rule"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                          \## default
# 
\# Path parametersexport rule_id="CHANGE_ME"\# Curl commandcurl -X PUT "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Updated Description",
      "enabled": false,
      "name": "Updated Rule",
      "owner": "team:updated-team",
      "scope_query": "kind:service",
      "scorecard_name": "Updated Scorecard"
    },
    "type": "rule"
  }
}
EOF
                        
{% /tab %}

## Update Scorecard outcomes{% #update-scorecard-outcomes %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                 |
| ----------------- | ------------------------------------------------------------ |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/scorecard/outcomes |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/scorecard/outcomes |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/scorecard/outcomes      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/scorecard/outcomes      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/scorecard/outcomes     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/scorecard/outcomes |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/scorecard/outcomes |

### Overview

Updates multiple scorecard rule outcomes in a single batched request.

OAuth apps require the `apm_service_catalog_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Request

#### Body Data (required)

Set of scorecard outcomes.

{% tab title="Model" %}

| Parent field | Field                              | Type     | Description                                                                      |
| ------------ | ---------------------------------- | -------- | -------------------------------------------------------------------------------- |
|              | data                               | object   | Scorecard outcomes batch request data.                                           |
| data         | attributes                         | object   | The JSON:API attributes for a batched set of scorecard outcomes.                 |
| attributes   | results                            | [object] | Set of scorecard outcomes to update asynchronously.                              |
| results      | entity_reference [*required*] | string   | The unique reference for an IDP entity.                                          |
| results      | remarks                            | string   | Any remarks regarding the scorecard rule's evaluation. Supports HTML hyperlinks. |
| results      | rule_id [*required*]          | string   | The unique ID for a scorecard rule.                                              |
| results      | state [*required*]            | enum     | The state of the rule evaluation. Allowed enum values: `pass,fail,skip`          |
| data         | type                               | enum     | The JSON:API type for scorecard outcomes. Allowed enum values: `batched-outcome` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "results": [
        {
          "rule_id": "q8MQxk8TCqrHnWkx",
          "entity_reference": "service:my-service",
          "remarks": "See: <a href=\"https://app.datadoghq.com/services\">Services</a>",
          "state": "pass"
        }
      ]
    },
    "type": "batched-outcome"
  }
}
```

{% /tab %}

### Response

{% tab title="202" %}
Accepted
{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="409" %}
Conflict
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                          \## default
# 
\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/outcomes" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "results": [
        {
          "entity_reference": "service:my-service",
          "remarks": "See: \u003ca href=\"https://app.datadoghq.com/services\"\u003eServices\u003c/a\u003e",
          "rule_id": "q8MQxk8TCqrHnWkx",
          "state": "pass"
        }
      ]
    },
    "type": "batched-outcome"
  }
}
EOF
                        
{% /tab %}

## List all rule outcomes{% #list-all-rule-outcomes %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                |
| ----------------- | ----------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/scorecard/outcomes |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/scorecard/outcomes |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/scorecard/outcomes      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/scorecard/outcomes      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/scorecard/outcomes     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/scorecard/outcomes |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/scorecard/outcomes |

### Overview

Fetches all rule outcomes.

OAuth apps require the `apm_service_catalog_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Arguments

#### Query Strings

| Name                          | Type    | Description                                                     |
| ----------------------------- | ------- | --------------------------------------------------------------- |
| page[size]                    | integer | Size for a given page. The maximum allowed value is 100.        |
| page[offset]                  | integer | Specific offset to use as the beginning of the returned page.   |
| include                       | string  | Include related rule details in the response.                   |
| fields[outcome]               | string  | Return only specified values in the outcome attributes.         |
| fields[rule]                  | string  | Return only specified values in the included rule details.      |
| filter[outcome][service_name] | string  | Filter outcomes on a specific service name.                     |
| filter[outcome][state]        | string  | Filter outcomes by a specific state.                            |
| filter[rule][enabled]         | boolean | Filter outcomes based on whether a rule is enabled or disabled. |
| filter[rule][id]              | string  | Filter outcomes based on rule ID.                               |
| filter[rule][name]            | string  | Filter outcomes based on rule name.                             |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Scorecard outcomes - the result of a rule for a service.

| Parent field  | Field          | Type      | Description                                                                          |
| ------------- | -------------- | --------- | ------------------------------------------------------------------------------------ |
|               | data           | [object]  | List of rule outcomes.                                                               |
| data          | attributes     | object    | The JSON:API attributes for an outcome.                                              |
| attributes    | created_at     | date-time | Creation time of the rule outcome.                                                   |
| attributes    | modified_at    | date-time | Time of last rule outcome modification.                                              |
| attributes    | remarks        | string    | Any remarks regarding the scorecard rule's evaluation, and supports HTML hyperlinks. |
| attributes    | service_name   | string    | The unique name for a service in the catalog.                                        |
| attributes    | state          | enum      | The state of the rule evaluation. Allowed enum values: `pass,fail,skip`              |
| data          | id             | string    | The unique ID for a rule outcome.                                                    |
| data          | relationships  | object    | The JSON:API relationship to a scorecard rule.                                       |
| relationships | rule           | object    | The JSON:API relationship to a scorecard outcome.                                    |
| rule          | data           | object    | The JSON:API relationship to an outcome, which returns the related rule id.          |
| data          | id             | string    | The unique ID for a scorecard rule.                                                  |
| data          | type           | enum      | The JSON:API type for scorecard rules. Allowed enum values: `rule`                   |
| data          | type           | enum      | The JSON:API type for an outcome. Allowed enum values: `outcome`                     |
|               | included       | [object]  | Array of rule details.                                                               |
| included      | attributes     | object    | Details of a rule.                                                                   |
| attributes    | name           | string    | Name of the rule.                                                                    |
| attributes    | scorecard_name | string    | The scorecard name to which this rule must belong.                                   |
| included      | id             | string    | The unique ID for a scorecard rule.                                                  |
| included      | type           | enum      | The JSON:API type for scorecard rules. Allowed enum values: `rule`                   |
|               | links          | object    | Links attributes.                                                                    |
| links         | next           | string    | Link for the next set of results.                                                    |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "remarks": "See: <a href=\"https://app.datadoghq.com/services\">Services</a>",
        "service_name": "my-service",
        "state": "pass"
      },
      "id": "string",
      "relationships": {
        "rule": {
          "data": {
            "id": "q8MQxk8TCqrHnWkx",
            "type": "rule"
          }
        }
      },
      "type": "outcome"
    }
  ],
  "included": [
    {
      "attributes": {
        "name": "Team Defined",
        "scorecard_name": "Observability Best Practices"
      },
      "id": "q8MQxk8TCqrHnWkx",
      "type": "rule"
    }
  ],
  "links": {
    "next": "/api/v2/scorecard/outcomes?include=rule\u0026page%5Blimit%5D=100\u0026page%5Boffset%5D=100"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/outcomes" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## List all rules{% #list-all-rules %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                             |
| ----------------- | -------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/scorecard/rules |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/scorecard/rules |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/scorecard/rules      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/scorecard/rules      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/scorecard/rules     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/scorecard/rules |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/scorecard/rules |

### Overview

Fetch all rules.

OAuth apps require the `apm_service_catalog_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Arguments

#### Query Strings

| Name                      | Type    | Description                                                                    |
| ------------------------- | ------- | ------------------------------------------------------------------------------ |
| page[size]                | integer | Size for a given page. The maximum allowed value is 100.                       |
| page[offset]              | integer | Specific offset to use as the beginning of the returned page.                  |
| include                   | string  | Include related scorecard details in the response.                             |
| filter[rule][id]          | string  | Filter the rules on a rule ID.                                                 |
| filter[rule][enabled]     | boolean | Filter for enabled rules only.                                                 |
| filter[rule][custom]      | boolean | Filter for custom rules only.                                                  |
| filter[rule][name]        | string  | Filter rules on the rule name.                                                 |
| filter[rule][description] | string  | Filter rules on the rule description.                                          |
| fields[rule]              | string  | Return only specific fields in the response for rule attributes.               |
| fields[scorecard]         | string  | Return only specific fields in the included response for scorecard attributes. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Scorecard rules response.

| Parent field  | Field          | Type      | Description                                                        |
| ------------- | -------------- | --------- | ------------------------------------------------------------------ |
|               | data           | [object]  | Array of rule details.                                             |
| data          | attributes     | object    | Details of a rule.                                                 |
| attributes    | category       | string    | **DEPRECATED**: The scorecard name to which this rule must belong. |
| attributes    | created_at     | date-time | Creation time of the rule outcome.                                 |
| attributes    | custom         | boolean   | Defines if the rule is a custom rule.                              |
| attributes    | description    | string    | Explanation of the rule.                                           |
| attributes    | enabled        | boolean   | If enabled, the rule is calculated as part of the score.           |
| attributes    | level          | int32     | The maturity level of the rule (1, 2, or 3).                       |
| attributes    | modified_at    | date-time | Time of the last rule outcome modification.                        |
| attributes    | name           | string    | Name of the rule.                                                  |
| attributes    | owner          | string    | Owner of the rule.                                                 |
| attributes    | scope_query    | string    | A query to filter which entities this rule applies to.             |
| attributes    | scorecard_name | string    | The scorecard name to which this rule must belong.                 |
| data          | id             | string    | The unique ID for a scorecard rule.                                |
| data          | relationships  | object    | Scorecard create rule response relationship.                       |
| relationships | scorecard      | object    | Relationship data for a rule.                                      |
| scorecard     | data           | object    | Rule relationship data.                                            |
| data          | id             | string    | The unique ID for a scorecard.                                     |
| data          | type           | enum      | The JSON:API type for scorecard. Allowed enum values: `scorecard`  |
| data          | type           | enum      | The JSON:API type for scorecard rules. Allowed enum values: `rule` |
|               | links          | object    | Links attributes.                                                  |
| links         | next           | string    | Link for the next set of rules.                                    |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "category": "string",
        "created_at": "2019-09-19T10:00:00.000Z",
        "custom": false,
        "description": "string",
        "enabled": true,
        "level": 2,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "Team Defined",
        "owner": "string",
        "scope_query": "kind:service",
        "scorecard_name": "Deployments automated via Deployment Trains"
      },
      "id": "q8MQxk8TCqrHnWkx",
      "relationships": {
        "scorecard": {
          "data": {
            "id": "q8MQxk8TCqrHnWkp",
            "type": "scorecard"
          }
        }
      },
      "type": "rule"
    }
  ],
  "links": {
    "next": "/api/v2/scorecard/rules?page%5Blimit%5D=2\u0026page%5Boffset%5D=2\u0026page%5Bsize%5D=2"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/rules" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Delete a rule{% #delete-a-rule %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                          |
| ----------------- | --------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/scorecard/rules/{rule_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/scorecard/rules/{rule_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/scorecard/rules/{rule_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/scorecard/rules/{rule_id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/scorecard/rules/{rule_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/scorecard/rules/{rule_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/scorecard/rules/{rule_id} |

### Overview

Deletes a single rule.

OAuth apps require the `apm_service_catalog_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Arguments

#### Path Parameters

| Name                      | Type   | Description         |
| ------------------------- | ------ | ------------------- |
| rule_id [*required*] | string | The ID of the rule. |

### Response

{% tab title="204" %}
OK
{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parametersexport rule_id="CHANGE_ME"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/rules/${rule_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Create outcomes batch{% #create-outcomes-batch %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                       |
| ----------------- | ------------------------------------------------------------------ |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/scorecard/outcomes/batch |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/scorecard/outcomes/batch |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/scorecard/outcomes/batch      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/scorecard/outcomes/batch      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/scorecard/outcomes/batch     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/scorecard/outcomes/batch |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/scorecard/outcomes/batch |

### Overview

Sets multiple service-rule outcomes in a single batched request.

OAuth apps require the `apm_service_catalog_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Request

#### Body Data (required)

Set of scorecard outcomes.

{% tab title="Model" %}

| Parent field | Field                          | Type     | Description                                                                          |
| ------------ | ------------------------------ | -------- | ------------------------------------------------------------------------------------ |
|              | data                           | object   | Scorecard outcomes batch request data.                                               |
| data         | attributes                     | object   | The JSON:API attributes for a batched set of scorecard outcomes.                     |
| attributes   | results                        | [object] | Set of scorecard outcomes to update.                                                 |
| results      | remarks                        | string   | Any remarks regarding the scorecard rule's evaluation, and supports HTML hyperlinks. |
| results      | rule_id [*required*]      | string   | The unique ID for a scorecard rule.                                                  |
| results      | service_name [*required*] | string   | The unique name for a service in the catalog.                                        |
| results      | state [*required*]        | enum     | The state of the rule evaluation. Allowed enum values: `pass,fail,skip`              |
| data         | type                           | enum     | The JSON:API type for scorecard outcomes. Allowed enum values: `batched-outcome`     |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "results": [
        {
          "remarks": "See: <a href=\"https://app.datadoghq.com/services\">Services</a>",
          "rule_id": "q8MQxk8TCqrHnWkx",
          "service_name": "my-service",
          "state": "pass"
        }
      ]
    },
    "type": "batched-outcome"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Scorecard outcomes batch response.

| Parent field  | Field                  | Type      | Description                                                                          |
| ------------- | ---------------------- | --------- | ------------------------------------------------------------------------------------ |
|               | data [*required*] | [object]  | List of rule outcomes which were affected during the bulk operation.                 |
| data          | attributes             | object    | The JSON:API attributes for an outcome.                                              |
| attributes    | created_at             | date-time | Creation time of the rule outcome.                                                   |
| attributes    | modified_at            | date-time | Time of last rule outcome modification.                                              |
| attributes    | remarks                | string    | Any remarks regarding the scorecard rule's evaluation, and supports HTML hyperlinks. |
| attributes    | service_name           | string    | The unique name for a service in the catalog.                                        |
| attributes    | state                  | enum      | The state of the rule evaluation. Allowed enum values: `pass,fail,skip`              |
| data          | id                     | string    | The unique ID for a rule outcome.                                                    |
| data          | relationships          | object    | The JSON:API relationship to a scorecard rule.                                       |
| relationships | rule                   | object    | The JSON:API relationship to a scorecard outcome.                                    |
| rule          | data                   | object    | The JSON:API relationship to an outcome, which returns the related rule id.          |
| data          | id                     | string    | The unique ID for a scorecard rule.                                                  |
| data          | type                   | enum      | The JSON:API type for scorecard rules. Allowed enum values: `rule`                   |
| data          | type                   | enum      | The JSON:API type for an outcome. Allowed enum values: `outcome`                     |
|               | meta [*required*] | object    | Metadata pertaining to the bulk operation.                                           |
| meta          | total_received         | int64     | Total number of scorecard results received during the bulk operation.                |
| meta          | total_updated          | int64     | Total number of scorecard results modified during the bulk operation.                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "remarks": "See: <a href=\"https://app.datadoghq.com/services\">Services</a>",
        "service_name": "my-service",
        "state": "pass"
      },
      "id": "outcome-abc123",
      "relationships": {
        "rule": {
          "data": {
            "id": "q8MQxk8TCqrHnWkx",
            "type": "rule"
          }
        }
      },
      "type": "outcome"
    }
  ],
  "meta": {
    "total_received": "integer",
    "total_updated": "integer"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                          \## default
# 
\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/outcomes/batch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "results": [
        {
          "remarks": "See: \u003ca href=\"https://app.datadoghq.com/services\"\u003eServices\u003c/a\u003e",
          "rule_id": "q8MQxk8TCqrHnWkx",
          "service_name": "my-service",
          "state": "pass"
        }
      ]
    },
    "type": "batched-outcome"
  }
}
EOF
                        
## List all campaigns{% #list-all-campaigns %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                 |
| ----------------- | ------------------------------------------------------------ |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/scorecard/campaigns |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/scorecard/campaigns |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/scorecard/campaigns      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/scorecard/campaigns      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/scorecard/campaigns     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/scorecard/campaigns |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/scorecard/campaigns |

### Overview

Fetches all scorecard campaigns.

OAuth apps require the `apm_service_catalog_read, cases_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Arguments

#### Query Strings

| Name                     | Type    | Description                                  |
| ------------------------ | ------- | -------------------------------------------- |
| page[limit]              | integer | Maximum number of campaigns to return.       |
| page[offset]             | integer | Offset for pagination.                       |
| filter[campaign][name]   | string  | Filter campaigns by name (full-text search). |
| filter[campaign][status] | string  | Filter campaigns by status.                  |
| filter[campaign][owner]  | string  | Filter campaigns by owner UUID.              |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of campaigns.

| Parent field | Field                         | Type      | Description                                                      |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------- |
|              | data [*required*]        | [object]  | Array of campaigns.                                              |
| data         | attributes [*required*]  | object    | Campaign attributes.                                             |
| attributes   | created_at [*required*]  | date-time | Creation time of the campaign.                                   |
| attributes   | description                   | string    | The description of the campaign.                                 |
| attributes   | due_date                      | date-time | The due date of the campaign.                                    |
| attributes   | entity_scope                  | string    | Entity scope query to filter entities for this campaign.         |
| attributes   | guidance                      | string    | Guidance for the campaign.                                       |
| attributes   | key [*required*]         | string    | The unique key for the campaign.                                 |
| attributes   | modified_at [*required*] | date-time | Time of last campaign modification.                              |
| attributes   | name [*required*]        | string    | The name of the campaign.                                        |
| attributes   | owner [*required*]       | string    | The UUID of the campaign owner.                                  |
| attributes   | start_date [*required*]  | date-time | The start date of the campaign.                                  |
| attributes   | status [*required*]      | string    | The status of the campaign.                                      |
| data         | id [*required*]          | string    | The unique ID of the campaign.                                   |
| data         | type [*required*]        | enum      | The JSON:API type for campaigns. Allowed enum values: `campaign` |
|              | meta [*required*]        | object    | Metadata for scores response.                                    |
| meta         | count [*required*]       | int64     | Number of entities in this response.                             |
| meta         | limit [*required*]       | int64     | Pagination limit.                                                |
| meta         | offset [*required*]      | int64     | Pagination offset.                                               |
| meta         | total [*required*]       | int64     | Total number of entities available.                              |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2023-12-15T10:30:00Z",
        "description": "Campaign to improve security posture for Q1 2024.",
        "due_date": "2024-03-31T23:59:59Z",
        "entity_scope": "kind:service AND team:platform",
        "guidance": "Please ensure all services pass the security requirements.",
        "key": "q1-security-2024",
        "modified_at": "2024-01-05T14:20:00Z",
        "name": "Q1 Security Campaign",
        "owner": "550e8400-e29b-41d4-a716-446655440000",
        "start_date": "2024-01-01T00:00:00Z",
        "status": "in_progress"
      },
      "id": "c10ODp0VCrrIpXmz",
      "type": "campaign"
    }
  ],
  "meta": {
    "count": 10,
    "limit": 10,
    "offset": 0,
    "total": 150
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/campaigns" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Create a new campaign{% #create-a-new-campaign %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                  |
| ----------------- | ------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/scorecard/campaigns |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/scorecard/campaigns |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/scorecard/campaigns      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/scorecard/campaigns      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/scorecard/campaigns     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/scorecard/campaigns |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/scorecard/campaigns |

### Overview

Creates a new scorecard campaign.

OAuth apps require the `apm_service_catalog_write, cases_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Request

#### Body Data (required)

Campaign data.

{% tab title="Model" %}

| Parent field | Field                        | Type      | Description                                                                          |
| ------------ | ---------------------------- | --------- | ------------------------------------------------------------------------------------ |
|              | data [*required*]       | object    | Data for creating a new campaign.                                                    |
| data         | attributes [*required*] | object    | Attributes for creating a new campaign.                                              |
| attributes   | description                  | string    | The description of the campaign.                                                     |
| attributes   | due_date                     | date-time | The due date of the campaign.                                                        |
| attributes   | entity_scope                 | string    | Entity scope query to filter entities for this campaign.                             |
| attributes   | guidance                     | string    | Guidance for the campaign.                                                           |
| attributes   | key [*required*]        | string    | The unique key for the campaign.                                                     |
| attributes   | name [*required*]       | string    | The name of the campaign.                                                            |
| attributes   | owner_id [*required*]   | string    | The UUID of the campaign owner.                                                      |
| attributes   | rule_ids [*required*]   | [string]  | Array of rule IDs associated with this campaign.                                     |
| attributes   | start_date [*required*] | date-time | The start date of the campaign.                                                      |
| attributes   | status                       | enum      | The status of the campaign. Allowed enum values: `in_progress,not_started,completed` |
| data         | type [*required*]       | enum      | The JSON:API type for campaigns. Allowed enum values: `campaign`                     |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "description": "Campaign to improve security posture for Q1 2024.",
      "due_date": "2024-03-31T23:59:59Z",
      "entity_scope": "kind:service AND team:platform",
      "guidance": "Please ensure all services pass the security requirements.",
      "key": "q1-security-2024",
      "name": "Q1 Security Campaign",
      "owner_id": "550e8400-e29b-41d4-a716-446655440000",
      "rule_ids": [
        "q8MQxk8TCqrHnWkx",
        "r9NRyl9UDrsIoXly"
      ],
      "start_date": "2024-01-01T00:00:00Z",
      "status": "in_progress"
    },
    "type": "campaign"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing campaign data.

| Parent field | Field                         | Type      | Description                                                      |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------- |
|              | data [*required*]        | object    | Campaign data.                                                   |
| data         | attributes [*required*]  | object    | Campaign attributes.                                             |
| attributes   | created_at [*required*]  | date-time | Creation time of the campaign.                                   |
| attributes   | description                   | string    | The description of the campaign.                                 |
| attributes   | due_date                      | date-time | The due date of the campaign.                                    |
| attributes   | entity_scope                  | string    | Entity scope query to filter entities for this campaign.         |
| attributes   | guidance                      | string    | Guidance for the campaign.                                       |
| attributes   | key [*required*]         | string    | The unique key for the campaign.                                 |
| attributes   | modified_at [*required*] | date-time | Time of last campaign modification.                              |
| attributes   | name [*required*]        | string    | The name of the campaign.                                        |
| attributes   | owner [*required*]       | string    | The UUID of the campaign owner.                                  |
| attributes   | start_date [*required*]  | date-time | The start date of the campaign.                                  |
| attributes   | status [*required*]      | string    | The status of the campaign.                                      |
| data         | id [*required*]          | string    | The unique ID of the campaign.                                   |
| data         | type [*required*]        | enum      | The JSON:API type for campaigns. Allowed enum values: `campaign` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2023-12-15T10:30:00Z",
      "description": "Campaign to improve security posture for Q1 2024.",
      "due_date": "2024-03-31T23:59:59Z",
      "entity_scope": "kind:service AND team:platform",
      "guidance": "Please ensure all services pass the security requirements.",
      "key": "q1-security-2024",
      "modified_at": "2024-01-05T14:20:00Z",
      "name": "Q1 Security Campaign",
      "owner": "550e8400-e29b-41d4-a716-446655440000",
      "start_date": "2024-01-01T00:00:00Z",
      "status": "in_progress"
    },
    "id": "c10ODp0VCrrIpXmz",
    "type": "campaign"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/campaigns" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Campaign to improve security posture for Q1 2024.",
      "due_date": "2024-03-31T23:59:59Z",
      "entity_scope": "kind:service AND team:platform",
      "guidance": "Please ensure all services pass the security requirements.",
      "key": "q1-security-2024",
      "name": "Q1 Security Campaign",
      "owner_id": "550e8400-e29b-41d4-a716-446655440000",
      "rule_ids": [
        "q8MQxk8TCqrHnWkx",
        "r9NRyl9UDrsIoXly"
      ],
      "start_date": "2024-01-01T00:00:00Z",
      "status": "in_progress"
    },
    "type": "campaign"
  }
}
EOF
                
{% /tab %}

## Get a campaign{% #get-a-campaign %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                               |
| ----------------- | -------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/scorecard/campaigns/{campaign_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/scorecard/campaigns/{campaign_id}      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |

### Overview

Fetches a single campaign by ID or key.

OAuth apps require the `apm_service_catalog_read, cases_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description         |
| ----------------------------- | ------ | ------------------- |
| campaign_id [*required*] | string | Campaign ID or key. |

#### Query Strings

| Name         | Type    | Description                                 |
| ------------ | ------- | ------------------------------------------- |
| include      | string  | Include related data (for example, scores). |
| include_meta | boolean | Include metadata (entity and rule counts).  |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing campaign data.

| Parent field | Field                         | Type      | Description                                                      |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------- |
|              | data [*required*]        | object    | Campaign data.                                                   |
| data         | attributes [*required*]  | object    | Campaign attributes.                                             |
| attributes   | created_at [*required*]  | date-time | Creation time of the campaign.                                   |
| attributes   | description                   | string    | The description of the campaign.                                 |
| attributes   | due_date                      | date-time | The due date of the campaign.                                    |
| attributes   | entity_scope                  | string    | Entity scope query to filter entities for this campaign.         |
| attributes   | guidance                      | string    | Guidance for the campaign.                                       |
| attributes   | key [*required*]         | string    | The unique key for the campaign.                                 |
| attributes   | modified_at [*required*] | date-time | Time of last campaign modification.                              |
| attributes   | name [*required*]        | string    | The name of the campaign.                                        |
| attributes   | owner [*required*]       | string    | The UUID of the campaign owner.                                  |
| attributes   | start_date [*required*]  | date-time | The start date of the campaign.                                  |
| attributes   | status [*required*]      | string    | The status of the campaign.                                      |
| data         | id [*required*]          | string    | The unique ID of the campaign.                                   |
| data         | type [*required*]        | enum      | The JSON:API type for campaigns. Allowed enum values: `campaign` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2023-12-15T10:30:00Z",
      "description": "Campaign to improve security posture for Q1 2024.",
      "due_date": "2024-03-31T23:59:59Z",
      "entity_scope": "kind:service AND team:platform",
      "guidance": "Please ensure all services pass the security requirements.",
      "key": "q1-security-2024",
      "modified_at": "2024-01-05T14:20:00Z",
      "name": "Q1 Security Campaign",
      "owner": "550e8400-e29b-41d4-a716-446655440000",
      "start_date": "2024-01-01T00:00:00Z",
      "status": "in_progress"
    },
    "id": "c10ODp0VCrrIpXmz",
    "type": "campaign"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parametersexport campaign_id="c10ODp0VCrrIpXmz"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/campaigns/${campaign_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Update a campaign{% #update-a-campaign %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                               |
| ----------------- | -------------------------------------------------------------------------- |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/scorecard/campaigns/{campaign_id}      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/scorecard/campaigns/{campaign_id}      |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id}     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |

### Overview

Updates an existing campaign.

OAuth apps require the `apm_service_catalog_write, cases_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description         |
| ----------------------------- | ------ | ------------------- |
| campaign_id [*required*] | string | Campaign ID or key. |

### Request

#### Body Data (required)

Campaign data.

{% tab title="Model" %}

| Parent field | Field                        | Type      | Description                                                      |
| ------------ | ---------------------------- | --------- | ---------------------------------------------------------------- |
|              | data [*required*]       | object    | Data for updating a campaign.                                    |
| data         | attributes [*required*] | object    | Attributes for updating a campaign.                              |
| attributes   | description                  | string    | The description of the campaign.                                 |
| attributes   | due_date                     | date-time | The due date of the campaign.                                    |
| attributes   | entity_scope                 | string    | Entity scope query to filter entities for this campaign.         |
| attributes   | guidance                     | string    | Guidance for the campaign.                                       |
| attributes   | key                          | string    | The unique key for the campaign.                                 |
| attributes   | name [*required*]       | string    | The name of the campaign.                                        |
| attributes   | owner_id [*required*]   | string    | The UUID of the campaign owner.                                  |
| attributes   | rule_ids [*required*]   | [string]  | Array of rule IDs associated with this campaign.                 |
| attributes   | start_date [*required*] | date-time | The start date of the campaign.                                  |
| attributes   | status [*required*]     | string    | The status of the campaign.                                      |
| data         | type [*required*]       | enum      | The JSON:API type for campaigns. Allowed enum values: `campaign` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "description": "Campaign to improve security posture for Q1 2024.",
      "due_date": "2024-03-31T23:59:59Z",
      "entity_scope": "kind:service AND team:platform",
      "guidance": "Please ensure all services pass the security requirements.",
      "key": "q1-security-2024",
      "name": "Q1 Security Campaign",
      "owner_id": "550e8400-e29b-41d4-a716-446655440000",
      "rule_ids": [
        "q8MQxk8TCqrHnWkx",
        "r9NRyl9UDrsIoXly"
      ],
      "start_date": "2024-01-01T00:00:00Z",
      "status": "in_progress"
    },
    "type": "campaign"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing campaign data.

| Parent field | Field                         | Type      | Description                                                      |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------- |
|              | data [*required*]        | object    | Campaign data.                                                   |
| data         | attributes [*required*]  | object    | Campaign attributes.                                             |
| attributes   | created_at [*required*]  | date-time | Creation time of the campaign.                                   |
| attributes   | description                   | string    | The description of the campaign.                                 |
| attributes   | due_date                      | date-time | The due date of the campaign.                                    |
| attributes   | entity_scope                  | string    | Entity scope query to filter entities for this campaign.         |
| attributes   | guidance                      | string    | Guidance for the campaign.                                       |
| attributes   | key [*required*]         | string    | The unique key for the campaign.                                 |
| attributes   | modified_at [*required*] | date-time | Time of last campaign modification.                              |
| attributes   | name [*required*]        | string    | The name of the campaign.                                        |
| attributes   | owner [*required*]       | string    | The UUID of the campaign owner.                                  |
| attributes   | start_date [*required*]  | date-time | The start date of the campaign.                                  |
| attributes   | status [*required*]      | string    | The status of the campaign.                                      |
| data         | id [*required*]          | string    | The unique ID of the campaign.                                   |
| data         | type [*required*]        | enum      | The JSON:API type for campaigns. Allowed enum values: `campaign` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2023-12-15T10:30:00Z",
      "description": "Campaign to improve security posture for Q1 2024.",
      "due_date": "2024-03-31T23:59:59Z",
      "entity_scope": "kind:service AND team:platform",
      "guidance": "Please ensure all services pass the security requirements.",
      "key": "q1-security-2024",
      "modified_at": "2024-01-05T14:20:00Z",
      "name": "Q1 Security Campaign",
      "owner": "550e8400-e29b-41d4-a716-446655440000",
      "start_date": "2024-01-01T00:00:00Z",
      "status": "in_progress"
    },
    "id": "c10ODp0VCrrIpXmz",
    "type": "campaign"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
\# Path parametersexport campaign_id="c10ODp0VCrrIpXmz"\# Curl commandcurl -X PUT "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/campaigns/${campaign_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "Campaign to improve security posture for Q1 2024.",
      "due_date": "2024-03-31T23:59:59Z",
      "entity_scope": "kind:service AND team:platform",
      "guidance": "Please ensure all services pass the security requirements.",
      "key": "q1-security-2024",
      "name": "Q1 Security Campaign",
      "owner_id": "550e8400-e29b-41d4-a716-446655440000",
      "rule_ids": [
        "q8MQxk8TCqrHnWkx",
        "r9NRyl9UDrsIoXly"
      ],
      "start_date": "2024-01-01T00:00:00Z",
      "status": "in_progress"
    },
    "type": "campaign"
  }
}
EOF
                
{% /tab %}

## Delete a campaign{% #delete-a-campaign %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                  |
| ----------------- | ----------------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/scorecard/campaigns/{campaign_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/scorecard/campaigns/{campaign_id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/scorecard/campaigns/{campaign_id} |

### Overview

Deletes a single campaign by ID or key.

OAuth apps require the `apm_service_catalog_write, cases_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description         |
| ----------------------------- | ------ | ------------------- |
| campaign_id [*required*] | string | Campaign ID or key. |

### Response

{% tab title="204" %}
No Content
{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parametersexport campaign_id="c10ODp0VCrrIpXmz"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/campaigns/${campaign_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## List all scorecards{% #list-all-scorecards %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                  |
| ----------------- | ------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/scorecard/scorecards |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/scorecard/scorecards |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/scorecard/scorecards      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/scorecard/scorecards      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/scorecard/scorecards     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/scorecard/scorecards |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/scorecard/scorecards |

### Overview

Fetches all scorecards.

OAuth apps require the `apm_service_catalog_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#scorecards) to access this endpoint.



### Arguments

#### Query Strings

| Name                           | Type    | Description                                      |
| ------------------------------ | ------- | ------------------------------------------------ |
| page[offset]                   | integer | Offset for pagination.                           |
| page[size]                     | integer | Maximum number of scorecards to return.          |
| filter[scorecard][id]          | string  | Filter by scorecard ID.                          |
| filter[scorecard][name]        | string  | Filter by scorecard name (partial match).        |
| filter[scorecard][description] | string  | Filter by scorecard description (partial match). |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of scorecards.

| Parent field | Field                         | Type      | Description                                                            |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------------- |
|              | data [*required*]        | [object]  | Array of scorecards.                                                   |
| data         | attributes [*required*]  | object    | Scorecard attributes.                                                  |
| attributes   | created_at [*required*]  | date-time | Creation time of the scorecard.                                        |
| attributes   | description                   | string    | The description of the scorecard.                                      |
| attributes   | modified_at [*required*] | date-time | Time of last scorecard modification.                                   |
| attributes   | name [*required*]        | string    | The name of the scorecard.                                             |
| data         | id [*required*]          | string    | The unique ID of the scorecard.                                        |
| data         | type [*required*]        | enum      | The JSON:API type for scorecard list. Allowed enum values: `scorecard` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2023-01-15T10:30:00Z",
        "description": "Best practices for observability.",
        "modified_at": "2024-01-05T14:20:00Z",
        "name": "Observability Best Practices"
      },
      "id": "q8MQxk8TCqrHnWkx",
      "type": "scorecard"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

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

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/scorecard/scorecards" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}
