- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Datadog API와 애플리케이션 키를 관리하세요. 다음 엔드포인트와 상호 작용하려면 필요한 권한이 있는 사용자에게 API 키와 애플리케이션 키가 필요합니다. API와 애플리케이션 키 전체 목록은 Datadog API 페이지에서 확인할 수 있습니다.
DELETE https://api.ap1.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}https://api.datadoghq.eu/api/v2/current_user/application_keys/{app_key_id}https://api.ddog-gov.com/api/v2/current_user/application_keys/{app_key_id}https://api.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}https://api.us3.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}https://api.us5.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}
Delete an application key owned by current user
This endpoint requires the user_app_keys
permission.
이름
유형
설명
app_key_id [required]
string
The ID of the application key.
No Content
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Delete an application key owned by current user returns "No Content" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
# there is a valid "application_key" in the system
APPLICATION_KEY_DATA_ID = ENV["APPLICATION_KEY_DATA_ID"]
api_instance.delete_current_user_application_key(APPLICATION_KEY_DATA_ID)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v1/api_keyhttps://api.datadoghq.eu/api/v1/api_keyhttps://api.ddog-gov.com/api/v1/api_keyhttps://api.datadoghq.com/api/v1/api_keyhttps://api.us3.datadoghq.com/api/v1/api_keyhttps://api.us5.datadoghq.com/api/v1/api_key
Get all API keys available for your account.
This endpoint requires the api_keys_read
permission.
OK
List of API and application keys available for a given organization.
항목
유형
설명
api_keys
[object]
Array of API keys.
created
string
Date of creation of the API key.
created_by
string
Datadog user handle that created the API key.
key
string
API key.
name
string
Name of your API key.
{
"api_keys": [
{
"created": "2019-08-02 15:31:07",
"created_by": "john@example.com",
"key": "1234512345123456abcabc912349abcd",
"name": "example user"
}
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Get all API keys returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
p api_instance.list_api_keys()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v2/api_keyshttps://api.datadoghq.eu/api/v2/api_keyshttps://api.ddog-gov.com/api/v2/api_keyshttps://api.datadoghq.com/api/v2/api_keyshttps://api.us3.datadoghq.com/api/v2/api_keyshttps://api.us5.datadoghq.com/api/v2/api_keys
List all API keys available for your account.
This endpoint requires the api_keys_read
permission.
이름
유형
설명
page[size]
integer
Size for a given page. The maximum allowed value is 100.
page[number]
integer
Specific page number to return.
sort
enum
API key attribute used to sort results. Sort order is ascending
by default. In order to specify a descending sort, prefix the
attribute with a minus sign.
Allowed enum values: created_at, -created_at, last4, -last4, modified_at, -modified_at, name, -name
filter
string
Filter API keys by the specified string.
filter[created_at][start]
string
Only include API keys created on or after the specified date.
filter[created_at][end]
string
Only include API keys created on or before the specified date.
filter[modified_at][start]
string
Only include API keys modified on or after the specified date.
filter[modified_at][end]
string
Only include API keys modified on or before the specified date.
include
string
Comma separated list of resource paths for related resources to include in the response. Supported resource paths are created_by
and modified_by
.
filter[remote_config_read_enabled]
boolean
Filter API keys by remote config read enabled status.
filter[category]
string
Filter API keys by category.
OK
Response for a list of API keys.
항목
유형
설명
data
[object]
Array of API keys.
attributes
object
Attributes of a partial API key.
category
string
The category of the API key.
created_at
string
Creation date of the API key.
last4
string
The last four characters of the API key.
modified_at
string
Date the API key was last modified.
name
string
Name of the API key.
remote_config_read_enabled
boolean
The remote config read enabled status.
id
string
ID of the API key.
relationships
object
Resources related to the API key.
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
API Keys resource type.
Allowed enum values: api_keys
default: api_keys
included
[ <oneOf>]
Array of objects related to the API key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
meta
object
Additional information related to api keys response.
max_allowed
int64
Max allowed number of API keys.
page
object
Additional information related to the API keys response.
total_filtered_count
int64
Total filtered application key count.
{
"data": [
{
"attributes": {
"category": "string",
"created_at": "2020-11-23T10:00:00.000Z",
"last4": "abcd",
"modified_at": "2020-11-23T10:00:00.000Z",
"name": "API Key for submitting metrics",
"remote_config_read_enabled": false
},
"id": "string",
"relationships": {
"created_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
},
"modified_by": {
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "users"
}
}
},
"type": "api_keys"
}
],
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
],
"meta": {
"max_allowed": "integer",
"page": {
"total_filtered_count": "integer"
}
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Get all API keys returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
# there is a valid "api_key" in the system
API_KEY_DATA_ATTRIBUTES_NAME = ENV["API_KEY_DATA_ATTRIBUTES_NAME"]
opts = {
filter: API_KEY_DATA_ATTRIBUTES_NAME,
}
p api_instance.list_api_keys(opts)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
POST https://api.ap1.datadoghq.com/api/v1/api_keyhttps://api.datadoghq.eu/api/v1/api_keyhttps://api.ddog-gov.com/api/v1/api_keyhttps://api.datadoghq.com/api/v1/api_keyhttps://api.us3.datadoghq.com/api/v1/api_keyhttps://api.us5.datadoghq.com/api/v1/api_key
Creates an API key with a given name.
This endpoint requires the api_keys_write
permission.
{
"name": "example user"
}
OK
An API key with its associated metadata.
항목
유형
설명
api_key
object
Datadog API key.
created
string
Date of creation of the API key.
created_by
string
Datadog user handle that created the API key.
key
string
API key.
name
string
Name of your API key.
{
"api_key": {
"created": "2019-08-02 15:31:07",
"created_by": "john@example.com",
"key": "1234512345123456abcabc912349abcd",
"name": "example user"
}
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Create an API key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
body = DatadogAPIClient::V1::ApiKey.new({
name: "example user",
})
p api_instance.create_api_key(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
POST https://api.ap1.datadoghq.com/api/v2/api_keyshttps://api.datadoghq.eu/api/v2/api_keyshttps://api.ddog-gov.com/api/v2/api_keyshttps://api.datadoghq.com/api/v2/api_keyshttps://api.us3.datadoghq.com/api/v2/api_keyshttps://api.us5.datadoghq.com/api/v2/api_keys
Create an API key.
This endpoint requires the api_keys_write
permission.
항목
유형
설명
data [required]
object
Object used to create an API key.
attributes [required]
object
Attributes used to create an API Key.
category
string
The APIKeyCreateAttributes category.
name [required]
string
Name of the API key.
remote_config_read_enabled
boolean
The APIKeyCreateAttributes remote_config_read_enabled.
type [required]
enum
API Keys resource type.
Allowed enum values: api_keys
default: api_keys
{
"data": {
"type": "api_keys",
"attributes": {
"name": "Example-Key-Management"
}
}
}
Created
Response for retrieving an API key.
항목
유형
설명
data
object
Datadog API key.
attributes
object
Attributes of a full API key.
category
string
The category of the API key.
created_at
date-time
Creation date of the API key.
key
string
The API key.
last4
string
The last four characters of the API key.
modified_at
date-time
Date the API key was last modified.
name
string
Name of the API key.
remote_config_read_enabled
boolean
The remote config read enabled status.
id
string
ID of the API key.
relationships
object
Resources related to the API key.
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
API Keys resource type.
Allowed enum values: api_keys
default: api_keys
included
[ <oneOf>]
Array of objects related to the API key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
{
"data": {
"attributes": {
"category": "string",
"created_at": "2020-11-23T10:00:00.000Z",
"key": "string",
"last4": "abcd",
"modified_at": "2020-11-23T10:00:00.000Z",
"name": "API Key for submitting metrics",
"remote_config_read_enabled": false
},
"id": "string",
"relationships": {
"created_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
},
"modified_by": {
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "users"
}
}
},
"type": "api_keys"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Create an API key returns "Created" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
body = DatadogAPIClient::V2::APIKeyCreateRequest.new({
data: DatadogAPIClient::V2::APIKeyCreateData.new({
type: DatadogAPIClient::V2::APIKeysType::API_KEYS,
attributes: DatadogAPIClient::V2::APIKeyCreateAttributes.new({
name: "Example-Key-Management",
}),
}),
})
p api_instance.create_api_key(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
PATCH https://api.ap1.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}https://api.datadoghq.eu/api/v2/current_user/application_keys/{app_key_id}https://api.ddog-gov.com/api/v2/current_user/application_keys/{app_key_id}https://api.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}https://api.us3.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}https://api.us5.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}
Edit an application key owned by current user
This endpoint requires the user_app_keys
permission.
이름
유형
설명
app_key_id [required]
string
The ID of the application key.
항목
유형
설명
data [required]
object
Object used to update an application key.
attributes [required]
object
Attributes used to update an application Key.
name
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
id [required]
string
ID of the application key.
type [required]
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
{
"data": {
"id": "string",
"type": "application_keys",
"attributes": {
"name": "Application Key for managing dashboards-updated"
}
}
}
OK
Response for retrieving an application key.
항목
유형
설명
data
object
Datadog application key.
attributes
object
Attributes of a full application key.
created_at
date-time
Creation date of the application key.
key
string
The application key.
last4
string
The last four characters of the application key.
name
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
id
string
ID of the application key.
relationships
object
Resources related to the application key.
owned_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
included
[ <oneOf>]
Array of objects related to the application key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
Option 3
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
{
"data": {
"attributes": {
"created_at": "2020-11-23T10:00:00.000Z",
"key": "string",
"last4": "abcd",
"name": "Application Key for managing dashboards",
"scopes": [
"dashboards_read",
"dashboards_write",
"dashboards_public_share"
]
},
"id": "string",
"relationships": {
"owned_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "application_keys"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Edit an application key owned by current user returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
# there is a valid "application_key" in the system
APPLICATION_KEY_DATA_ATTRIBUTES_NAME = ENV["APPLICATION_KEY_DATA_ATTRIBUTES_NAME"]
APPLICATION_KEY_DATA_ID = ENV["APPLICATION_KEY_DATA_ID"]
body = DatadogAPIClient::V2::ApplicationKeyUpdateRequest.new({
data: DatadogAPIClient::V2::ApplicationKeyUpdateData.new({
id: APPLICATION_KEY_DATA_ID,
type: DatadogAPIClient::V2::ApplicationKeysType::APPLICATION_KEYS,
attributes: DatadogAPIClient::V2::ApplicationKeyUpdateAttributes.new({
name: "Application Key for managing dashboards-updated",
}),
}),
})
p api_instance.update_current_user_application_key(APPLICATION_KEY_DATA_ID, body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v1/api_key/{key}https://api.datadoghq.eu/api/v1/api_key/{key}https://api.ddog-gov.com/api/v1/api_key/{key}https://api.datadoghq.com/api/v1/api_key/{key}https://api.us3.datadoghq.com/api/v1/api_key/{key}https://api.us5.datadoghq.com/api/v1/api_key/{key}
Get a given API key.
This endpoint requires the api_keys_read
permission.
이름
유형
설명
key [required]
string
The specific API key you are working with.
OK
An API key with its associated metadata.
항목
유형
설명
api_key
object
Datadog API key.
created
string
Date of creation of the API key.
created_by
string
Datadog user handle that created the API key.
key
string
API key.
name
string
Name of your API key.
{
"api_key": {
"created": "2019-08-02 15:31:07",
"created_by": "john@example.com",
"key": "1234512345123456abcabc912349abcd",
"name": "example user"
}
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Get API key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
p api_instance.get_api_key("key")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v2/api_keys/{api_key_id}https://api.datadoghq.eu/api/v2/api_keys/{api_key_id}https://api.ddog-gov.com/api/v2/api_keys/{api_key_id}https://api.datadoghq.com/api/v2/api_keys/{api_key_id}https://api.us3.datadoghq.com/api/v2/api_keys/{api_key_id}https://api.us5.datadoghq.com/api/v2/api_keys/{api_key_id}
Get an API key.
This endpoint requires the api_keys_read
permission.
이름
유형
설명
api_key_id [required]
string
The ID of the API key.
이름
유형
설명
include
string
Comma separated list of resource paths for related resources to include in the response. Supported resource paths are created_by
and modified_by
.
OK
Response for retrieving an API key.
항목
유형
설명
data
object
Datadog API key.
attributes
object
Attributes of a full API key.
category
string
The category of the API key.
created_at
date-time
Creation date of the API key.
key
string
The API key.
last4
string
The last four characters of the API key.
modified_at
date-time
Date the API key was last modified.
name
string
Name of the API key.
remote_config_read_enabled
boolean
The remote config read enabled status.
id
string
ID of the API key.
relationships
object
Resources related to the API key.
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
API Keys resource type.
Allowed enum values: api_keys
default: api_keys
included
[ <oneOf>]
Array of objects related to the API key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
{
"data": {
"attributes": {
"category": "string",
"created_at": "2020-11-23T10:00:00.000Z",
"key": "string",
"last4": "abcd",
"modified_at": "2020-11-23T10:00:00.000Z",
"name": "API Key for submitting metrics",
"remote_config_read_enabled": false
},
"id": "string",
"relationships": {
"created_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
},
"modified_by": {
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "users"
}
}
},
"type": "api_keys"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Get API key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
# there is a valid "api_key" in the system
API_KEY_DATA_ID = ENV["API_KEY_DATA_ID"]
p api_instance.get_api_key(API_KEY_DATA_ID)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}https://api.datadoghq.eu/api/v2/current_user/application_keys/{app_key_id}https://api.ddog-gov.com/api/v2/current_user/application_keys/{app_key_id}https://api.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}https://api.us3.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}https://api.us5.datadoghq.com/api/v2/current_user/application_keys/{app_key_id}
Get an application key owned by current user
This endpoint requires the user_app_keys
permission.
이름
유형
설명
app_key_id [required]
string
The ID of the application key.
OK
Response for retrieving an application key.
항목
유형
설명
data
object
Datadog application key.
attributes
object
Attributes of a full application key.
created_at
date-time
Creation date of the application key.
key
string
The application key.
last4
string
The last four characters of the application key.
name
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
id
string
ID of the application key.
relationships
object
Resources related to the application key.
owned_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
included
[ <oneOf>]
Array of objects related to the application key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
Option 3
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
{
"data": {
"attributes": {
"created_at": "2020-11-23T10:00:00.000Z",
"key": "string",
"last4": "abcd",
"name": "Application Key for managing dashboards",
"scopes": [
"dashboards_read",
"dashboards_write",
"dashboards_public_share"
]
},
"id": "string",
"relationships": {
"owned_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "application_keys"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Get one application key owned by current user returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
p api_instance.get_current_user_application_key("app_key_id")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
POST https://api.ap1.datadoghq.com/api/v2/current_user/application_keyshttps://api.datadoghq.eu/api/v2/current_user/application_keyshttps://api.ddog-gov.com/api/v2/current_user/application_keyshttps://api.datadoghq.com/api/v2/current_user/application_keyshttps://api.us3.datadoghq.com/api/v2/current_user/application_keyshttps://api.us5.datadoghq.com/api/v2/current_user/application_keys
Create an application key for current user
This endpoint requires the user_app_keys
permission.
항목
유형
설명
data [required]
object
Object used to create an application key.
attributes [required]
object
Attributes used to create an application Key.
name [required]
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
type [required]
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
{
"data": {
"type": "application_keys",
"attributes": {
"name": "Example-Key-Management",
"scopes": [
"dashboards_read",
"dashboards_write",
"dashboards_public_share"
]
}
}
}
{
"data": {
"type": "application_keys",
"attributes": {
"name": "Example-Key-Management"
}
}
}
Created
Response for retrieving an application key.
항목
유형
설명
data
object
Datadog application key.
attributes
object
Attributes of a full application key.
created_at
date-time
Creation date of the application key.
key
string
The application key.
last4
string
The last four characters of the application key.
name
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
id
string
ID of the application key.
relationships
object
Resources related to the application key.
owned_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
included
[ <oneOf>]
Array of objects related to the application key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
Option 3
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
{
"data": {
"attributes": {
"created_at": "2020-11-23T10:00:00.000Z",
"key": "string",
"last4": "abcd",
"name": "Application Key for managing dashboards",
"scopes": [
"dashboards_read",
"dashboards_write",
"dashboards_public_share"
]
},
"id": "string",
"relationships": {
"owned_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "application_keys"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Create an Application key with scopes for current user returns "Created" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
body = DatadogAPIClient::V2::ApplicationKeyCreateRequest.new({
data: DatadogAPIClient::V2::ApplicationKeyCreateData.new({
type: DatadogAPIClient::V2::ApplicationKeysType::APPLICATION_KEYS,
attributes: DatadogAPIClient::V2::ApplicationKeyCreateAttributes.new({
name: "Example-Key-Management",
scopes: [
"dashboards_read",
"dashboards_write",
"dashboards_public_share",
],
}),
}),
})
p api_instance.create_current_user_application_key(body)
# Create an application key for current user returns "Created" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
body = DatadogAPIClient::V2::ApplicationKeyCreateRequest.new({
data: DatadogAPIClient::V2::ApplicationKeyCreateData.new({
type: DatadogAPIClient::V2::ApplicationKeysType::APPLICATION_KEYS,
attributes: DatadogAPIClient::V2::ApplicationKeyCreateAttributes.new({
name: "Example-Key-Management",
}),
}),
})
p api_instance.create_current_user_application_key(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
PUT https://api.ap1.datadoghq.com/api/v1/api_key/{key}https://api.datadoghq.eu/api/v1/api_key/{key}https://api.ddog-gov.com/api/v1/api_key/{key}https://api.datadoghq.com/api/v1/api_key/{key}https://api.us3.datadoghq.com/api/v1/api_key/{key}https://api.us5.datadoghq.com/api/v1/api_key/{key}
Edit an API key name.
This endpoint requires the api_keys_write
permission.
이름
유형
설명
key [required]
string
The specific API key you are working with.
{
"name": "example user"
}
OK
An API key with its associated metadata.
항목
유형
설명
api_key
object
Datadog API key.
created
string
Date of creation of the API key.
created_by
string
Datadog user handle that created the API key.
key
string
API key.
name
string
Name of your API key.
{
"api_key": {
"created": "2019-08-02 15:31:07",
"created_by": "john@example.com",
"key": "1234512345123456abcabc912349abcd",
"name": "example user"
}
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Edit an API key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
body = DatadogAPIClient::V1::ApiKey.new({
name: "example user",
})
p api_instance.update_api_key("key", body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
PATCH https://api.ap1.datadoghq.com/api/v2/api_keys/{api_key_id}https://api.datadoghq.eu/api/v2/api_keys/{api_key_id}https://api.ddog-gov.com/api/v2/api_keys/{api_key_id}https://api.datadoghq.com/api/v2/api_keys/{api_key_id}https://api.us3.datadoghq.com/api/v2/api_keys/{api_key_id}https://api.us5.datadoghq.com/api/v2/api_keys/{api_key_id}
Update an API key.
This endpoint requires the api_keys_write
permission.
이름
유형
설명
api_key_id [required]
string
The ID of the API key.
항목
유형
설명
data [required]
object
Object used to update an API key.
attributes [required]
object
Attributes used to update an API Key.
category
string
The APIKeyUpdateAttributes category.
name [required]
string
Name of the API key.
remote_config_read_enabled
boolean
The APIKeyUpdateAttributes remote_config_read_enabled.
id [required]
string
ID of the API key.
type [required]
enum
API Keys resource type.
Allowed enum values: api_keys
default: api_keys
{
"data": {
"type": "api_keys",
"id": "string",
"attributes": {
"name": "Example-Key-Management"
}
}
}
OK
Response for retrieving an API key.
항목
유형
설명
data
object
Datadog API key.
attributes
object
Attributes of a full API key.
category
string
The category of the API key.
created_at
date-time
Creation date of the API key.
key
string
The API key.
last4
string
The last four characters of the API key.
modified_at
date-time
Date the API key was last modified.
name
string
Name of the API key.
remote_config_read_enabled
boolean
The remote config read enabled status.
id
string
ID of the API key.
relationships
object
Resources related to the API key.
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
API Keys resource type.
Allowed enum values: api_keys
default: api_keys
included
[ <oneOf>]
Array of objects related to the API key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
{
"data": {
"attributes": {
"category": "string",
"created_at": "2020-11-23T10:00:00.000Z",
"key": "string",
"last4": "abcd",
"modified_at": "2020-11-23T10:00:00.000Z",
"name": "API Key for submitting metrics",
"remote_config_read_enabled": false
},
"id": "string",
"relationships": {
"created_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
},
"modified_by": {
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "users"
}
}
},
"type": "api_keys"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Edit an API key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
# there is a valid "api_key" in the system
API_KEY_DATA_ID = ENV["API_KEY_DATA_ID"]
body = DatadogAPIClient::V2::APIKeyUpdateRequest.new({
data: DatadogAPIClient::V2::APIKeyUpdateData.new({
type: DatadogAPIClient::V2::APIKeysType::API_KEYS,
id: API_KEY_DATA_ID,
attributes: DatadogAPIClient::V2::APIKeyUpdateAttributes.new({
name: "Example-Key-Management",
}),
}),
})
p api_instance.update_api_key(API_KEY_DATA_ID, body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
DELETE https://api.ap1.datadoghq.com/api/v1/api_key/{key}https://api.datadoghq.eu/api/v1/api_key/{key}https://api.ddog-gov.com/api/v1/api_key/{key}https://api.datadoghq.com/api/v1/api_key/{key}https://api.us3.datadoghq.com/api/v1/api_key/{key}https://api.us5.datadoghq.com/api/v1/api_key/{key}
Delete a given API key.
This endpoint requires the api_keys_delete
permission.
이름
유형
설명
key [required]
string
The specific API key you are working with.
OK
An API key with its associated metadata.
항목
유형
설명
api_key
object
Datadog API key.
created
string
Date of creation of the API key.
created_by
string
Datadog user handle that created the API key.
key
string
API key.
name
string
Name of your API key.
{
"api_key": {
"created": "2019-08-02 15:31:07",
"created_by": "john@example.com",
"key": "1234512345123456abcabc912349abcd",
"name": "example user"
}
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Delete an API key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
p api_instance.delete_api_key("key")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
DELETE https://api.ap1.datadoghq.com/api/v2/api_keys/{api_key_id}https://api.datadoghq.eu/api/v2/api_keys/{api_key_id}https://api.ddog-gov.com/api/v2/api_keys/{api_key_id}https://api.datadoghq.com/api/v2/api_keys/{api_key_id}https://api.us3.datadoghq.com/api/v2/api_keys/{api_key_id}https://api.us5.datadoghq.com/api/v2/api_keys/{api_key_id}
Delete an API key.
This endpoint requires the api_keys_delete
permission.
이름
유형
설명
api_key_id [required]
string
The ID of the API key.
No Content
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Delete an API key returns "No Content" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
# there is a valid "api_key" in the system
API_KEY_DATA_ID = ENV["API_KEY_DATA_ID"]
api_instance.delete_api_key(API_KEY_DATA_ID)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v2/current_user/application_keyshttps://api.datadoghq.eu/api/v2/current_user/application_keyshttps://api.ddog-gov.com/api/v2/current_user/application_keyshttps://api.datadoghq.com/api/v2/current_user/application_keyshttps://api.us3.datadoghq.com/api/v2/current_user/application_keyshttps://api.us5.datadoghq.com/api/v2/current_user/application_keys
List all application keys available for current user
This endpoint requires the user_app_keys
permission.
이름
유형
설명
page[size]
integer
Size for a given page. The maximum allowed value is 100.
page[number]
integer
Specific page number to return.
sort
enum
Application key attribute used to sort results. Sort order is ascending
by default. In order to specify a descending sort, prefix the
attribute with a minus sign.
Allowed enum values: created_at, -created_at, last4, -last4, name, -name
filter
string
Filter application keys by the specified string.
filter[created_at][start]
string
Only include application keys created on or after the specified date.
filter[created_at][end]
string
Only include application keys created on or before the specified date.
include
string
Resource path for related resources to include in the response. Only owned_by
is supported.
OK
Response for a list of application keys.
항목
유형
설명
data
[object]
Array of application keys.
attributes
object
Attributes of a partial application key.
created_at
string
Creation date of the application key.
last4
string
The last four characters of the application key.
name
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
id
string
ID of the application key.
relationships
object
Resources related to the application key.
owned_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
included
[ <oneOf>]
Array of objects related to the application key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
Option 3
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
meta
object
Additional information related to the application key response.
max_allowed_per_user
int64
Max allowed number of application keys per user.
page
object
Additional information related to the application key response.
total_filtered_count
int64
Total filtered application key count.
{
"data": [
{
"attributes": {
"created_at": "2020-11-23T10:00:00.000Z",
"last4": "abcd",
"name": "Application Key for managing dashboards",
"scopes": [
"dashboards_read",
"dashboards_write",
"dashboards_public_share"
]
},
"id": "string",
"relationships": {
"owned_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "application_keys"
}
],
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
],
"meta": {
"max_allowed_per_user": "integer",
"page": {
"total_filtered_count": "integer"
}
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Get all application keys owned by current user returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
p api_instance.list_current_user_application_keys()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v1/application_keyhttps://api.datadoghq.eu/api/v1/application_keyhttps://api.ddog-gov.com/api/v1/application_keyhttps://api.datadoghq.com/api/v1/application_keyhttps://api.us3.datadoghq.com/api/v1/application_keyhttps://api.us5.datadoghq.com/api/v1/application_key
Get all application keys available for your Datadog account. This endpoint requires any of the following permissions:
org_app_keys_read
user_app_keys
OK
An application key response.
항목
유형
설명
application_keys
[object]
Array of application keys.
hash
string
Hash of an application key.
name
string
Name of an application key.
owner
string
Owner of an application key.
{
"application_keys": [
{
"hash": "1234512345123459cda4eb9ced49a3d84fd0138c",
"name": "example user",
"owner": "example.com"
}
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Get all application keys returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
p api_instance.list_application_keys()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v2/application_keyshttps://api.datadoghq.eu/api/v2/application_keyshttps://api.ddog-gov.com/api/v2/application_keyshttps://api.datadoghq.com/api/v2/application_keyshttps://api.us3.datadoghq.com/api/v2/application_keyshttps://api.us5.datadoghq.com/api/v2/application_keys
List all application keys available for your org
This endpoint requires the org_app_keys_read
permission.
이름
유형
설명
page[size]
integer
Size for a given page. The maximum allowed value is 100.
page[number]
integer
Specific page number to return.
sort
enum
Application key attribute used to sort results. Sort order is ascending
by default. In order to specify a descending sort, prefix the
attribute with a minus sign.
Allowed enum values: created_at, -created_at, last4, -last4, name, -name
filter
string
Filter application keys by the specified string.
filter[created_at][start]
string
Only include application keys created on or after the specified date.
filter[created_at][end]
string
Only include application keys created on or before the specified date.
include
string
Resource path for related resources to include in the response. Only owned_by
is supported.
OK
Response for a list of application keys.
항목
유형
설명
data
[object]
Array of application keys.
attributes
object
Attributes of a partial application key.
created_at
string
Creation date of the application key.
last4
string
The last four characters of the application key.
name
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
id
string
ID of the application key.
relationships
object
Resources related to the application key.
owned_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
included
[ <oneOf>]
Array of objects related to the application key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
Option 3
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
meta
object
Additional information related to the application key response.
max_allowed_per_user
int64
Max allowed number of application keys per user.
page
object
Additional information related to the application key response.
total_filtered_count
int64
Total filtered application key count.
{
"data": [
{
"attributes": {
"created_at": "2020-11-23T10:00:00.000Z",
"last4": "abcd",
"name": "Application Key for managing dashboards",
"scopes": [
"dashboards_read",
"dashboards_write",
"dashboards_public_share"
]
},
"id": "string",
"relationships": {
"owned_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "application_keys"
}
],
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
],
"meta": {
"max_allowed_per_user": "integer",
"page": {
"total_filtered_count": "integer"
}
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Get all application keys returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
p api_instance.list_application_keys()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
POST https://api.ap1.datadoghq.com/api/v1/application_keyhttps://api.datadoghq.eu/api/v1/application_keyhttps://api.ddog-gov.com/api/v1/application_keyhttps://api.datadoghq.com/api/v1/application_keyhttps://api.us3.datadoghq.com/api/v1/application_keyhttps://api.us5.datadoghq.com/api/v1/application_key
Create an application key with a given name.
This endpoint requires the user_app_keys
permission.
{
"name": "example user"
}
OK
An application key response.
항목
유형
설명
application_key
object
An application key with its associated metadata.
hash
string
Hash of an application key.
name
string
Name of an application key.
owner
string
Owner of an application key.
{
"application_key": {
"hash": "1234512345123459cda4eb9ced49a3d84fd0138c",
"name": "example user",
"owner": "example.com"
}
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Conflict
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Create an application key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
body = DatadogAPIClient::V1::ApplicationKey.new({
name: "example user",
})
p api_instance.create_application_key(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v1/application_key/{key}https://api.datadoghq.eu/api/v1/application_key/{key}https://api.ddog-gov.com/api/v1/application_key/{key}https://api.datadoghq.com/api/v1/application_key/{key}https://api.us3.datadoghq.com/api/v1/application_key/{key}https://api.us5.datadoghq.com/api/v1/application_key/{key}
Get a given application key. This endpoint requires any of the following permissions:
org_app_keys_read
user_app_keys
이름
유형
설명
key [required]
string
The specific APP key you are working with.
OK
An application key response.
항목
유형
설명
application_key
object
An application key with its associated metadata.
hash
string
Hash of an application key.
name
string
Name of an application key.
owner
string
Owner of an application key.
{
"application_key": {
"hash": "1234512345123459cda4eb9ced49a3d84fd0138c",
"name": "example user",
"owner": "example.com"
}
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Get an application key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
p api_instance.get_application_key("key")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
GET https://api.ap1.datadoghq.com/api/v2/application_keys/{app_key_id}https://api.datadoghq.eu/api/v2/application_keys/{app_key_id}https://api.ddog-gov.com/api/v2/application_keys/{app_key_id}https://api.datadoghq.com/api/v2/application_keys/{app_key_id}https://api.us3.datadoghq.com/api/v2/application_keys/{app_key_id}https://api.us5.datadoghq.com/api/v2/application_keys/{app_key_id}
Get an application key for your org.
This endpoint requires the org_app_keys_read
permission.
이름
유형
설명
app_key_id [required]
string
The ID of the application key.
이름
유형
설명
include
string
Resource path for related resources to include in the response. Only owned_by
is supported.
OK
Response for retrieving an application key.
항목
유형
설명
data
object
Datadog application key.
attributes
object
Attributes of a full application key.
created_at
date-time
Creation date of the application key.
key
string
The application key.
last4
string
The last four characters of the application key.
name
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
id
string
ID of the application key.
relationships
object
Resources related to the application key.
owned_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
included
[ <oneOf>]
Array of objects related to the application key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
Option 3
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
{
"data": {
"attributes": {
"created_at": "2020-11-23T10:00:00.000Z",
"key": "string",
"last4": "abcd",
"name": "Application Key for managing dashboards",
"scopes": [
"dashboards_read",
"dashboards_write",
"dashboards_public_share"
]
},
"id": "string",
"relationships": {
"owned_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "application_keys"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Get an application key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
# there is a valid "application_key" in the system
APPLICATION_KEY_DATA_ID = ENV["APPLICATION_KEY_DATA_ID"]
p api_instance.get_application_key(APPLICATION_KEY_DATA_ID)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
PUT https://api.ap1.datadoghq.com/api/v1/application_key/{key}https://api.datadoghq.eu/api/v1/application_key/{key}https://api.ddog-gov.com/api/v1/application_key/{key}https://api.datadoghq.com/api/v1/application_key/{key}https://api.us3.datadoghq.com/api/v1/application_key/{key}https://api.us5.datadoghq.com/api/v1/application_key/{key}
Edit an application key name. This endpoint requires any of the following permissions:
org_app_keys_write
user_app_keys
이름
유형
설명
key [required]
string
The specific APP key you are working with.
{
"name": "example user"
}
OK
An application key response.
항목
유형
설명
application_key
object
An application key with its associated metadata.
hash
string
Hash of an application key.
name
string
Name of an application key.
owner
string
Owner of an application key.
{
"application_key": {
"hash": "1234512345123459cda4eb9ced49a3d84fd0138c",
"name": "example user",
"owner": "example.com"
}
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
Conflict
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Edit an application key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
body = DatadogAPIClient::V1::ApplicationKey.new({
name: "example user",
})
p api_instance.update_application_key("key", body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
PATCH https://api.ap1.datadoghq.com/api/v2/application_keys/{app_key_id}https://api.datadoghq.eu/api/v2/application_keys/{app_key_id}https://api.ddog-gov.com/api/v2/application_keys/{app_key_id}https://api.datadoghq.com/api/v2/application_keys/{app_key_id}https://api.us3.datadoghq.com/api/v2/application_keys/{app_key_id}https://api.us5.datadoghq.com/api/v2/application_keys/{app_key_id}
Edit an application key
This endpoint requires the org_app_keys_write
permission.
이름
유형
설명
app_key_id [required]
string
The ID of the application key.
항목
유형
설명
data [required]
object
Object used to update an application key.
attributes [required]
object
Attributes used to update an application Key.
name
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
id [required]
string
ID of the application key.
type [required]
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
{
"data": {
"id": "string",
"type": "application_keys",
"attributes": {
"name": "Application Key for managing dashboards-updated"
}
}
}
OK
Response for retrieving an application key.
항목
유형
설명
data
object
Datadog application key.
attributes
object
Attributes of a full application key.
created_at
date-time
Creation date of the application key.
key
string
The application key.
last4
string
The last four characters of the application key.
name
string
Name of the application key.
scopes
[string]
Array of scopes to grant the application key.
id
string
ID of the application key.
relationships
object
Resources related to the application key.
owned_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
Application Keys resource type.
Allowed enum values: application_keys
default: application_keys
included
[ <oneOf>]
Array of objects related to the application key.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
Option 3
object
The definition of LeakedKey object.
attributes [required]
object
The definition of LeakedKeyAttributes object.
date [required]
date-time
The LeakedKeyAttributes date.
leak_source
string
The LeakedKeyAttributes leak_source.
id [required]
string
The LeakedKey id.
type [required]
enum
The definition of LeakedKeyType object.
Allowed enum values: leaked_keys
default: leaked_keys
{
"data": {
"attributes": {
"created_at": "2020-11-23T10:00:00.000Z",
"key": "string",
"last4": "abcd",
"name": "Application Key for managing dashboards",
"scopes": [
"dashboards_read",
"dashboards_write",
"dashboards_public_share"
]
},
"id": "string",
"relationships": {
"owned_by": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "application_keys"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Edit an application key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
# there is a valid "application_key" in the system
APPLICATION_KEY_DATA_ATTRIBUTES_NAME = ENV["APPLICATION_KEY_DATA_ATTRIBUTES_NAME"]
APPLICATION_KEY_DATA_ID = ENV["APPLICATION_KEY_DATA_ID"]
body = DatadogAPIClient::V2::ApplicationKeyUpdateRequest.new({
data: DatadogAPIClient::V2::ApplicationKeyUpdateData.new({
id: APPLICATION_KEY_DATA_ID,
type: DatadogAPIClient::V2::ApplicationKeysType::APPLICATION_KEYS,
attributes: DatadogAPIClient::V2::ApplicationKeyUpdateAttributes.new({
name: "Application Key for managing dashboards-updated",
}),
}),
})
p api_instance.update_application_key(APPLICATION_KEY_DATA_ID, body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
DELETE https://api.ap1.datadoghq.com/api/v1/application_key/{key}https://api.datadoghq.eu/api/v1/application_key/{key}https://api.ddog-gov.com/api/v1/application_key/{key}https://api.datadoghq.com/api/v1/application_key/{key}https://api.us3.datadoghq.com/api/v1/application_key/{key}https://api.us5.datadoghq.com/api/v1/application_key/{key}
Delete a given application key. This endpoint requires any of the following permissions:
org_app_keys_write
user_app_keys
이름
유형
설명
key [required]
string
The specific APP key you are working with.
OK
An application key response.
항목
유형
설명
application_key
object
An application key with its associated metadata.
hash
string
Hash of an application key.
name
string
Name of an application key.
owner
string
Owner of an application key.
{
"application_key": {
"hash": "1234512345123459cda4eb9ced49a3d84fd0138c",
"name": "example user",
"owner": "example.com"
}
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Delete an application key returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::KeyManagementAPI.new
p api_instance.delete_application_key("key")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
DELETE https://api.ap1.datadoghq.com/api/v2/application_keys/{app_key_id}https://api.datadoghq.eu/api/v2/application_keys/{app_key_id}https://api.ddog-gov.com/api/v2/application_keys/{app_key_id}https://api.datadoghq.com/api/v2/application_keys/{app_key_id}https://api.us3.datadoghq.com/api/v2/application_keys/{app_key_id}https://api.us5.datadoghq.com/api/v2/application_keys/{app_key_id}
Delete an application key
This endpoint requires the org_app_keys_write
permission.
이름
유형
설명
app_key_id [required]
string
The ID of the application key.
No Content
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Delete an application key returns "No Content" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
# there is a valid "application_key" in the system
APPLICATION_KEY_DATA_ID = ENV["APPLICATION_KEY_DATA_ID"]
api_instance.delete_application_key(APPLICATION_KEY_DATA_ID)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"