dynatrace synthetic api
- User
dynatrace synthetic api
- Assistant
Dynatrace Synthetic APIs allow you to create, manage, and monitor synthetic tests programmatically using RESTful endpoints. Synthetic monitoring in Dynatrace helps you simulate user interactions with your applications and APIs to proactively detect availability and performance issues.
Here’s an overview of Dynatrace Synthetic API and how you can use it:
What is Dynatrace Synthetic API?
Dynatrace Synthetic APIs provide programmatic access to create, update, retrieve, and delete synthetic monitors (both HTTP and browser monitors), manage locations, and retrieve synthetic test results.
Common Use Cases
- Automating the creation and management of synthetic tests
- Integrating synthetic monitoring setup with CI/CD pipelines
- Retrieving test results for dashboards or external reporting
- Managing monitor locations
Base URL
The API endpoints are available under:
codehttps://{your-environment-id}.live.dynatrace.com/api/v1/syntheticReplace
{your-environment-id}with your Dynatrace environment ID.Authentication
Dynatrace Synthetic APIs require an API token with appropriate scopes:
Synthetic monitors: Read/Write- Typically you generate your API token via Dynatrace:
- Settings > Integration > Dynatrace API > Generate token
Include the token as a Bearer token in the Authorization header:
httpAuthorization: Api-Token {your-api-token}Key Endpoints
1. List all monitors
httpGET /monitorsReturns all configured synthetic monitors.
2. Create a new monitor
httpPOST /monitors Content-Type: application/json { "name": "My Synthetic API Test", "type": "HTTP", // or 'BROWSER' "frequencyMin": 5, "enabled": true, "locations": ["GEOLOCATION-1234"], "request": { "url": "https://api.example.com/health", "method": "GET", "headers": [], "body": null } }3. Update a monitor