Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions config/_default/menus/api.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,19 @@ menu:
url: /api/latest/key-management/
identifier: key-management
generated: true
- name: Validate API key
url: '#validate-api-key'
identifier: key-management-validate-api-key
parent: key-management
generated: true
params:
versions:
- v2
operationids:
- Validate
unstable:
- v2
order: 20
- name: Update a personal access token
url: '#update-a-personal-access-token'
identifier: key-management-update-a-personal-access-token
Expand Down
51 changes: 51 additions & 0 deletions content/en/api/v2/key-management/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -1886,5 +1886,56 @@
},
"html": "<div class=\"\"><div class=\"row hasChildData \">\n <div class=\"col-12 first-column\">\n <div class=\"row table-row first-row js-collapse-trigger collapse-trigger \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\"><span class=\"toggle-arrow\"><svg width=\"6\" height=\"9\" viewBox=\"0 0 6 9\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4.7294 4.45711L0.733399 7.82311L1.1294 8.29111L5.6654 4.45711L1.1294 0.641113L0.751398 1.12711L4.7294 4.45711Z\" fill=\"black\"/></svg></span> data&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">object</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Object used to update a personal access token.</p></div>\n </div>\n <div class=\"row isNested d-none hasChildData \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"data\" class=\"row table-row first-row js-collapse-trigger collapse-trigger \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\"><span class=\"toggle-arrow\"><svg width=\"6\" height=\"9\" viewBox=\"0 0 6 9\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4.7294 4.45711L0.733399 7.82311L1.1294 8.29111L5.6654 4.45711L1.1294 0.641113L0.751398 1.12711L4.7294 4.45711Z\" fill=\"black\"/></svg></span> attributes&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">object</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Attributes used to update a personal access token.</p></div>\n </div>\n <div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"attributes\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">name</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Name of the personal access token.</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"attributes\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">scopes</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">[string]</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Array of scopes to grant the personal access token.</p></div>\n </div>\n \n </div>\n </div>\n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"data\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">id&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">ID of the personal access token.</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"data\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">type&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">enum</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Personal access tokens resource type. \nAllowed enum values: <code>personal_access_tokens</code></p><p>default: <code>personal_access_tokens</code></p></div>\n </div>\n \n </div>\n </div>\n </div>\n </div></div>"
}
},
"Validate": {
"responses": {
"200": {
"json": {
"data": {
"attributes": {
"api_key_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"api_key_scopes": [
"remote_config_read"
],
"valid": true
},
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "validate_v2"
}
},
"html": "<div class=\"\"><div class=\"row hasChildData \">\n <div class=\"col-12 first-column\">\n <div class=\"row table-row first-row js-collapse-trigger collapse-trigger \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\"><span class=\"toggle-arrow\"><svg width=\"6\" height=\"9\" viewBox=\"0 0 6 9\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4.7294 4.45711L0.733399 7.82311L1.1294 8.29111L5.6654 4.45711L1.1294 0.641113L0.751398 1.12711L4.7294 4.45711Z\" fill=\"black\"/></svg></span> data&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">object</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Data object containing the API key validation result.</p></div>\n </div>\n <div class=\"row isNested d-none hasChildData \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"data\" class=\"row table-row first-row js-collapse-trigger collapse-trigger \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\"><span class=\"toggle-arrow\"><svg width=\"6\" height=\"9\" viewBox=\"0 0 6 9\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4.7294 4.45711L0.733399 7.82311L1.1294 8.29111L5.6654 4.45711L1.1294 0.641113L0.751398 1.12711L4.7294 4.45711Z\" fill=\"black\"/></svg></span> attributes&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">object</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Attributes of the API key validation response.</p></div>\n </div>\n <div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"attributes\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">api_key_id&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">The UUID of the API key.</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"attributes\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">api_key_scopes&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">[string]</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">List of scope names associated with the API key.</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"attributes\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">valid&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">boolean</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Whether the API key is valid.</p></div>\n </div>\n \n </div>\n </div>\n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"data\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">id&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">The UUID of the organization associated with the API key.</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"data\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">type&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">enum</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Resource type for the API key validation response. \nAllowed enum values: <code>validate_v2</code></p></div>\n </div>\n \n </div>\n </div>\n </div>\n </div></div>"
},
"403": {
"json": {
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
},
"html": "<div class=\"\"><div class=\"row hasChildData \">\n <div class=\"col-12 first-column\">\n <div class=\"row table-row first-row js-collapse-trigger collapse-trigger \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\"><span class=\"toggle-arrow\"><svg width=\"6\" height=\"9\" viewBox=\"0 0 6 9\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4.7294 4.45711L0.733399 7.82311L1.1294 8.29111L5.6654 4.45711L1.1294 0.641113L0.751398 1.12711L4.7294 4.45711Z\" fill=\"black\"/></svg></span> errors&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">[object]</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">A list of errors.</p></div>\n </div>\n <div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"errors\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">detail</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">A human-readable explanation specific to this occurrence of the error.</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"errors\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">meta</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">object</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Non-standard meta-information about the error</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none hasChildData \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"errors\" class=\"row table-row first-row js-collapse-trigger collapse-trigger \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\"><span class=\"toggle-arrow\"><svg width=\"6\" height=\"9\" viewBox=\"0 0 6 9\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4.7294 4.45711L0.733399 7.82311L1.1294 8.29111L5.6654 4.45711L1.1294 0.641113L0.751398 1.12711L4.7294 4.45711Z\" fill=\"black\"/></svg></span> source</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">object</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">References to the source of the error.</p></div>\n </div>\n <div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"source\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">header</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">A string indicating the name of a single request header which caused the error.</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"source\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">parameter</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">A string indicating which URI query parameter caused the error.</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"source\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">pointer</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">A JSON pointer to the value in the request document that caused the error.</p></div>\n </div>\n \n </div>\n </div>\n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"errors\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">status</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Status code of the response.</p></div>\n </div>\n \n </div>\n </div><div class=\"row isNested d-none \">\n <div class=\"col-12 first-column\">\n <div data-parent-field=\"errors\" class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">title</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">string</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">Short human-readable summary of the error.</p></div>\n </div>\n \n </div>\n </div>\n </div>\n </div></div>"
},
"429": {
"json": {
"errors": [
"Bad Request"
]
},
"html": "<div class=\"\"><div class=\"row \">\n <div class=\"col-12 first-column\">\n <div class=\"row table-row first-row \">\n <div class=\"col-4 column\">\n <p class=\"key table-cell\">errors&nbsp;[<em>required</em>]</p>\n </div>\n <div class=\"col-2 column\"><p class=\"table-cell\">[string]</p></div>\n <div class=\"col-6 column\"><p class=\"table-cell\">A list of errors.</p></div>\n </div>\n \n </div>\n </div></div>"
}
},
"request": {
"json_curl": {},
"json": {},
"html": ""
}
}
}
97 changes: 97 additions & 0 deletions data/api/v2/full_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82197,6 +82197,61 @@ components:
description: The title of the event.
example: "The event title"
type: string
ValidateV2Attributes:
description: Attributes of the API key validation response.
properties:
api_key_id:
description: The UUID of the API key.
example: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6"
type: string
api_key_scopes:
description: List of scope names associated with the API key.
example:
- "remote_config_read"
items:
type: string
type: array
valid:
description: Whether the API key is valid.
example: true
type: boolean
required:
- valid
- api_key_scopes
- api_key_id
type: object
ValidateV2Data:
description: Data object containing the API key validation result.
properties:
attributes:
$ref: "#/components/schemas/ValidateV2Attributes"
id:
description: The UUID of the organization associated with the API key.
example: "550e8400-e29b-41d4-a716-446655440000"
type: string
type:
$ref: "#/components/schemas/ValidateV2Type"
required:
- id
- type
- attributes
type: object
ValidateV2Response:
description: Response for the API key validation endpoint.
properties:
data:
$ref: "#/components/schemas/ValidateV2Data"
required:
- data
type: object
ValidateV2Type:
description: Resource type for the API key validation response.
enum:
- validate_v2
example: validate_v2
type: string
x-enum-varnames:
- ValidateV2
ValidationError:
description: Represents a single validation error, including a human-readable title and metadata.
properties:
Expand Down Expand Up @@ -146308,6 +146363,48 @@ paths:
operator: OR
permissions:
- teams_read
/api/v2/validate:
get:
description: Check if the API key is valid. Returns the organization UUID, API key ID, and associated scopes.
operationId: Validate
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
api_key_id: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6"
api_key_scopes:
- "remote_config_read"
valid: true
id: "550e8400-e29b-41d4-a716-446655440000"
type: "validate_v2"
schema:
$ref: "#/components/schemas/ValidateV2Response"
description: OK
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
summary: Validate API key
tags:
- Key Management
x-menu-order: 20
"x-permission":
operator: OPEN
permissions: []
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/widgets/{experience_type}:
get:
description: |-
Expand Down
Loading
Loading