Create an API test

POST {{baseUrl}}/api/v1/synthetics/tests/api

Create a Synthetic API test.

Request Body

{"config"=>{"assertions"=>[{"operator"=>"lessThan", "target"=>1000, "type"=>"responseTime"}, {"operator"=>"is", "target"=>200, "type"=>"statusCode"}, {"operator"=>"is", "property"=>"content-type", "target"=>"text/html; charset=UTF-8", "type"=>"header"}], "request"=>{"method"=>"GET", "url"=>"https://example.com"}}, "locations"=>["azure:eastus", "aws:eu-west-3"], "message"=>"MY_NOTIFICATION_MESSAGE", "name"=>"MY_TEST_NAME", "options"=>{"min_failure_duration"=>0, "min_location_failed"=>1, "monitor_options"=>{"include_tags"=>true, "locked"=>false, "new_host_delay"=>300, "notify_audit"=>false, "notify_no_data"=>false, "renotify_interval"=>0}, "tick_every"=>60}, "status"=>"live", "subtype"=>"http", "tags"=>["env:production"], "type"=>"api"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{"name":"Example test name","config":{"assertions":[{"operator":"lessThan","target":1000,"type":"responseTime"}],"request":{"method":"GET","url":"https://example.com"}},"locations":["aws:eu-west-3"],"options":{"accept_self_signed":true,"allow_insecure":true,"checkCertificateRevocation":false,"ci":{"executionRule":"non_blocking"},"device_ids":["laptop_large","laptop_large"],"disableCors":false,"disableCsp":false,"follow_redirects":false,"httpVersion":"any","ignoreServerCertificateError":true,"initialNavigationTimeout":885937,"min_failure_duration":-37718041,"min_location_failed":33170428,"monitor_name":"dolor in exercitation","monitor_options":{"renotify_interval":832},"monitor_priority":4,"noScreenshot":false,"restricted_roles":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],"retry":{"count":-20159913,"interval":82958733.41296574},"rumSettings":{"applicationId":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","clientTokenId":12345,"isEnabled":true},"scheduling":{"timeframes":[{"day":1,"from":"07:00","to":"16:00"},{"day":3,"from":"07:00","to":"16:00"}],"timezone":"America/New_York"},"tick_every":19466},"type":"api","message":"Notification message","monitor_id":12345678,"public_id":"123-abc-456","status":"live","subtype":"http","tags":["env:production"]}