Synthetic locations API - POST a location

We have a new version of this API—Synthetic API v2. Check it out!

Creates a new private Synthetic location. For more details about synthetic location creation, see Create a private Synthetic location.

The request consumes and produces an application/json payload.

POSTSaaShttps://{your-environment-id}.live.dynatrace.com/api/v1/synthetic/locations
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/v1/synthetic/locations

Authentication

To execute this request, you need an access token with ExternalSyntheticIntegration scope.

To learn how to obtain and use it, see Tokens and authentication.

Parameter

To find all model variations that depend on the type of the model, see JSON models.

Parameter
Type
Description
In
Required
body

The JSON body of the request. Contains parameters of the new private synthetic location.

body
optional

Request body objects

The SyntheticLocation object

Configuration of a synthetic location.

countryCode, regionCode, city parameters are optional as they can be retrieved based on latitude and longitude of location.

The actual set of fields depends on the type of the location. Find the list of actual objects in the description of the type field or see Synthetic locations API v2 - JSON models.

Element
Type
Description
Required
autoUpdateChromium
boolean

Auto upgrade of Chromium is enabled (true) or disabled (false).

optional
availabilityLocationOutage
boolean

Alerting for location outage is enabled (true) or disabled (false). Supported only for private Synthetic locations.

optional
availabilityNodeOutage
boolean

Alerting for node outage is enabled (true) or disabled (false). \n\n If enabled, the outage of any node in the location triggers an alert. Supported only for private Synthetic locations.

optional
availabilityNotificationsEnabled
boolean

Notifications for location and node outage are enabled (true) or disabled (false). Supported only for private Synthetic locations.

optional
deploymentType
string

The deployment type of the location:

  • STANDARD: The location is deployed on Windows or Linux.
  • KUBERNETES: The location is deployed on Kubernetes.
  • KUBERNETES
  • OPENSHIFT
  • STANDARD
  • UNKNOWN
optional
locationNodeOutageDelayInMinutes
integer

Alert if location or node outage lasts longer than X minutes. \n\n Only applicable when availabilityLocationOutage or availabilityNodeOutage is set to true. Supported only for private Synthetic locations.

optional
namExecutionSupported
boolean

Boolean value describes if icmp monitors will be executed on this location:

  • false: Icmp monitor executions disabled.
  • true: Icmp monitor executions enabled.
optional
nodes
string[]

A list of synthetic nodes belonging to the location.

You can retrieve the list of available nodes with the GET all nodes call.

optional
useNewKubernetesVersion
boolean

Boolean value describes which kubernetes version will be used:

  • false: Version 1.23+ that is older than 1.26
  • true: Version 1.26+.
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.

{
"autoUpdateChromium": true,
"availabilityLocationOutage": true,
"availabilityNodeOutage": true,
"availabilityNotificationsEnabled": true,
"deploymentType": "KUBERNETES",
"locationNodeOutageDelayInMinutes": 1,
"namExecutionSupported": true,
"nodes": [
"string"
],
"useNewKubernetesVersion": true
}

Response

Response codes

Code
Type
Description
200

Success

4XX

Client side error.

5XX

Server side error.

Response body objects

The EntityIdDto object

A DTO for entity ID.

Element
Type
Description
entityId
string

Entity ID to be transferred

Response body JSON model

{
"entityId": "string"
}

Example

In this example, the request creates a new private Synthetic location. This location lies in Linz, Austria. It uses the synthetic node with the ID of 93302281.

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. Be sure to replace the list of nodes with nodes available in your environment.

Curl

curl -X POST \
https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/locations \
-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
-d '{
"type": "PRIVATE",
"name": "REST example - Linz",
"countryCode": "AT",
"regionCode": "AU04",
"city": "Linz",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": [
"93302281"
]
}
'

Request URL

https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/locations

Request body

{
"type": "PRIVATE",
"name": "REST example - Linz",
"countryCode": "AT",
"regionCode": "AU04",
"city": "Linz",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": ["93302281"]
}

Response body

{
"entityId": "SYNTHETIC_LOCATION-8F419D1B53639A45"
}

Response code

200