Credential vault API - PUT a set of credentials
Updates the specified set of credentials for synthetic monitors.
The request consumes and produces an application/json
payload.
PUT | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v2/credentials/{id} |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/credentials/{id} | |
Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/v2/credentials/{id} |
Authentication
To execute this request, you need an access token with credentialVault.write
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Refer to JSON models to find all JSON models that depend on the type of the model.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
id | string | The Dynatrace entity ID of the credentials set to be updated. | path | required |
body | Credentials | The JSON body of the request. Contains updated parameters of the credentials set. | body | required |
Request body objects
The Credentials
object
A set of credentials for synthetic monitors.
The actual set of fields depends on the type of credentials. Find the list of actual objects in the description of the type field or see Credential vault API - JSON models.
Element | Type | Description | Required |
---|---|---|---|
name | string | The name of the credentials set. | required |
id | string | The ID of the credentials set. | optional |
description | string | A short description of the credentials set. | optional |
ownerAccessOnly | boolean | The credentials set is available to every user ( | optional |
scope | string | The scope of the credentials set. | required |
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
| optional |
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{
"name": "Sample credentials",
"type": "USERNAME_PASSWORD",
"description": "Sample set of credentials for API documentation",
"user": "john.smith",
"password": "1234abcd",
"ownerAccessOnly": true,
"scope": "SYNTHETIC"
}
Response
Response codes
Code | Type | Description |
---|---|---|
201 | Credentials | Success. The new credentials set has been created. The response contains the ID of the set. |
204 | Success. The credentials set has been updated. Response doesn't have a body. | |
400 | ErrorEnvelope | Failed. The input is invalid |
Response body objects
The CredentialsResponseElement
object
Metadata of the credentials set.
Element | Type | Description |
---|---|---|
name | string | The name of the credentials set. |
id | string | The ID of the credentials set. |
description | string | A short description of the credentials set. |
owner | string | The owner of the credential (user for which used API token was created). |
ownerAccessOnly | boolean | Flag indicating that this credential is visible only to the owner. |
scope | string | The scope of the credentials set. |
externalVault | External | Configuration for external vault synchronization for username and password credentials. |
credentialUsageSummary | Credential | The list contains summary data related to the use of credentials. |
type | string | The type of the credentials set. |
The ExternalVaultConfig
object
Configuration for external vault synchronization for username and password credentials.
Element | Type | Description |
---|---|---|
sourceAuthMethod | string | Defines the actual set of fields depending on the value. See one of the following objects:
|
vaultUrl | string | - |
usernameSecretName | string | - |
passwordSecretName | string | - |
tokenSecretName | string | - |
credentialsUsedForExternalSynchronization | string[] | - |
type | string | - |
The CredentialUsageHandler
object
Keeps information about credential's usage.
Element | Type | Description |
---|---|---|
type | string | Type of usage. |
count | integer | The number of uses. |
Response body JSON model
{
"name": "Sample username-password credentials",
"id": "CREDENTIALS_VAULT-C43F2C2E6395AD23",
"type": "USERNAME_PASSWORD",
"description": "Sample credentials for demo purposes.",
"owner": "user@domain.com",
"ownerAccessOnly": true,
"scope": "SYNTHETIC",
"externalVault": {
"sourceAuthMethod": "HASHICORP_VAULT_APPROLE",
"vaultUrl": "https://vault-cluster.vault.fb17d2fc-be92-4230-afa2-91dbfda3cbad.aws.hashicorp.cloud:8200",
"usernameSecretName": "username",
"passwordSecretName": "password",
"pathToCredentials": "kv/credentials",
"roleId": "00e4858c-ec33-bc99-4e7e-34de6967de6c",
"secretId": "CREDENTIALS_VAULT-XXXXXXXXXXXXXXXX",
"vaultNamespace": "admin"
},
"credentialUsageSummary": [
{
"HTTP_MONITOR": 3,
"BROWSER_MONITOR": 2
}
]
}