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.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

PUT
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/credentials/{id}
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/credentials/{id}

Authentication

To execute this request, you need the Write Credential Vault entries (credentialVault.write) permission assigned to your API token. To learn how to obtain and use it, see Authentication.

Parameters

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 optional

The Credentials object

A set of credentials for synthetic monitors.

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..

required
ownerAccessOnly boolean

The credentials set is available to every user (false) or to owner only (true).

optional
type string

Defines the actual set of fields depending on the value. See one of the following objects:

  • CERTIFICATE -> CertificateCredentials
  • USERNAME_PASSWORD -> UserPasswordCredentials
  • TOKEN -> TokenCredentials
The type element can hold these values.
optional

Possible values

Possible values for the type element in the Credentials object:

  • CERTIFICATE
  • TOKEN
  • USERNAME_PASSWORD

Response format

Refer to JSON models to find all JSON models that depend on the type of the model.

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.

type string

The type of the credentials set.

The type element can hold these values.
description string

A short description of the credentials set.

owner string

The owner of the credential.

ownerAccessOnly boolean

Flag indicating that this credential is visible only to the owner.

Possible values

Possible values for the type element in the CredentialsResponseElement object:

  • CERTIFICATE
  • TOKEN
  • UNKNOWN
  • USERNAME_PASSWORD

Response codes

Code Description
201

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

Failed. The input is invalid

Example

In this example, the request updates the set of credentials created in the POST request example.

It changes the username to mary.brown and the password to 4321dcba.

The API token is passed in the Authorization header.

You can download or copy the example request body to try it out on your own.

Curl

curl -X PUT \
  https://mySampleEnv.live.dynatrace.com/api/config/v1/credentials/CREDENTIALS_VAULT-1E6EA5075AF7E85D \
  -H 'Authorization: Api-token abcdefjhij1234567890' \
  -H 'Content-Type: application/json' \  
  -d '{
  "name": "RESTtest",
  "description": "Test credentials",
  "password": "4321dcba",
  "ownerAccessOnly": true,
  "type": "USERNAME_PASSWORD",
  "certificate": "mary.brown"
}'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/credentials/CREDENTIALS_VAULT-1E6EA5075AF7E85D

Request body

Download
{
  "name": "RESTtest",
  "description": "Test credentials",
  "password": "4321dcba",
  "ownerAccessOnly": true,
  "type": "USERNAME_PASSWORD",
  "user": "mary.brown"
}

Response code

204