Manage your Datadog API and application keys. You need an API key and
an application key for a user with the required permissions to interact
with these endpoints. The full list of API and application keys can be
seen on your Datadog API page.
"""
Delete an application key owned by current user returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApi# there is a valid "application_key" in the systemAPPLICATION_KEY_DATA_ID=environ["APPLICATION_KEY_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)api_instance.delete_current_user_application_key(app_key_id=APPLICATION_KEY_DATA_ID,)
# Delete an application key owned by current user returns "No Content" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.new# there is a valid "application_key" in the systemAPPLICATION_KEY_DATA_ID=ENV["APPLICATION_KEY_DATA_ID"]api_instance.delete_current_user_application_key(APPLICATION_KEY_DATA_ID)
// Delete an application key owned by current user returns "No Content" response
packagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "application_key" in the system
ApplicationKeyDataID:=os.Getenv("APPLICATION_KEY_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)r,err:=api.DeleteCurrentUserApplicationKey(ctx,ApplicationKeyDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.DeleteCurrentUserApplicationKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an application key owned by current user returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);// there is a valid "application_key" in the systemStringAPPLICATION_KEY_DATA_ID=System.getenv("APPLICATION_KEY_DATA_ID");try{apiInstance.deleteCurrentUserApplicationKey(APPLICATION_KEY_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#deleteCurrentUserApplicationKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete an application key owned by current user returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){// there is a valid "application_key" in the system
letapplication_key_data_id=std::env::var("APPLICATION_KEY_DATA_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.delete_current_user_application_key(application_key_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Delete an application key owned by current user returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);// there is a valid "application_key" in the system
constAPPLICATION_KEY_DATA_ID=process.env.APPLICATION_KEY_DATA_IDasstring;constparams: v2.KeyManagementApiDeleteCurrentUserApplicationKeyRequest={appKeyId: APPLICATION_KEY_DATA_ID,};apiInstance.deleteCurrentUserApplicationKey(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get all API keys returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.key_management_apiimportKeyManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.list_api_keys()print(response)
# Get all API keys returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::KeyManagementAPI.newpapi_instance.list_api_keys()
// Get all API keys returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewKeyManagementApi(apiClient)resp,r,err:=api.ListAPIKeys(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.ListAPIKeys`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.ListAPIKeys`:\n%s\n",responseContent)}
// Get all API keys returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.KeyManagementApi;importcom.datadog.api.client.v1.model.ApiKeyListResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);try{ApiKeyListResponseresult=apiInstance.listAPIKeys();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#listAPIKeys");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get all API keys returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.list_api_keys().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get all API keys returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);apiInstance.listAPIKeys().then((data: v1.ApiKeyListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
List all API keys available for your account.
This endpoint requires the api_keys_read permission.
Arguments
Query Strings
Name
Type
Description
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.
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"}}}
"""
Get all API keys returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApi# there is a valid "api_key" in the systemAPI_KEY_DATA_ATTRIBUTES_NAME=environ["API_KEY_DATA_ATTRIBUTES_NAME"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.list_api_keys(filter=API_KEY_DATA_ATTRIBUTES_NAME,)print(response)
# Get all API keys returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.new# there is a valid "api_key" in the systemAPI_KEY_DATA_ATTRIBUTES_NAME=ENV["API_KEY_DATA_ATTRIBUTES_NAME"]opts={filter:API_KEY_DATA_ATTRIBUTES_NAME,}papi_instance.list_api_keys(opts)
// Get all API keys returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "api_key" in the system
APIKeyDataAttributesName:=os.Getenv("API_KEY_DATA_ATTRIBUTES_NAME")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.ListAPIKeys(ctx,*datadogV2.NewListAPIKeysOptionalParameters().WithFilter(APIKeyDataAttributesName))iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.ListAPIKeys`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.ListAPIKeys`:\n%s\n",responseContent)}
// Get all API keys returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.api.KeyManagementApi.ListAPIKeysOptionalParameters;importcom.datadog.api.client.v2.model.APIKeysResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);// there is a valid "api_key" in the systemStringAPI_KEY_DATA_ATTRIBUTES_NAME=System.getenv("API_KEY_DATA_ATTRIBUTES_NAME");try{APIKeysResponseresult=apiInstance.listAPIKeys(newListAPIKeysOptionalParameters().filter(API_KEY_DATA_ATTRIBUTES_NAME));System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#listAPIKeys");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get all API keys returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV2::api_key_management::ListAPIKeysOptionalParams;#[tokio::main]asyncfnmain(){// there is a valid "api_key" in the system
letapi_key_data_attributes_name=std::env::var("API_KEY_DATA_ATTRIBUTES_NAME").unwrap();letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.list_api_keys(ListAPIKeysOptionalParams::default().filter(api_key_data_attributes_name.clone()),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get all API keys returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);// there is a valid "api_key" in the system
constAPI_KEY_DATA_ATTRIBUTES_NAME=process.env.API_KEY_DATA_ATTRIBUTES_NAMEasstring;constparams: v2.KeyManagementApiListAPIKeysRequest={filter: API_KEY_DATA_ATTRIBUTES_NAME,};apiInstance.listAPIKeys(params).then((data: v2.APIKeysResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Create an API key returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.key_management_apiimportKeyManagementApifromdatadog_api_client.v1.model.api_keyimportApiKeybody=ApiKey(name="example user",)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.create_api_key(body=body)print(response)
# Create an API key returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::KeyManagementAPI.newbody=DatadogAPIClient::V1::ApiKey.new({name:"example user",})papi_instance.create_api_key(body)
// Create an API key returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){body:=datadogV1.ApiKey{Name:datadog.PtrString("example user"),}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewKeyManagementApi(apiClient)resp,r,err:=api.CreateAPIKey(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.CreateAPIKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.CreateAPIKey`:\n%s\n",responseContent)}
// Create an API key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV1::model::ApiKey;#[tokio::main]asyncfnmain(){letbody=ApiKey::new().name("example user".to_string());letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.create_api_key(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create an API key returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);constparams: v1.KeyManagementApiCreateAPIKeyRequest={body:{name:"example user",},};apiInstance.createAPIKey(params).then((data: v1.ApiKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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"}]}
// Create an API key returns "Created" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){body:=datadogV2.APIKeyCreateRequest{Data:datadogV2.APIKeyCreateData{Type:datadogV2.APIKEYSTYPE_API_KEYS,Attributes:datadogV2.APIKeyCreateAttributes{Name:"Example-Key-Management",},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.CreateAPIKey(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.CreateAPIKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.CreateAPIKey`:\n%s\n",responseContent)}
"""
Create an API key returns "Created" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApifromdatadog_api_client.v2.model.api_key_create_attributesimportAPIKeyCreateAttributesfromdatadog_api_client.v2.model.api_key_create_dataimportAPIKeyCreateDatafromdatadog_api_client.v2.model.api_key_create_requestimportAPIKeyCreateRequestfromdatadog_api_client.v2.model.api_keys_typeimportAPIKeysTypebody=APIKeyCreateRequest(data=APIKeyCreateData(type=APIKeysType.API_KEYS,attributes=APIKeyCreateAttributes(name="Example-Key-Management",),),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.create_api_key(body=body)print(response)
# Create an API key returns "Created" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.newbody=DatadogAPIClient::V2::APIKeyCreateRequest.new({data:DatadogAPIClient::V2::APIKeyCreateData.new({type:DatadogAPIClient::V2::APIKeysType::API_KEYS,attributes:DatadogAPIClient::V2::APIKeyCreateAttributes.new({name:"Example-Key-Management",}),}),})papi_instance.create_api_key(body)
// Create an API key returns "Created" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV2::model::APIKeyCreateAttributes;usedatadog_api_client::datadogV2::model::APIKeyCreateData;usedatadog_api_client::datadogV2::model::APIKeyCreateRequest;usedatadog_api_client::datadogV2::model::APIKeysType;#[tokio::main]asyncfnmain(){letbody=APIKeyCreateRequest::new(APIKeyCreateData::new(APIKeyCreateAttributes::new("Example-Key-Management".to_string()),APIKeysType::API_KEYS,));letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.create_api_key(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create an API key returns "Created" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);constparams: v2.KeyManagementApiCreateAPIKeyRequest={body:{data:{type:"api_keys",attributes:{name:"Example-Key-Management",},},},};apiInstance.createAPIKey(params).then((data: v2.APIKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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"}]}
// Edit an application key owned by current user returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "application_key" in the system
ApplicationKeyDataID:=os.Getenv("APPLICATION_KEY_DATA_ID")body:=datadogV2.ApplicationKeyUpdateRequest{Data:datadogV2.ApplicationKeyUpdateData{Id:ApplicationKeyDataID,Type:datadogV2.APPLICATIONKEYSTYPE_APPLICATION_KEYS,Attributes:datadogV2.ApplicationKeyUpdateAttributes{Name:datadog.PtrString("Application Key for managing dashboards-updated"),},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.UpdateCurrentUserApplicationKey(ctx,ApplicationKeyDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.UpdateCurrentUserApplicationKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.UpdateCurrentUserApplicationKey`:\n%s\n",responseContent)}
// Edit an application key owned by current user returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.model.ApplicationKeyResponse;importcom.datadog.api.client.v2.model.ApplicationKeyUpdateAttributes;importcom.datadog.api.client.v2.model.ApplicationKeyUpdateData;importcom.datadog.api.client.v2.model.ApplicationKeyUpdateRequest;importcom.datadog.api.client.v2.model.ApplicationKeysType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);// there is a valid "application_key" in the systemStringAPPLICATION_KEY_DATA_ATTRIBUTES_NAME=System.getenv("APPLICATION_KEY_DATA_ATTRIBUTES_NAME");StringAPPLICATION_KEY_DATA_ID=System.getenv("APPLICATION_KEY_DATA_ID");ApplicationKeyUpdateRequestbody=newApplicationKeyUpdateRequest().data(newApplicationKeyUpdateData().id(APPLICATION_KEY_DATA_ID).type(ApplicationKeysType.APPLICATION_KEYS).attributes(newApplicationKeyUpdateAttributes().name("Application Key for managing dashboards-updated")));try{ApplicationKeyResponseresult=apiInstance.updateCurrentUserApplicationKey(APPLICATION_KEY_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#updateCurrentUserApplicationKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Edit an application key owned by current user returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApifromdatadog_api_client.v2.model.application_key_update_attributesimportApplicationKeyUpdateAttributesfromdatadog_api_client.v2.model.application_key_update_dataimportApplicationKeyUpdateDatafromdatadog_api_client.v2.model.application_key_update_requestimportApplicationKeyUpdateRequestfromdatadog_api_client.v2.model.application_keys_typeimportApplicationKeysType# there is a valid "application_key" in the systemAPPLICATION_KEY_DATA_ATTRIBUTES_NAME=environ["APPLICATION_KEY_DATA_ATTRIBUTES_NAME"]APPLICATION_KEY_DATA_ID=environ["APPLICATION_KEY_DATA_ID"]body=ApplicationKeyUpdateRequest(data=ApplicationKeyUpdateData(id=APPLICATION_KEY_DATA_ID,type=ApplicationKeysType.APPLICATION_KEYS,attributes=ApplicationKeyUpdateAttributes(name="Application Key for managing dashboards-updated",),),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.update_current_user_application_key(app_key_id=APPLICATION_KEY_DATA_ID,body=body)print(response)
# Edit an application key owned by current user returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.new# there is a valid "application_key" in the systemAPPLICATION_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",}),}),})papi_instance.update_current_user_application_key(APPLICATION_KEY_DATA_ID,body)
// Edit an application key owned by current user returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV2::model::ApplicationKeyUpdateAttributes;usedatadog_api_client::datadogV2::model::ApplicationKeyUpdateData;usedatadog_api_client::datadogV2::model::ApplicationKeyUpdateRequest;usedatadog_api_client::datadogV2::model::ApplicationKeysType;#[tokio::main]asyncfnmain(){// there is a valid "application_key" in the system
letapplication_key_data_id=std::env::var("APPLICATION_KEY_DATA_ID").unwrap();letbody=ApplicationKeyUpdateRequest::new(ApplicationKeyUpdateData::new(ApplicationKeyUpdateAttributes::new().name("Application Key for managing dashboards-updated".to_string()),application_key_data_id.clone(),ApplicationKeysType::APPLICATION_KEYS,));letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.update_current_user_application_key(application_key_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Edit an application key owned by current user returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);// there is a valid "application_key" in the system
constAPPLICATION_KEY_DATA_ID=process.env.APPLICATION_KEY_DATA_IDasstring;constparams: v2.KeyManagementApiUpdateCurrentUserApplicationKeyRequest={body:{data:{id: APPLICATION_KEY_DATA_ID,type:"application_keys",attributes:{name:"Application Key for managing dashboards-updated",},},},appKeyId: APPLICATION_KEY_DATA_ID,};apiInstance.updateCurrentUserApplicationKey(params).then((data: v2.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get API key returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.key_management_apiimportKeyManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.get_api_key(key="key",)print(response)
// Get API key returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewKeyManagementApi(apiClient)resp,r,err:=api.GetAPIKey(ctx,"key")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.GetAPIKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.GetAPIKey`:\n%s\n",responseContent)}
// Get API key returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.KeyManagementApi;importcom.datadog.api.client.v1.model.ApiKeyResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);try{ApiKeyResponseresult=apiInstance.getAPIKey("key");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#getAPIKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get API key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.get_api_key("key".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get API key returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);constparams: v1.KeyManagementApiGetAPIKeyRequest={key:"key",};apiInstance.getAPIKey(params).then((data: v1.ApiKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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"}]}
"""
Get API key returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApi# there is a valid "api_key" in the systemAPI_KEY_DATA_ID=environ["API_KEY_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.get_api_key(api_key_id=API_KEY_DATA_ID,)print(response)
# Get API key returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.new# there is a valid "api_key" in the systemAPI_KEY_DATA_ID=ENV["API_KEY_DATA_ID"]papi_instance.get_api_key(API_KEY_DATA_ID)
// Get API key returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "api_key" in the system
APIKeyDataID:=os.Getenv("API_KEY_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.GetAPIKey(ctx,APIKeyDataID,*datadogV2.NewGetAPIKeyOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.GetAPIKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.GetAPIKey`:\n%s\n",responseContent)}
// Get API key returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.model.APIKeyResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);// there is a valid "api_key" in the systemStringAPI_KEY_DATA_ID=System.getenv("API_KEY_DATA_ID");try{APIKeyResponseresult=apiInstance.getAPIKey(API_KEY_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#getAPIKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get API key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::GetAPIKeyOptionalParams;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){// there is a valid "api_key" in the system
letapi_key_data_id=std::env::var("API_KEY_DATA_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.get_api_key(api_key_data_id.clone(),GetAPIKeyOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get API key returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);// there is a valid "api_key" in the system
constAPI_KEY_DATA_ID=process.env.API_KEY_DATA_IDasstring;constparams: v2.KeyManagementApiGetAPIKeyRequest={apiKeyId: API_KEY_DATA_ID,};apiInstance.getAPIKey(params).then((data: v2.APIKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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"}]}
"""
Get one application key owned by current user returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.get_current_user_application_key(app_key_id="app_key_id",)print(response)
# Get one application key owned by current user returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.newpapi_instance.get_current_user_application_key("app_key_id")
// Get one application key owned by current user returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.GetCurrentUserApplicationKey(ctx,"app_key_id")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.GetCurrentUserApplicationKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.GetCurrentUserApplicationKey`:\n%s\n",responseContent)}
// Get one application key owned by current user returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.model.ApplicationKeyResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);try{ApplicationKeyResponseresult=apiInstance.getCurrentUserApplicationKey("app_key_id");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#getCurrentUserApplicationKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get one application key owned by current user returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.get_current_user_application_key("app_key_id".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get one application key owned by current user returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);constparams: v2.KeyManagementApiGetCurrentUserApplicationKeyRequest={appKeyId:"app_key_id",};apiInstance.getCurrentUserApplicationKey(params).then((data: v2.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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"}]}
// Create an Application key with scopes for current user returns "Created" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){body:=datadogV2.ApplicationKeyCreateRequest{Data:datadogV2.ApplicationKeyCreateData{Type:datadogV2.APPLICATIONKEYSTYPE_APPLICATION_KEYS,Attributes:datadogV2.ApplicationKeyCreateAttributes{Name:"Example-Key-Management",Scopes:*datadog.NewNullableList(&[]string{"dashboards_read","dashboards_write","dashboards_public_share",}),},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.CreateCurrentUserApplicationKey(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.CreateCurrentUserApplicationKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.CreateCurrentUserApplicationKey`:\n%s\n",responseContent)}
// Create an application key for current user returns "Created" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){body:=datadogV2.ApplicationKeyCreateRequest{Data:datadogV2.ApplicationKeyCreateData{Type:datadogV2.APPLICATIONKEYSTYPE_APPLICATION_KEYS,Attributes:datadogV2.ApplicationKeyCreateAttributes{Name:"Example-Key-Management",},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.CreateCurrentUserApplicationKey(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.CreateCurrentUserApplicationKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.CreateCurrentUserApplicationKey`:\n%s\n",responseContent)}
// Create an Application key with scopes for current user returns "Created" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.model.ApplicationKeyCreateAttributes;importcom.datadog.api.client.v2.model.ApplicationKeyCreateData;importcom.datadog.api.client.v2.model.ApplicationKeyCreateRequest;importcom.datadog.api.client.v2.model.ApplicationKeyResponse;importcom.datadog.api.client.v2.model.ApplicationKeysType;importjava.util.Arrays;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);ApplicationKeyCreateRequestbody=newApplicationKeyCreateRequest().data(newApplicationKeyCreateData().type(ApplicationKeysType.APPLICATION_KEYS).attributes(newApplicationKeyCreateAttributes().name("Example-Key-Management").scopes(Arrays.asList("dashboards_read","dashboards_write","dashboards_public_share"))));try{ApplicationKeyResponseresult=apiInstance.createCurrentUserApplicationKey(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#createCurrentUserApplicationKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Create an application key for current user returns "Created" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.model.ApplicationKeyCreateAttributes;importcom.datadog.api.client.v2.model.ApplicationKeyCreateData;importcom.datadog.api.client.v2.model.ApplicationKeyCreateRequest;importcom.datadog.api.client.v2.model.ApplicationKeyResponse;importcom.datadog.api.client.v2.model.ApplicationKeysType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);ApplicationKeyCreateRequestbody=newApplicationKeyCreateRequest().data(newApplicationKeyCreateData().type(ApplicationKeysType.APPLICATION_KEYS).attributes(newApplicationKeyCreateAttributes().name("Example-Key-Management")));try{ApplicationKeyResponseresult=apiInstance.createCurrentUserApplicationKey(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#createCurrentUserApplicationKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create an Application key with scopes for current user returns "Created" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApifromdatadog_api_client.v2.model.application_key_create_attributesimportApplicationKeyCreateAttributesfromdatadog_api_client.v2.model.application_key_create_dataimportApplicationKeyCreateDatafromdatadog_api_client.v2.model.application_key_create_requestimportApplicationKeyCreateRequestfromdatadog_api_client.v2.model.application_keys_typeimportApplicationKeysTypebody=ApplicationKeyCreateRequest(data=ApplicationKeyCreateData(type=ApplicationKeysType.APPLICATION_KEYS,attributes=ApplicationKeyCreateAttributes(name="Example-Key-Management",scopes=["dashboards_read","dashboards_write","dashboards_public_share",],),),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.create_current_user_application_key(body=body)print(response)
"""
Create an application key for current user returns "Created" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApifromdatadog_api_client.v2.model.application_key_create_attributesimportApplicationKeyCreateAttributesfromdatadog_api_client.v2.model.application_key_create_dataimportApplicationKeyCreateDatafromdatadog_api_client.v2.model.application_key_create_requestimportApplicationKeyCreateRequestfromdatadog_api_client.v2.model.application_keys_typeimportApplicationKeysTypebody=ApplicationKeyCreateRequest(data=ApplicationKeyCreateData(type=ApplicationKeysType.APPLICATION_KEYS,attributes=ApplicationKeyCreateAttributes(name="Example-Key-Management",),),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.create_current_user_application_key(body=body)print(response)
# Create an Application key with scopes for current user returns "Created" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.newbody=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",],}),}),})papi_instance.create_current_user_application_key(body)
# Create an application key for current user returns "Created" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.newbody=DatadogAPIClient::V2::ApplicationKeyCreateRequest.new({data:DatadogAPIClient::V2::ApplicationKeyCreateData.new({type:DatadogAPIClient::V2::ApplicationKeysType::APPLICATION_KEYS,attributes:DatadogAPIClient::V2::ApplicationKeyCreateAttributes.new({name:"Example-Key-Management",}),}),})papi_instance.create_current_user_application_key(body)
// Create an Application key with scopes for current user returns "Created"
// response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV2::model::ApplicationKeyCreateAttributes;usedatadog_api_client::datadogV2::model::ApplicationKeyCreateData;usedatadog_api_client::datadogV2::model::ApplicationKeyCreateRequest;usedatadog_api_client::datadogV2::model::ApplicationKeysType;#[tokio::main]asyncfnmain(){letbody=ApplicationKeyCreateRequest::new(ApplicationKeyCreateData::new(ApplicationKeyCreateAttributes::new("Example-Key-Management".to_string()).scopes(Some(vec!["dashboards_read".to_string(),"dashboards_write".to_string(),"dashboards_public_share".to_string(),],)),ApplicationKeysType::APPLICATION_KEYS,));letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.create_current_user_application_key(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
// Create an application key for current user returns "Created" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV2::model::ApplicationKeyCreateAttributes;usedatadog_api_client::datadogV2::model::ApplicationKeyCreateData;usedatadog_api_client::datadogV2::model::ApplicationKeyCreateRequest;usedatadog_api_client::datadogV2::model::ApplicationKeysType;#[tokio::main]asyncfnmain(){letbody=ApplicationKeyCreateRequest::new(ApplicationKeyCreateData::new(ApplicationKeyCreateAttributes::new("Example-Key-Management".to_string()),ApplicationKeysType::APPLICATION_KEYS,));letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.create_current_user_application_key(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create an Application key with scopes for current user returns "Created" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);constparams: v2.KeyManagementApiCreateCurrentUserApplicationKeyRequest={body:{data:{type:"application_keys",attributes:{name:"Example-Key-Management",scopes:["dashboards_read","dashboards_write","dashboards_public_share",],},},},};apiInstance.createCurrentUserApplicationKey(params).then((data: v2.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Create an application key for current user returns "Created" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);constparams: v2.KeyManagementApiCreateCurrentUserApplicationKeyRequest={body:{data:{type:"application_keys",attributes:{name:"Example-Key-Management",},},},};apiInstance.createCurrentUserApplicationKey(params).then((data: v2.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Edit an API key returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.key_management_apiimportKeyManagementApifromdatadog_api_client.v1.model.api_keyimportApiKeybody=ApiKey(name="example user",)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.update_api_key(key="key",body=body)print(response)
# Edit an API key returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::KeyManagementAPI.newbody=DatadogAPIClient::V1::ApiKey.new({name:"example user",})papi_instance.update_api_key("key",body)
// Edit an API key returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){body:=datadogV1.ApiKey{Name:datadog.PtrString("example user"),}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewKeyManagementApi(apiClient)resp,r,err:=api.UpdateAPIKey(ctx,"key",body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.UpdateAPIKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.UpdateAPIKey`:\n%s\n",responseContent)}
// Edit an API key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV1::model::ApiKey;#[tokio::main]asyncfnmain(){letbody=ApiKey::new().name("example user".to_string());letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.update_api_key("key".to_string(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Edit an API key returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);constparams: v1.KeyManagementApiUpdateAPIKeyRequest={body:{name:"example user",},key:"key",};apiInstance.updateAPIKey(params).then((data: v1.ApiKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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"}]}
// Edit an API key returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "api_key" in the system
APIKeyDataID:=os.Getenv("API_KEY_DATA_ID")body:=datadogV2.APIKeyUpdateRequest{Data:datadogV2.APIKeyUpdateData{Type:datadogV2.APIKEYSTYPE_API_KEYS,Id:APIKeyDataID,Attributes:datadogV2.APIKeyUpdateAttributes{Name:"Example-Key-Management",},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.UpdateAPIKey(ctx,APIKeyDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.UpdateAPIKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.UpdateAPIKey`:\n%s\n",responseContent)}
// Edit an API key returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.model.APIKeyResponse;importcom.datadog.api.client.v2.model.APIKeyUpdateAttributes;importcom.datadog.api.client.v2.model.APIKeyUpdateData;importcom.datadog.api.client.v2.model.APIKeyUpdateRequest;importcom.datadog.api.client.v2.model.APIKeysType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);// there is a valid "api_key" in the systemStringAPI_KEY_DATA_ID=System.getenv("API_KEY_DATA_ID");APIKeyUpdateRequestbody=newAPIKeyUpdateRequest().data(newAPIKeyUpdateData().type(APIKeysType.API_KEYS).id(API_KEY_DATA_ID).attributes(newAPIKeyUpdateAttributes().name("Example-Key-Management")));try{APIKeyResponseresult=apiInstance.updateAPIKey(API_KEY_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#updateAPIKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Edit an API key returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApifromdatadog_api_client.v2.model.api_key_update_attributesimportAPIKeyUpdateAttributesfromdatadog_api_client.v2.model.api_key_update_dataimportAPIKeyUpdateDatafromdatadog_api_client.v2.model.api_key_update_requestimportAPIKeyUpdateRequestfromdatadog_api_client.v2.model.api_keys_typeimportAPIKeysType# there is a valid "api_key" in the systemAPI_KEY_DATA_ID=environ["API_KEY_DATA_ID"]body=APIKeyUpdateRequest(data=APIKeyUpdateData(type=APIKeysType.API_KEYS,id=API_KEY_DATA_ID,attributes=APIKeyUpdateAttributes(name="Example-Key-Management",),),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.update_api_key(api_key_id=API_KEY_DATA_ID,body=body)print(response)
# Edit an API key returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.new# there is a valid "api_key" in the systemAPI_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",}),}),})papi_instance.update_api_key(API_KEY_DATA_ID,body)
// Edit an API key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV2::model::APIKeyUpdateAttributes;usedatadog_api_client::datadogV2::model::APIKeyUpdateData;usedatadog_api_client::datadogV2::model::APIKeyUpdateRequest;usedatadog_api_client::datadogV2::model::APIKeysType;#[tokio::main]asyncfnmain(){// there is a valid "api_key" in the system
letapi_key_data_id=std::env::var("API_KEY_DATA_ID").unwrap();letbody=APIKeyUpdateRequest::new(APIKeyUpdateData::new(APIKeyUpdateAttributes::new("Example-Key-Management".to_string()),api_key_data_id.clone(),APIKeysType::API_KEYS,));letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.update_api_key(api_key_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Edit an API key returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);// there is a valid "api_key" in the system
constAPI_KEY_DATA_ID=process.env.API_KEY_DATA_IDasstring;constparams: v2.KeyManagementApiUpdateAPIKeyRequest={body:{data:{type:"api_keys",id: API_KEY_DATA_ID,attributes:{name:"Example-Key-Management",},},},apiKeyId: API_KEY_DATA_ID,};apiInstance.updateAPIKey(params).then((data: v2.APIKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete an API key returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.key_management_apiimportKeyManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.delete_api_key(key="key",)print(response)
# Delete an API key returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::KeyManagementAPI.newpapi_instance.delete_api_key("key")
// Delete an API key returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewKeyManagementApi(apiClient)resp,r,err:=api.DeleteAPIKey(ctx,"key")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.DeleteAPIKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.DeleteAPIKey`:\n%s\n",responseContent)}
// Delete an API key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.delete_api_key("key".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Delete an API key returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);constparams: v1.KeyManagementApiDeleteAPIKeyRequest={key:"key",};apiInstance.deleteAPIKey(params).then((data: v1.ApiKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete an API key returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApi# there is a valid "api_key" in the systemAPI_KEY_DATA_ID=environ["API_KEY_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)api_instance.delete_api_key(api_key_id=API_KEY_DATA_ID,)
# Delete an API key returns "No Content" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.new# there is a valid "api_key" in the systemAPI_KEY_DATA_ID=ENV["API_KEY_DATA_ID"]api_instance.delete_api_key(API_KEY_DATA_ID)
// Delete an API key returns "No Content" response
packagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "api_key" in the system
APIKeyDataID:=os.Getenv("API_KEY_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)r,err:=api.DeleteAPIKey(ctx,APIKeyDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.DeleteAPIKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an API key returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);// there is a valid "api_key" in the systemStringAPI_KEY_DATA_ID=System.getenv("API_KEY_DATA_ID");try{apiInstance.deleteAPIKey(API_KEY_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#deleteAPIKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete an API key returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){// there is a valid "api_key" in the system
letapi_key_data_id=std::env::var("API_KEY_DATA_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.delete_api_key(api_key_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Delete an API key returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);// there is a valid "api_key" in the system
constAPI_KEY_DATA_ID=process.env.API_KEY_DATA_IDasstring;constparams: v2.KeyManagementApiDeleteAPIKeyRequest={apiKeyId: API_KEY_DATA_ID,};apiInstance.deleteAPIKey(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
List all application keys available for current user
This endpoint requires the user_app_keys permission.
Arguments
Query Strings
Name
Type
Description
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.
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"}}}
"""
Get all application keys owned by current user returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.list_current_user_application_keys()print(response)
# Get all application keys owned by current user returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.newpapi_instance.list_current_user_application_keys()
// Get all application keys owned by current user returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.ListCurrentUserApplicationKeys(ctx,*datadogV2.NewListCurrentUserApplicationKeysOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.ListCurrentUserApplicationKeys`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.ListCurrentUserApplicationKeys`:\n%s\n",responseContent)}
// Get all application keys owned by current user returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.model.ListApplicationKeysResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);try{ListApplicationKeysResponseresult=apiInstance.listCurrentUserApplicationKeys();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#listCurrentUserApplicationKeys");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get all application keys owned by current user returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV2::api_key_management::ListCurrentUserApplicationKeysOptionalParams;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.list_current_user_application_keys(ListCurrentUserApplicationKeysOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get all application keys owned by current user returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);apiInstance.listCurrentUserApplicationKeys().then((data: v2.ListApplicationKeysResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get all application keys returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.key_management_apiimportKeyManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.list_application_keys()print(response)
# Get all application keys returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::KeyManagementAPI.newpapi_instance.list_application_keys()
// Get all application keys returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewKeyManagementApi(apiClient)resp,r,err:=api.ListApplicationKeys(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.ListApplicationKeys`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.ListApplicationKeys`:\n%s\n",responseContent)}
// Get all application keys returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.list_application_keys().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get all application keys returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);apiInstance.listApplicationKeys().then((data: v1.ApplicationKeyListResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
List all application keys available for your org
This endpoint requires the org_app_keys_read permission.
Arguments
Query Strings
Name
Type
Description
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.
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"}}}
"""
Get all application keys returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.list_application_keys()print(response)
# Get all application keys returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.newpapi_instance.list_application_keys()
// Get all application keys returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.ListApplicationKeys(ctx,*datadogV2.NewListApplicationKeysOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.ListApplicationKeys`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.ListApplicationKeys`:\n%s\n",responseContent)}
// Get all application keys returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV2::api_key_management::ListApplicationKeysOptionalParams;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.list_application_keys(ListApplicationKeysOptionalParams::default()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get all application keys returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);apiInstance.listApplicationKeys().then((data: v2.ListApplicationKeysResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create an application key returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);constparams: v1.KeyManagementApiCreateApplicationKeyRequest={body:{name:"example user",},};apiInstance.createApplicationKey(params).then((data: v1.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get an application key returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.key_management_apiimportKeyManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.get_application_key(key="key",)print(response)
# Get an application key returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::KeyManagementAPI.newpapi_instance.get_application_key("key")
// Get an application key returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewKeyManagementApi(apiClient)resp,r,err:=api.GetApplicationKey(ctx,"key")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.GetApplicationKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.GetApplicationKey`:\n%s\n",responseContent)}
// Get an application key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.get_application_key("key".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get an application key returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);constparams: v1.KeyManagementApiGetApplicationKeyRequest={key:"key",};apiInstance.getApplicationKey(params).then((data: v1.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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"}]}
"""
Get an application key returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApi# there is a valid "application_key" in the systemAPPLICATION_KEY_DATA_ID=environ["APPLICATION_KEY_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.get_application_key(app_key_id=APPLICATION_KEY_DATA_ID,)print(response)
# Get an application key returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.new# there is a valid "application_key" in the systemAPPLICATION_KEY_DATA_ID=ENV["APPLICATION_KEY_DATA_ID"]papi_instance.get_application_key(APPLICATION_KEY_DATA_ID)
// Get an application key returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "application_key" in the system
ApplicationKeyDataID:=os.Getenv("APPLICATION_KEY_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.GetApplicationKey(ctx,ApplicationKeyDataID,*datadogV2.NewGetApplicationKeyOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.GetApplicationKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.GetApplicationKey`:\n%s\n",responseContent)}
// Get an application key returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.model.ApplicationKeyResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);// there is a valid "application_key" in the systemStringAPPLICATION_KEY_DATA_ID=System.getenv("APPLICATION_KEY_DATA_ID");try{ApplicationKeyResponseresult=apiInstance.getApplicationKey(APPLICATION_KEY_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#getApplicationKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get an application key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::GetApplicationKeyOptionalParams;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){// there is a valid "application_key" in the system
letapplication_key_data_id=std::env::var("APPLICATION_KEY_DATA_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.get_application_key(application_key_data_id.clone(),GetApplicationKeyOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get an application key returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);// there is a valid "application_key" in the system
constAPPLICATION_KEY_DATA_ID=process.env.APPLICATION_KEY_DATA_IDasstring;constparams: v2.KeyManagementApiGetApplicationKeyRequest={appKeyId: APPLICATION_KEY_DATA_ID,};apiInstance.getApplicationKey(params).then((data: v2.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Edit an application key returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);constparams: v1.KeyManagementApiUpdateApplicationKeyRequest={body:{name:"example user",},key:"key",};apiInstance.updateApplicationKey(params).then((data: v1.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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"}]}
// Edit an application key returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "application_key" in the system
ApplicationKeyDataID:=os.Getenv("APPLICATION_KEY_DATA_ID")body:=datadogV2.ApplicationKeyUpdateRequest{Data:datadogV2.ApplicationKeyUpdateData{Id:ApplicationKeyDataID,Type:datadogV2.APPLICATIONKEYSTYPE_APPLICATION_KEYS,Attributes:datadogV2.ApplicationKeyUpdateAttributes{Name:datadog.PtrString("Application Key for managing dashboards-updated"),},},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)resp,r,err:=api.UpdateApplicationKey(ctx,ApplicationKeyDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.UpdateApplicationKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `KeyManagementApi.UpdateApplicationKey`:\n%s\n",responseContent)}
// Edit an application key returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;importcom.datadog.api.client.v2.model.ApplicationKeyResponse;importcom.datadog.api.client.v2.model.ApplicationKeyUpdateAttributes;importcom.datadog.api.client.v2.model.ApplicationKeyUpdateData;importcom.datadog.api.client.v2.model.ApplicationKeyUpdateRequest;importcom.datadog.api.client.v2.model.ApplicationKeysType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);// there is a valid "application_key" in the systemStringAPPLICATION_KEY_DATA_ATTRIBUTES_NAME=System.getenv("APPLICATION_KEY_DATA_ATTRIBUTES_NAME");StringAPPLICATION_KEY_DATA_ID=System.getenv("APPLICATION_KEY_DATA_ID");ApplicationKeyUpdateRequestbody=newApplicationKeyUpdateRequest().data(newApplicationKeyUpdateData().id(APPLICATION_KEY_DATA_ID).type(ApplicationKeysType.APPLICATION_KEYS).attributes(newApplicationKeyUpdateAttributes().name("Application Key for managing dashboards-updated")));try{ApplicationKeyResponseresult=apiInstance.updateApplicationKey(APPLICATION_KEY_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#updateApplicationKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Edit an application key returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApifromdatadog_api_client.v2.model.application_key_update_attributesimportApplicationKeyUpdateAttributesfromdatadog_api_client.v2.model.application_key_update_dataimportApplicationKeyUpdateDatafromdatadog_api_client.v2.model.application_key_update_requestimportApplicationKeyUpdateRequestfromdatadog_api_client.v2.model.application_keys_typeimportApplicationKeysType# there is a valid "application_key" in the systemAPPLICATION_KEY_DATA_ATTRIBUTES_NAME=environ["APPLICATION_KEY_DATA_ATTRIBUTES_NAME"]APPLICATION_KEY_DATA_ID=environ["APPLICATION_KEY_DATA_ID"]body=ApplicationKeyUpdateRequest(data=ApplicationKeyUpdateData(id=APPLICATION_KEY_DATA_ID,type=ApplicationKeysType.APPLICATION_KEYS,attributes=ApplicationKeyUpdateAttributes(name="Application Key for managing dashboards-updated",),),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)response=api_instance.update_application_key(app_key_id=APPLICATION_KEY_DATA_ID,body=body)print(response)
# Edit an application key returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.new# there is a valid "application_key" in the systemAPPLICATION_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",}),}),})papi_instance.update_application_key(APPLICATION_KEY_DATA_ID,body)
// Edit an application key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;usedatadog_api_client::datadogV2::model::ApplicationKeyUpdateAttributes;usedatadog_api_client::datadogV2::model::ApplicationKeyUpdateData;usedatadog_api_client::datadogV2::model::ApplicationKeyUpdateRequest;usedatadog_api_client::datadogV2::model::ApplicationKeysType;#[tokio::main]asyncfnmain(){// there is a valid "application_key" in the system
letapplication_key_data_id=std::env::var("APPLICATION_KEY_DATA_ID").unwrap();letbody=ApplicationKeyUpdateRequest::new(ApplicationKeyUpdateData::new(ApplicationKeyUpdateAttributes::new().name("Application Key for managing dashboards-updated".to_string()),application_key_data_id.clone(),ApplicationKeysType::APPLICATION_KEYS,));letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.update_application_key(application_key_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Edit an application key returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);// there is a valid "application_key" in the system
constAPPLICATION_KEY_DATA_ID=process.env.APPLICATION_KEY_DATA_IDasstring;constparams: v2.KeyManagementApiUpdateApplicationKeyRequest={body:{data:{id: APPLICATION_KEY_DATA_ID,type:"application_keys",attributes:{name:"Application Key for managing dashboards-updated",},},},appKeyId: APPLICATION_KEY_DATA_ID,};apiInstance.updateApplicationKey(params).then((data: v2.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Delete an application key returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.KeyManagementApi(configuration);constparams: v1.KeyManagementApiDeleteApplicationKeyRequest={key:"key",};apiInstance.deleteApplicationKey(params).then((data: v1.ApplicationKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete an application key returns "No Content" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.key_management_apiimportKeyManagementApi# there is a valid "application_key" in the systemAPPLICATION_KEY_DATA_ID=environ["APPLICATION_KEY_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=KeyManagementApi(api_client)api_instance.delete_application_key(app_key_id=APPLICATION_KEY_DATA_ID,)
# Delete an application key returns "No Content" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::KeyManagementAPI.new# there is a valid "application_key" in the systemAPPLICATION_KEY_DATA_ID=ENV["APPLICATION_KEY_DATA_ID"]api_instance.delete_application_key(APPLICATION_KEY_DATA_ID)
// Delete an application key returns "No Content" response
packagemainimport("context""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "application_key" in the system
ApplicationKeyDataID:=os.Getenv("APPLICATION_KEY_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewKeyManagementApi(apiClient)r,err:=api.DeleteApplicationKey(ctx,ApplicationKeyDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `KeyManagementApi.DeleteApplicationKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete an application key returns "No Content" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.KeyManagementApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();KeyManagementApiapiInstance=newKeyManagementApi(defaultClient);// there is a valid "application_key" in the systemStringAPPLICATION_KEY_DATA_ID=System.getenv("APPLICATION_KEY_DATA_ID");try{apiInstance.deleteApplicationKey(APPLICATION_KEY_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling KeyManagementApi#deleteApplicationKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete an application key returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_key_management::KeyManagementAPI;#[tokio::main]asyncfnmain(){// there is a valid "application_key" in the system
letapplication_key_data_id=std::env::var("APPLICATION_KEY_DATA_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=KeyManagementAPI::with_config(configuration);letresp=api.delete_application_key(application_key_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Delete an application key returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.KeyManagementApi(configuration);// there is a valid "application_key" in the system
constAPPLICATION_KEY_DATA_ID=process.env.APPLICATION_KEY_DATA_IDasstring;constparams: v2.KeyManagementApiDeleteApplicationKeyRequest={appKeyId: APPLICATION_KEY_DATA_ID,};apiInstance.deleteApplicationKey(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));