Skip to content

Commit 7effa38

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Dashboards Usage v2 endpoints (#3538)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 330bd16 commit 7effa38

30 files changed

Lines changed: 2411 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 357 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22950,6 +22950,136 @@ components:
2295022950
- INTEGRATION_SCREENBOARD
2295122951
- INTEGRATION_TIMEBOARD
2295222952
- HOST_TIMEBOARD
22953+
DashboardUsage:
22954+
description: A single dashboard usage record.
22955+
properties:
22956+
attributes:
22957+
$ref: "#/components/schemas/DashboardUsageAttributes"
22958+
id:
22959+
description: The dashboard ID.
22960+
example: "q5j-nti-fv6"
22961+
type: string
22962+
type:
22963+
$ref: "#/components/schemas/DashboardUsageType"
22964+
required:
22965+
- id
22966+
- type
22967+
- attributes
22968+
type: object
22969+
DashboardUsageAttributes:
22970+
description: Usage statistics for a dashboard.
22971+
properties:
22972+
author:
22973+
$ref: "#/components/schemas/DashboardUsageUser"
22974+
created_at:
22975+
description: When the dashboard was created.
22976+
example: "2026-01-15T09:30:00.000Z"
22977+
format: date-time
22978+
nullable: true
22979+
type: string
22980+
dashboard_quality_score:
22981+
description: The dashboard quality score, or `null` when no score is available.
22982+
example: 0.85
22983+
format: double
22984+
nullable: true
22985+
type: number
22986+
edited_at:
22987+
description: When the dashboard was most recently edited.
22988+
example: "2026-04-20T11:05:00.000Z"
22989+
format: date-time
22990+
nullable: true
22991+
type: string
22992+
org_id:
22993+
description: The Datadog organization that owns the dashboard.
22994+
example: 100
22995+
format: int64
22996+
type: integer
22997+
teams:
22998+
description: Teams the dashboard is tagged with.
22999+
items:
23000+
description: A team handle.
23001+
type: string
23002+
nullable: true
23003+
type: array
23004+
title:
23005+
description: The dashboard title.
23006+
example: My production overview
23007+
type: string
23008+
total_views:
23009+
description: The total number of times the dashboard has been viewed.
23010+
example: 42
23011+
format: int64
23012+
type: integer
23013+
total_views_by_type:
23014+
additionalProperties:
23015+
description: View count for that view type.
23016+
format: int64
23017+
type: integer
23018+
description: View counts keyed by view type. Possible keys are `in_app`, `embed`, `public`, `shared`, `api`, and `unknown`.
23019+
nullable: true
23020+
type: object
23021+
viewed_at:
23022+
description: When the dashboard was most recently viewed.
23023+
example: "2026-05-01T14:22:10.000Z"
23024+
format: date-time
23025+
nullable: true
23026+
type: string
23027+
viewer:
23028+
$ref: "#/components/schemas/DashboardUsageUser"
23029+
widget_count:
23030+
description: The total number of widgets on the dashboard.
23031+
example: 12
23032+
format: int64
23033+
nullable: true
23034+
type: integer
23035+
widget_count_by_type:
23036+
additionalProperties:
23037+
description: Widget count for that widget type.
23038+
format: int64
23039+
type: integer
23040+
description: Widget counts keyed by widget type. The map includes group widgets and widgets without requests.
23041+
nullable: true
23042+
type: object
23043+
required:
23044+
- org_id
23045+
type: object
23046+
DashboardUsageResponse:
23047+
description: Response containing usage statistics for a single dashboard.
23048+
properties:
23049+
data:
23050+
$ref: "#/components/schemas/DashboardUsage"
23051+
required:
23052+
- data
23053+
type: object
23054+
DashboardUsageType:
23055+
default: dashboards-usages
23056+
description: The type of the resource. Always `dashboards-usages`.
23057+
enum:
23058+
- dashboards-usages
23059+
example: dashboards-usages
23060+
type: string
23061+
x-enum-varnames:
23062+
- DASHBOARDS_USAGES
23063+
DashboardUsageUser:
23064+
description: A user referenced from a dashboard usage record (author or viewer).
23065+
nullable: true
23066+
properties:
23067+
handle:
23068+
description: Datadog handle (login) of the user.
23069+
example: jane.doe@example.com
23070+
type: string
23071+
id:
23072+
description: The user ID.
23073+
example: "00000000-0000-0000-0000-000000000000"
23074+
type: string
23075+
is_disabled:
23076+
description: Whether the user account is disabled.
23077+
type: boolean
23078+
name:
23079+
description: Display name of the user.
23080+
example: Jane Doe
23081+
type: string
23082+
type: object
2295323083
DataAttributesRulesItemsIfTagExists:
2295423084
description: The behavior when the tag already exists.
2295523085
enum:
@@ -43121,6 +43251,52 @@ components:
4312143251
type: string
4312243252
x-enum-varnames:
4312343253
- LIST_CONNECTIONS_RESPONSE
43254+
ListDashboardsUsageResponse:
43255+
description: Paginated list of dashboard usage records.
43256+
properties:
43257+
data:
43258+
description: Dashboard usage records, one per dashboard in the caller's organization.
43259+
items:
43260+
$ref: "#/components/schemas/DashboardUsage"
43261+
type: array
43262+
links:
43263+
$ref: "#/components/schemas/ListDashboardsUsageResponseLinks"
43264+
meta:
43265+
$ref: "#/components/schemas/ListDashboardsUsageResponseMeta"
43266+
required:
43267+
- data
43268+
- meta
43269+
type: object
43270+
ListDashboardsUsageResponseLinks:
43271+
description: Pagination links for a list of dashboard usage records.
43272+
properties:
43273+
first:
43274+
description: Link to the first page.
43275+
example: "https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=0&page[limit]=250"
43276+
type: string
43277+
last:
43278+
description: Link to the last page, or `null` if the total is unknown.
43279+
nullable: true
43280+
type: string
43281+
next:
43282+
description: Link to the next page. Absent when there is no next page.
43283+
nullable: true
43284+
type: string
43285+
prev:
43286+
description: Link to the previous page. Absent when there is no previous page.
43287+
nullable: true
43288+
type: string
43289+
self:
43290+
description: Link to the current page.
43291+
example: "https://api.datadoghq.com/api/v2/dashboards/usage"
43292+
type: string
43293+
type: object
43294+
ListDashboardsUsageResponseMeta:
43295+
description: Pagination metadata for a list of dashboard usage records.
43296+
properties:
43297+
page:
43298+
$ref: "#/components/schemas/PaginationMetaPage"
43299+
type: object
4312443300
ListDeploymentRuleResponseData:
4312543301
description: Data for a list of deployment rules.
4312643302
properties:
@@ -102379,6 +102555,181 @@ paths:
102379102555
x-unstable: |-
102380102556
**Note**: This endpoint is in preview and is subject to change.
102381102557
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
102558+
/api/v2/dashboards/usage:
102559+
get:
102560+
description: Get paginated usage statistics for every dashboard in the caller's organization. Use `page[limit]` and `page[offset]` to walk the result set.
102561+
operationId: ListDashboardsUsage
102562+
parameters:
102563+
- description: Maximum number of dashboards to return per page. Server-side maximum is 500; values above 500 return a 400 Bad Request.
102564+
in: query
102565+
name: page[limit]
102566+
required: false
102567+
schema:
102568+
default: 250
102569+
format: int64
102570+
type: integer
102571+
- description: Zero-based offset into the result set.
102572+
in: query
102573+
name: page[offset]
102574+
required: false
102575+
schema:
102576+
default: 0
102577+
format: int64
102578+
minimum: 0
102579+
type: integer
102580+
responses:
102581+
"200":
102582+
content:
102583+
application/json:
102584+
examples:
102585+
default:
102586+
value:
102587+
data:
102588+
- attributes:
102589+
author:
102590+
handle: "jane.doe@example.com"
102591+
id: "00000000-0000-0000-0000-000000000000"
102592+
is_disabled: false
102593+
name: "Jane Doe"
102594+
created_at: "2026-01-15T09:30:00.000Z"
102595+
dashboard_quality_score: 0.85
102596+
edited_at: "2026-04-20T11:05:00.000Z"
102597+
org_id: 100
102598+
teams: ["sre"]
102599+
title: "My production overview"
102600+
total_views: 42
102601+
total_views_by_type:
102602+
embed: 12
102603+
in_app: 30
102604+
viewed_at: "2026-05-01T14:22:10.000Z"
102605+
viewer:
102606+
handle: "john.smith@example.com"
102607+
id: "00000000-0000-0000-0000-000000000001"
102608+
is_disabled: false
102609+
name: "John Smith"
102610+
widget_count: 12
102611+
widget_count_by_type:
102612+
query_value: 4
102613+
timeseries: 8
102614+
id: "q5j-nti-fv6"
102615+
type: "dashboards-usages"
102616+
links:
102617+
first: "https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=0&page[limit]=250"
102618+
last: "https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=1000&page[limit]=250"
102619+
next: "https://api.datadoghq.com/api/v2/dashboards/usage?page[offset]=250&page[limit]=250"
102620+
self: "https://api.datadoghq.com/api/v2/dashboards/usage"
102621+
meta:
102622+
page:
102623+
first_offset: 0
102624+
last_offset: 1000
102625+
limit: 250
102626+
next_offset: 250
102627+
offset: 0
102628+
prev_offset:
102629+
total: 1234
102630+
type: offset_limit
102631+
schema:
102632+
$ref: "#/components/schemas/ListDashboardsUsageResponse"
102633+
description: OK
102634+
"400":
102635+
$ref: "#/components/responses/BadRequestResponse"
102636+
"403":
102637+
$ref: "#/components/responses/ForbiddenResponse"
102638+
"429":
102639+
$ref: "#/components/responses/TooManyRequestsResponse"
102640+
security:
102641+
- apiKeyAuth: []
102642+
appKeyAuth: []
102643+
- AuthZ:
102644+
- dashboards_read
102645+
summary: Get usage stats for all dashboards
102646+
tags:
102647+
- Dashboards
102648+
x-pagination:
102649+
limitParam: page[limit]
102650+
pageOffsetParam: page[offset]
102651+
resultsPath: data
102652+
x-permission:
102653+
operator: OR
102654+
permissions:
102655+
- dashboards_read
102656+
x-unstable: |-
102657+
**Note**: This endpoint is in preview and is subject to change.
102658+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
102659+
/api/v2/dashboards/{dashboard_id}/usage:
102660+
get:
102661+
description: Get usage statistics for a single dashboard. The response includes view counts, the most recent view and edit times, widget counts, and the dashboard quality score.
102662+
operationId: GetDashboardUsage
102663+
parameters:
102664+
- description: The ID of the dashboard.
102665+
in: path
102666+
name: dashboard_id
102667+
required: true
102668+
schema:
102669+
example: "q5j-nti-fv6"
102670+
type: string
102671+
responses:
102672+
"200":
102673+
content:
102674+
application/json:
102675+
examples:
102676+
default:
102677+
value:
102678+
data:
102679+
attributes:
102680+
author:
102681+
handle: "jane.doe"
102682+
id: "00000000-0000-0000-0000-000000000000"
102683+
is_disabled: false
102684+
name: "Jane Doe"
102685+
created_at: "2026-01-15T09:30:00.000Z"
102686+
dashboard_quality_score: 0.85
102687+
edited_at: "2026-04-20T11:05:00.000Z"
102688+
org_id: 100
102689+
teams: ["sre"]
102690+
title: "My production overview"
102691+
total_views: 42
102692+
total_views_by_type:
102693+
embed: 12
102694+
in_app: 30
102695+
viewed_at: "2026-05-01T14:22:10.000Z"
102696+
viewer:
102697+
handle: "john.smith"
102698+
id: "00000000-0000-0000-0000-000000000001"
102699+
is_disabled: false
102700+
name: "John Smith"
102701+
widget_count: 12
102702+
widget_count_by_type:
102703+
query_value: 4
102704+
timeseries: 8
102705+
id: "q5j-nti-fv6"
102706+
type: "dashboards-usages"
102707+
schema:
102708+
$ref: "#/components/schemas/DashboardUsageResponse"
102709+
description: OK
102710+
"400":
102711+
$ref: "#/components/responses/BadRequestResponse"
102712+
"403":
102713+
$ref: "#/components/responses/ForbiddenResponse"
102714+
"404":
102715+
$ref: "#/components/responses/NotFoundResponse"
102716+
"429":
102717+
$ref: "#/components/responses/TooManyRequestsResponse"
102718+
security:
102719+
- apiKeyAuth: []
102720+
appKeyAuth: []
102721+
- AuthZ:
102722+
- dashboards_read
102723+
summary: Get usage stats for a dashboard
102724+
tags:
102725+
- Dashboards
102726+
x-permission:
102727+
operator: OR
102728+
permissions:
102729+
- dashboards_read
102730+
x-unstable: |-
102731+
**Note**: This endpoint is in preview and is subject to change.
102732+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
102382102733
/api/v2/datasets:
102383102734
get:
102384102735
description: Get all datasets that have been configured for an organization.
@@ -151041,6 +151392,12 @@ tags:
151041151392
- **Embed** sharing must be enabled under **Organization Settings** > **Public Sharing** > **Shared Dashboards**.
151042151393
- You need [an API key and an application key](https://docs.datadoghq.com/account_management/api-app-keys/) to interact with these endpoints.
151043151394
name: Dashboard Secure Embed
151395+
- description: |-
151396+
Get usage statistics for the dashboards in your organization, including view
151397+
counts, last-edit times, widget counts, and quality scores. See the
151398+
[Dashboards documentation](https://docs.datadoghq.com/dashboards/) for more
151399+
information.
151400+
name: Dashboards
151044151401
- description: |-
151045151402
The Data Deletion API allows the user to target and delete data from the allowed products. It's currently enabled for Logs and RUM and depends on `logs_delete_data` and `rum_delete_data` permissions respectively.
151046151403
name: Data Deletion

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ datadog\_api\_client.v2.api.dashboard\_secure\_embed\_api module
235235
:members:
236236
:show-inheritance:
237237

238+
datadog\_api\_client.v2.api.dashboards\_api module
239+
--------------------------------------------------
240+
241+
.. automodule:: datadog_api_client.v2.api.dashboards_api
242+
:members:
243+
:show-inheritance:
244+
238245
datadog\_api\_client.v2.api.data\_deletion\_api module
239246
------------------------------------------------------
240247

0 commit comments

Comments
 (0)