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

# Widgets

Create, read, update, and delete saved widgets. Widgets are reusable visualization components stored independently from any dashboard or notebook, partitioned by experience type and identified by a UUID.

## Create a widget{% #create-a-widget %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                        |
| ----------------- | ------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/widgets/{experience_type} |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/widgets/{experience_type} |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/widgets/{experience_type}      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/widgets/{experience_type}      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/widgets/{experience_type}     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/widgets/{experience_type} |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/widgets/{experience_type} |

### Overview

Create a new widget for a given experience type. This endpoint requires any of the following permissions:
`cloud_cost_management_write``generate_log_reports``manage_log_reports``product_analytics_saved_widgets_write`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                         |
| --------------------------------- | ------ | ----------------------------------- |
| experience_type [*required*] | string | The experience type for the widget. |

### Request

#### Body Data (required)

Widget request body.

{% tab title="Model" %}

| Parent field | Field                        | Type     | Description                                                                                                                                                                                                                                                               |
| ------------ | ---------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object   | Data for creating or updating a widget.                                                                                                                                                                                                                                   |
| data         | attributes [*required*] | object   | Attributes for creating or updating a widget.                                                                                                                                                                                                                             |
| attributes   | definition [*required*] | object   | The definition of a widget, including its type and configuration.                                                                                                                                                                                                         |
| definition   | title [*required*]      | string   | The display title of the widget.                                                                                                                                                                                                                                          |
| definition   | type [*required*]       | enum     | Widget types that are allowed to be stored as individual records. This is not a complete list of dashboard and notebook widget types. Allowed enum values: `bar_chart,change,cloud_cost_summary,cohort,funnel,geomap,list_stream,query_table,query_value,retention_curve` |
| attributes   | tags                         | [string] | User-defined tags for organizing the widget.                                                                                                                                                                                                                              |
| data         | type [*required*]       | string   | Widgets resource type.                                                                                                                                                                                                                                                    |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "definition": {
        "title": "My Widget",
        "type": "bar_chart"
      },
      "tags": []
    },
    "type": "widgets"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single widget.

| Parent field  | Field                          | Type     | Description                                                                                                                                                                                                                                                               |
| ------------- | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|               | data [*required*]         | object   | A widget resource object.                                                                                                                                                                                                                                                 |
| data          | attributes [*required*]   | object   | Attributes of a widget resource.                                                                                                                                                                                                                                          |
| attributes    | created_at [*required*]   | string   | ISO 8601 timestamp of when the widget was created.                                                                                                                                                                                                                        |
| attributes    | definition [*required*]   | object   | The definition of a widget, including its type and configuration.                                                                                                                                                                                                         |
| definition    | title [*required*]        | string   | The display title of the widget.                                                                                                                                                                                                                                          |
| definition    | type [*required*]         | enum     | Widget types that are allowed to be stored as individual records. This is not a complete list of dashboard and notebook widget types. Allowed enum values: `bar_chart,change,cloud_cost_summary,cohort,funnel,geomap,list_stream,query_table,query_value,retention_curve` |
| attributes    | is_favorited [*required*] | boolean  | Will be implemented soon. Currently always returns false.                                                                                                                                                                                                                 |
| attributes    | modified_at [*required*]  | string   | ISO 8601 timestamp of when the widget was last modified.                                                                                                                                                                                                                  |
| attributes    | tags [*required*]         | [string] | User-defined tags for organizing widgets.                                                                                                                                                                                                                                 |
| data          | id [*required*]           | string   | The unique identifier of the widget.                                                                                                                                                                                                                                      |
| data          | relationships                  | object   | Relationships of the widget resource.                                                                                                                                                                                                                                     |
| relationships | created_by                     | object   | The user who created the widget.                                                                                                                                                                                                                                          |
| created_by    | data                           | object   | Relationship data referencing a user resource.                                                                                                                                                                                                                            |
| data          | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| data          | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |
| relationships | modified_by                    | object   | The user who last modified the widget.                                                                                                                                                                                                                                    |
| modified_by   | data                           | object   | Relationship data referencing a user resource.                                                                                                                                                                                                                            |
| data          | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| data          | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |
| data          | type [*required*]         | string   | Widgets resource type.                                                                                                                                                                                                                                                    |
|               | included                       | [object] | Array of user resources related to the widget.                                                                                                                                                                                                                            |
| included      | attributes                     | object   | Attributes of an included user resource.                                                                                                                                                                                                                                  |
| attributes    | handle                         | string   | The email handle of the user.                                                                                                                                                                                                                                             |
| attributes    | name                           | string   | The display name of the user.                                                                                                                                                                                                                                             |
| included      | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| included      | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T00:00:00.000Z",
      "definition": {
        "title": "My Widget",
        "type": "bar_chart"
      },
      "is_favorited": false,
      "modified_at": "2024-01-15T00:00:00.000Z",
      "tags": [
        "team:my-team"
      ]
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "relationships": {
      "created_by": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "type": "users"
        }
      },
      "modified_by": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "type": "users"
        }
      }
    },
    "type": "widgets"
  },
  "included": [
    {
      "attributes": {
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                  \# Path parametersexport experience_type="ccm_reports"\# 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/widgets/${experience_type}" \
-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": {
      "definition": {
        "title": "My Widget",
        "type": "bar_chart"
      }
    },
    "type": "widgets"
  }
}
EOF
                
