Trigger on-demand synthetic monitor executions in Dynatrace with the Synthetic API, using monitor selection and execution options in the request body.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/synthetic/v1/executions/batch |
You use the batch executions endpoint to start on-demand executions for synthetic monitors. The request body can include failOnPerformanceIssue, failOnSslWarning, group, metadata, monitors, processingMode, stopOnProblem, and takeScreenshotsOnSuccess, and the operation returns 201 when it creates the executions.
To execute this request, you need a platform token or OAuth access token with synthetic:monitors:execute scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| body | Synthetic | The JSON body of the request. Contains the parameters of the triggered on-demand execution. | body | Required |
SyntheticOnDemandExecutionRequest objectContains parameters for the on-demand execution of monitors identified by tags, applications, or services.
| Element | Type | Description | Required |
|---|---|---|---|
| failOnPerformanceIssue | boolean | If true, the execution will fail in case of performance issue. | Optional |
| failOnSslWarning | boolean | Applies to HTTP monitors only. If true, the execution will fail in case of an SSL certificate expiration warning or if the certificate is missing. | Optional |
| group | Synthetic | Contains parameters for the on-demand execution of monitors identified by tags, applications, or services. | Optional |
| metadata | object | String to string map of metadata properties for execution. | Optional |
| monitors | Synthetic | List of monitors to be triggered. | Optional |
| processingMode | string | The execution's processing mode. The element can hold these values
| Optional |
| stopOnProblem | boolean | If true, no executions will be scheduled if a problem occurs. | Optional |
| takeScreenshotsOnSuccess | boolean | If true, the screenshots will be taken during the execution of a browser monitor. | Optional |
SyntheticOnDemandGroupExecutionRequest objectContains parameters for the on-demand execution of monitors identified by tags, applications, or services.
| Element | Type | Description | Required |
|---|---|---|---|
| applications | string[] | List of application identifiers. Only monitors with all applications assigned will be executed. | Optional |
| locations | string[] | The locations from where monitors are to be executed. | Optional |
| services | string[] | List of service identifiers. Only monitors with all services assigned will be executed. | Optional |
| tags | string[] | List of tags. Only monitors with all tags assigned will be executed. | Optional |
SyntheticOnDemandMonitorExecutionRequest objectContains monitors to be executed on demand from the locations specified.
| Element | Type | Description | Required |
|---|---|---|---|
| customizedScript | object | Customized script properties for this on-demand batch execution. | Optional |
| executionCount | integer | The number of times the monitor is to be executed per location; if not set, the monitor will be executed once. | Optional |
| locations | string[] | The locations from where the monitor is to be executed. | Optional |
| monitorId | string | The monitor identifier. | Required |
| repeatMode | string | Execution repeat mode. If not set, the mode is SEQUENTIAL. The element can hold these values
| Optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"failOnPerformanceIssue": false,"failOnSslWarning": true,"group": {"applications": ["APPLICATION-CD4BEF05FA9DD044"],"services": ["SERVICE-01C6C1282960638B","SERVICE-B18840B4E3115C1A"],"tags": ["tag-production","another-tag"]},"metadata": {"key": "value","version": "1.255.20221022"},"monitors": [{"customizedScript": {"requests": [{"sequenceId": "1","url": "https://www.somepage.org","validation": {"rules": [{"passIfFound": "true","type": "httpStatusesList","value": "=201"}]}}]},"executionCount": 3,"locations": ["SYNTHETIC_LOCATION-9BB04DAEBA71B8CA","SYNTHETIC_LOCATION-ACCA399FAA1194DD"],"monitorId": "HTTP_MONITOR-6349B98E1CD87352","repeatMode": "SEQUENTIAL"}],"processingMode": "EXECUTIONS_DETAILS_ONLY","stopOnProblem": true,"takeScreenshotsOnSuccess": true}
| Code | Type | Description |
|---|---|---|
| 201 | Synthetic | Created |
| 4XX | Error | Client side error. |
| 5XX | Error | Server side error. |
SyntheticOnDemandExecutionResponse objectThe result of on-demand synthetic monitor execution.
| Element | Type | Description |
|---|---|---|
| batchId | string | The batch identifier of the triggered executions. |
| triggered | Synthetic | Monitors for which on-demand executions were triggered. |
| triggeredCount | integer | The total number of the triggered executions within the batch. |
| triggeringProblemsCount | integer | The total number of problems within the batch. |
| triggeringProblemsDetails | Synthetic | List with the entities for which triggering problems occurred. |
SyntheticOnDemandTriggeredMonitorResponse objectContains the list of on-demand executions of the monitor.
| Element | Type | Description |
|---|---|---|
| executions | Synthetic | The list of triggered executions. |
| monitorId | string | The monitor identifier. |
SyntheticOnDemandTriggeredExecutionDetailsResponse objectContains details of the triggered on-demand execution.
| Element | Type | Description |
|---|---|---|
| executionId | string | The execution's identifier. |
| locationId | string | The identifier of the location from which the monitor is to be executed. |
SyntheticOnDemandTriggeringProblemDetailsResponse objectContains the details of problems encountered while triggering on-demand executions.
| Element | Type | Description |
|---|---|---|
| cause | string | The cause of not triggering entity. |
| details | string | The details of triggering problem. |
| executionId | string | The execution identifier. |
| id | string | The entity identifier. |
| locationId | string | The location identifier. |
ErrorResponseEnvelope objectEncloses the encountered error.
| Element | Type | Description |
|---|---|---|
| error | Error | Basic information of the encountered error. |
ErrorResponse objectBasic information of the encountered error.
| Element | Type | Description |
|---|---|---|
| code | integer | The returned HTTP status code. |
| details | Error | Detailed information of the error. |
| message | string | Description of the encountered error. |
ErrorResponseDetails objectDetailed information of the error.
| Element | Type | Description |
|---|---|---|
| type | string | Defines the actual set of fields depending on the value. See one of the following objects:
The element can hold these values
|
{"batchId": "22396514015719218","triggered": [{"executions": [{"executionId": "1069999568093682590","locationId": "SYNTHETIC_LOCATION-9BB04DAE11123122"}],"monitorId": "HTTP_MONITOR-69A9B98E1CD87352"}],"triggeredCount": 1,"triggeringProblemsCount": 4,"triggeringProblemsDetails": [{"cause": "Location not found","id": "HTTP_MONITOR-6349B98E1CD87352","locationId": "SYNTHETIC_LOCAT-9BB04DAEBA71B8CA"},{"cause": "Monitor not found","id": "HTTP_MONITOR-6349B98E1CD85432"},{"cause": "Incorrect monitor identifier format","id": "HTTP_HACK-AAAAAAA"},{"cause": "Incorrect application identifier format","id": "APPLICATION-WRONG"}]}
{"error": {"code": 1,"details": {"type": "constraintViolation"},"message": "string"}}