• Home
  • Dynatrace API
  • Environment
  • Synthetic v2
  • Locations
  • POST a location

Synthetic locations API v2 - POST a location

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.

POSTManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/v2/synthetic/locations
SaaShttps://{your-environment-id}.live.dynatrace.com/api/v2/synthetic/locations
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/v2/synthetic/locations

Authentication

To execute this request, you need an access token with syntheticLocations.write 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.

ParameterTypeDescriptionInRequired
bodySyntheticLocation

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

bodyoptional

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.

ElementTypeDescriptionRequired
nodesstring[]

A list of synthetic nodes belonging to the location.

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

optional
availabilityLocationOutageboolean

The alerting of location outage is enabled (true) or disabled (false).

optional
availabilityNodeOutageboolean

The alerting of node outage is enabled (true) or disabled (false).

If enabled, the outage of any node in the location triggers an alert.

optional
locationNodeOutageDelayInMinutesinteger

Alert if the location or node outage lasts longer than X minutes.

Only applicable when availabilityLocationOutage or availabilityNodeOutage is set to true.

optional
availabilityNotificationsEnabledboolean

The notifications of location and node outage is enabled (true) or disabled (false).

optional
deploymentTypestring

The deployment type of the location:

  • STANDARD: The location is deployed on Windows or Linux.
  • KUBERNETES: The location is deployed on Kubernetes.
The element can hold these values
  • KUBERNETES
  • OPENSHIFT
  • STANDARD
optional
autoUpdateChromiumboolean

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

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.

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

Response

Response codes

CodeTypeDescription
201SyntheticLocationIdsDto

Success. The private location has been created. The response contains the ID of the new location.

Response body objects

The SyntheticLocationIdsDto object

A DTO for synthetic Location IDs.

ElementTypeDescription
entityIdstring

Entity ID to be transferred

geoLocationIdstring

GeoLocation ID to be transferred

Response body JSON model

json
{ "entityId": "string", "geoLocationId": "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 290433380.

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. You can fetch the list of available nodes with the GET all nodes request.

Curl

bash
curl -L -X POST 'https://mySampleEnv.live.dynatrace.com/api/v2/synthetic/locations' \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \ -H 'Content-Type: application/json' \ --data-raw '{ "type": "PRIVATE", "name": "REST example - Linz", "countryCode": "AT", "city": "Linz", "status": "ENABLED", "latitude": 48.306351, "longitude": 14.287399, "nodes": [ "290433380" ], "availabilityLocationOutage": false, "availabilityNodeOutage": false, "locationNodeOutageDelayInMillis": 5000 } '

Request URL

plaintext
https://mySampleEnv.live.dynatrace.com/api/v2/synthetic/locations

Request body

json
{ "type": "PRIVATE", "name": "REST example - Linz", "countryCode": "AT", "city": "Linz", "status": "ENABLED", "latitude": 48.306351, "longitude": 14.287399, "nodes": ["290433380"], "availabilityLocationOutage": false, "availabilityNodeOutage": false, "locationNodeOutageDelayInMillis": 5000 }

Response body

json
{ "entityId": "SYNTHETIC_LOCATION-493122BFA29674DC", "geoLocationId": "GEOLOCATION-96B57899C9B5A3C7" }

Response code

200

Related topics
  • Synthetic Monitoring

    Learn about Synthetic Monitoring and how to create a single-URL browser monitor, a browser clickpath, or an HTTP monitor.

  • Create a private Synthetic location

    Learn how to create a private location for synthetic monitoring.