{% /tab %}

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

{% tab title="v2" %}

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

### Overview

Retrieve a widget by its UUID for a given experience type. This endpoint requires any of the following permissions:
`cloud_cost_management_read``generate_log_reports``manage_log_reports``product_analytics_saved_widgets_read`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                         |
| --------------------------------- | ------ | ----------------------------------- |
| experience_type [*required*] | string | The experience type for the widget. |
| uuid [*required*]            | string | The UUID of the widget.             |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single widget.

| Parent field  | Field                          | Type     | Description                                                                                                                                                                                                                                                               |
| ------------- | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|               | data [*required*]         | object   | A widget resource object.                                                                                                                                                                                                                                                 |
| data          | attributes [*required*]   | object   | Attributes of a widget resource.                                                                                                                                                                                                                                          |
| attributes    | created_at [*required*]   | string   | ISO 8601 timestamp of when the widget was created.                                                                                                                                                                                                                        |
| attributes    | definition [*required*]   | object   | The definition of a widget, including its type and configuration.                                                                                                                                                                                                         |
| definition    | title [*required*]        | string   | The display title of the widget.                                                                                                                                                                                                                                          |
| definition    | type [*required*]         | enum     | Widget types that are allowed to be stored as individual records. This is not a complete list of dashboard and notebook widget types. Allowed enum values: `bar_chart,change,cloud_cost_summary,cohort,funnel,geomap,list_stream,query_table,query_value,retention_curve` |
| attributes    | is_favorited [*required*] | boolean  | Will be implemented soon. Currently always returns false.                                                                                                                                                                                                                 |
| attributes    | modified_at [*required*]  | string   | ISO 8601 timestamp of when the widget was last modified.                                                                                                                                                                                                                  |
| attributes    | tags [*required*]         | [string] | User-defined tags for organizing widgets.                                                                                                                                                                                                                                 |
| data          | id [*required*]           | string   | The unique identifier of the widget.                                                                                                                                                                                                                                      |
| data          | relationships                  | object   | Relationships of the widget resource.                                                                                                                                                                                                                                     |
| relationships | created_by                     | object   | The user who created the widget.                                                                                                                                                                                                                                          |
| created_by    | data                           | object   | Relationship data referencing a user resource.                                                                                                                                                                                                                            |
| data          | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| data          | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |
| relationships | modified_by                    | object   | The user who last modified the widget.                                                                                                                                                                                                                                    |
| modified_by   | data                           | object   | Relationship data referencing a user resource.                                                                                                                                                                                                                            |
| data          | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| data          | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |
| data          | type [*required*]         | string   | Widgets resource type.                                                                                                                                                                                                                                                    |
|               | included                       | [object] | Array of user resources related to the widget.                                                                                                                                                                                                                            |
| included      | attributes                     | object   | Attributes of an included user resource.                                                                                                                                                                                                                                  |
| attributes    | handle                         | string   | The email handle of the user.                                                                                                                                                                                                                                             |
| attributes    | name                           | string   | The display name of the user.                                                                                                                                                                                                                                             |
| included      | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| included      | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T00:00:00.000Z",
      "definition": {
        "title": "My Widget",
        "type": "bar_chart"
      },
      "is_favorited": false,
      "modified_at": "2024-01-15T00:00:00.000Z",
      "tags": [
        "team:my-team"
      ]
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "relationships": {
      "created_by": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "type": "users"
        }
      },
      "modified_by": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "type": "users"
        }
      }
    },
    "type": "widgets"
  },
  "included": [
    {
      "attributes": {
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "type": "users"
    }
  ]
}
```

{% /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="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 experience_type="ccm_reports"export uuid="CHANGE_ME"\# 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/widgets/${experience_type}/${uuid}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

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

{% tab title="v2" %}

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

### Overview

Update a widget by its UUID for a given experience type. This performs a full replacement of the widget definition. This endpoint requires any of the following permissions:
`cloud_cost_management_write``generate_log_reports``manage_log_reports``product_analytics_saved_widgets_write`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                         |
| --------------------------------- | ------ | ----------------------------------- |
| experience_type [*required*] | string | The experience type for the widget. |
| uuid [*required*]            | string | The UUID of the widget.             |

### Request

#### Body Data (required)

Widget request body.

{% tab title="Model" %}

| Parent field | Field                        | Type     | Description                                                                                                                                                                                                                                                               |
| ------------ | ---------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object   | Data for creating or updating a widget.                                                                                                                                                                                                                                   |
| data         | attributes [*required*] | object   | Attributes for creating or updating a widget.                                                                                                                                                                                                                             |
| attributes   | definition [*required*] | object   | The definition of a widget, including its type and configuration.                                                                                                                                                                                                         |
| definition   | title [*required*]      | string   | The display title of the widget.                                                                                                                                                                                                                                          |
| definition   | type [*required*]       | enum     | Widget types that are allowed to be stored as individual records. This is not a complete list of dashboard and notebook widget types. Allowed enum values: `bar_chart,change,cloud_cost_summary,cohort,funnel,geomap,list_stream,query_table,query_value,retention_curve` |
| attributes   | tags                         | [string] | User-defined tags for organizing the widget.                                                                                                                                                                                                                              |
| data         | type [*required*]       | string   | Widgets resource type.                                                                                                                                                                                                                                                    |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "definition": {
        "title": "My Widget",
        "type": "bar_chart"
      },
      "tags": []
    },
    "type": "widgets"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single widget.

| Parent field  | Field                          | Type     | Description                                                                                                                                                                                                                                                               |
| ------------- | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|               | data [*required*]         | object   | A widget resource object.                                                                                                                                                                                                                                                 |
| data          | attributes [*required*]   | object   | Attributes of a widget resource.                                                                                                                                                                                                                                          |
| attributes    | created_at [*required*]   | string   | ISO 8601 timestamp of when the widget was created.                                                                                                                                                                                                                        |
| attributes    | definition [*required*]   | object   | The definition of a widget, including its type and configuration.                                                                                                                                                                                                         |
| definition    | title [*required*]        | string   | The display title of the widget.                                                                                                                                                                                                                                          |
| definition    | type [*required*]         | enum     | Widget types that are allowed to be stored as individual records. This is not a complete list of dashboard and notebook widget types. Allowed enum values: `bar_chart,change,cloud_cost_summary,cohort,funnel,geomap,list_stream,query_table,query_value,retention_curve` |
| attributes    | is_favorited [*required*] | boolean  | Will be implemented soon. Currently always returns false.                                                                                                                                                                                                                 |
| attributes    | modified_at [*required*]  | string   | ISO 8601 timestamp of when the widget was last modified.                                                                                                                                                                                                                  |
| attributes    | tags [*required*]         | [string] | User-defined tags for organizing widgets.                                                                                                                                                                                                                                 |
| data          | id [*required*]           | string   | The unique identifier of the widget.                                                                                                                                                                                                                                      |
| data          | relationships                  | object   | Relationships of the widget resource.                                                                                                                                                                                                                                     |
| relationships | created_by                     | object   | The user who created the widget.                                                                                                                                                                                                                                          |
| created_by    | data                           | object   | Relationship data referencing a user resource.                                                                                                                                                                                                                            |
| data          | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| data          | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |
| relationships | modified_by                    | object   | The user who last modified the widget.                                                                                                                                                                                                                                    |
| modified_by   | data                           | object   | Relationship data referencing a user resource.                                                                                                                                                                                                                            |
| data          | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| data          | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |
| data          | type [*required*]         | string   | Widgets resource type.                                                                                                                                                                                                                                                    |
|               | included                       | [object] | Array of user resources related to the widget.                                                                                                                                                                                                                            |
| included      | attributes                     | object   | Attributes of an included user resource.                                                                                                                                                                                                                                  |
| attributes    | handle                         | string   | The email handle of the user.                                                                                                                                                                                                                                             |
| attributes    | name                           | string   | The display name of the user.                                                                                                                                                                                                                                             |
| included      | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| included      | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T00:00:00.000Z",
      "definition": {
        "title": "My Widget",
        "type": "bar_chart"
      },
      "is_favorited": false,
      "modified_at": "2024-01-15T00:00:00.000Z",
      "tags": [
        "team:my-team"
      ]
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "relationships": {
      "created_by": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "type": "users"
        }
      },
      "modified_by": {
        "data": {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "type": "users"
        }
      }
    },
    "type": "widgets"
  },
  "included": [
    {
      "attributes": {
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "type": "users"
    }
  ]
}
```

