Credential vault API - POST a set of credentials

Creates a new set of credentials for synthetic HTTP monitors.

The request consumes and produces an application/json payload.

This request is an early adopter release and may be changed in non compatible way.

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

Parameters

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

Parameter Type Description In Required
body Credentials

The JSON body of the request. Contains parameters of the new 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:

CERTIFICATE -> CertificateCredentials USERNAME_PASSWORD -> UserPasswordCredentials TOKEN -> TokenCredentials

The type element can hold these values.
required

Possible values

Possible values for the type element in the Credentials object:

  • CERTIFICATE
  • USERNAME_PASSWORD
  • TOKEN

Response format

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.

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.

Example

In this example, the request creates a new set of credentials of the USERNAME_PASSWORD type. The username of the credentials set is john.smith and the password is abcd1234.

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 POST \
  https://mySampleEnv.live.dynatrace.com/api/config/v1/credentials/ \
  -H 'Authorization: Api-token abcdefjhij1234567890' \
  -H 'Content-Type: application/json' \  
  -d '{
  "name": "RESTtest",
  "description": "Test credentials",
  "password": "abcd1234",
  "ownerAccessOnly": true,
  "type": "USERNAME_PASSWORD",
  "certificate": "john.smith"
}'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/credentials/

Request body

api-examples/config/credentials-vault/post.json
Download
{
  "name": "RESTtest",
  "description": "Test credentials",
  "password": "abcd1234",
  "ownerAccessOnly": true,
  "type": "USERNAME_PASSWORD",
  "user": "john.smith"
}

Response body

{
  "id": "CREDENTIALS_VAULT-1E6EA5075AF7E85D"
}

Response code

200