{% /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="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 experience_type="ccm_reports"export uuid="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/widgets/${experience_type}/${uuid}" \
-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": {
      "definition": {
        "title": "My Widget",
        "type": "bar_chart"
      }
    },
    "type": "widgets"
  }
}
EOF
                
{% /tab %}

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

{% tab title="v2" %}

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

### Overview

Soft-delete a widget by its UUID for a given experience type. This endpoint requires any of the following permissions:
`cloud_cost_management_write``generate_log_reports``manage_log_reports``product_analytics_saved_widgets_write`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                         |
| --------------------------------- | ------ | ----------------------------------- |
| experience_type [*required*] | string | The experience type for the widget. |
| uuid [*required*]            | string | The UUID of the widget.             |

### Response

{% tab title="204" %}
No Content
{% /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 experience_type="ccm_reports"export uuid="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/widgets/${experience_type}/${uuid}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Search widgets{% #search-widgets %}

{% tab title="v2" %}

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

### Overview

Search and list widgets for a given experience type. Supports filtering by widget type, creator, title, and tags, as well as sorting and pagination. This endpoint requires any of the following permissions:
`cloud_cost_management_read``generate_log_reports``manage_log_reports``product_analytics_saved_widgets_read`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                         |
| --------------------------------- | ------ | ----------------------------------- |
| experience_type [*required*] | string | The experience type for the widget. |

#### Query Strings

| Name                  | Type    | Description                                                                                                                                                                |
| --------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter[widgetType]    | enum    | Filter widgets by widget type.Allowed enum values: `bar_chart, change, cloud_cost_summary, cohort, funnel, geomap, list_stream, query_table, query_value, retention_curve` |
| filter[creatorHandle] | string  | Filter widgets by the email handle of the creator.                                                                                                                         |
| filter[isFavorited]   | boolean | Filter to only widgets favorited by the current user.                                                                                                                      |
| filter[title]         | string  | Filter widgets by title (substring match).                                                                                                                                 |
| filter[tags]          | string  | Filter widgets by tags. Format as bracket-delimited CSV, e.g. `[tag1,tag2]`.                                                                                               |
| sort                  | string  | Sort field for the results. Prefix with `-` for descending order. Allowed values: `title`, `created_at`, `modified_at`.                                                    |
| page[number]          | integer | Page number for pagination (0-indexed).                                                                                                                                    |
| page[size]            | integer | Number of widgets per page.                                                                                                                                                |

### Response

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

| Parent field  | Field                          | Type     | Description                                                                                                                                                                                                                                                               |
| ------------- | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|               | data [*required*]         | [object] | List of widget resources.                                                                                                                                                                                                                                                 |
| data          | attributes [*required*]   | object   | Attributes of a widget resource.                                                                                                                                                                                                                                          |
| attributes    | created_at [*required*]   | string   | ISO 8601 timestamp of when the widget was created.                                                                                                                                                                                                                        |
| attributes    | definition [*required*]   | object   | The definition of a widget, including its type and configuration.                                                                                                                                                                                                         |
| definition    | title [*required*]        | string   | The display title of the widget.                                                                                                                                                                                                                                          |
| definition    | type [*required*]         | enum     | Widget types that are allowed to be stored as individual records. This is not a complete list of dashboard and notebook widget types. Allowed enum values: `bar_chart,change,cloud_cost_summary,cohort,funnel,geomap,list_stream,query_table,query_value,retention_curve` |
| attributes    | is_favorited [*required*] | boolean  | Will be implemented soon. Currently always returns false.                                                                                                                                                                                                                 |
| attributes    | modified_at [*required*]  | string   | ISO 8601 timestamp of when the widget was last modified.                                                                                                                                                                                                                  |
| attributes    | tags [*required*]         | [string] | User-defined tags for organizing widgets.                                                                                                                                                                                                                                 |
| data          | id [*required*]           | string   | The unique identifier of the widget.                                                                                                                                                                                                                                      |
| data          | relationships                  | object   | Relationships of the widget resource.                                                                                                                                                                                                                                     |
| relationships | created_by                     | object   | The user who created the widget.                                                                                                                                                                                                                                          |
| created_by    | data                           | object   | Relationship data referencing a user resource.                                                                                                                                                                                                                            |
| data          | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| data          | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |
| relationships | modified_by                    | object   | The user who last modified the widget.                                                                                                                                                                                                                                    |
| modified_by   | data                           | object   | Relationship data referencing a user resource.                                                                                                                                                                                                                            |
| data          | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| data          | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |
| data          | type [*required*]         | string   | Widgets resource type.                                                                                                                                                                                                                                                    |
|               | included                       | [object] | Array of user resources related to the widgets.                                                                                                                                                                                                                           |
| included      | attributes                     | object   | Attributes of an included user resource.                                                                                                                                                                                                                                  |
| attributes    | handle                         | string   | The email handle of the user.                                                                                                                                                                                                                                             |
| attributes    | name                           | string   | The display name of the user.                                                                                                                                                                                                                                             |
| included      | id [*required*]           | string   | The unique identifier of the user.                                                                                                                                                                                                                                        |
| included      | type [*required*]         | string   | Users resource type.                                                                                                                                                                                                                                                      |
|               | meta                           | object   | Metadata about the search results.                                                                                                                                                                                                                                        |
| meta          | created_by_anyone_total        | int64    | Total number of widgets created by anyone.                                                                                                                                                                                                                                |
| meta          | created_by_you_total           | int64    | Total number of widgets created by the current user.                                                                                                                                                                                                                      |
| meta          | favorited_by_you_total         | int64    | Total number of widgets favorited by the current user.                                                                                                                                                                                                                    |
| meta          | filtered_total                 | int64    | Total number of widgets matching the current filter criteria.                                                                                                                                                                                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2024-01-15T00:00:00.000Z",
        "definition": {
          "title": "My Widget",
          "type": "bar_chart"
        },
        "is_favorited": false,
        "modified_at": "2024-01-15T00:00:00.000Z",
        "tags": [
          "team:my-team"
        ]
      },
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "relationships": {
        "created_by": {
          "data": {
            "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "type": "users"
          }
        },
        "modified_by": {
          "data": {
            "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "type": "users"
          }
        }
      },
      "type": "widgets"
    }
  ],
  "included": [
    {
      "attributes": {
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "type": "users"
    }
  ],
  "meta": {
    "created_by_anyone_total": "integer",
    "created_by_you_total": "integer",
    "favorited_by_you_total": "integer",
    "filtered_total": "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

##### 
                  \# Path parametersexport experience_type="ccm_reports"\# 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/widgets/${experience_type}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}
