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":false,"checkCertificateRevocation":false,"ci":{"executionRule":"skipped"},"device_ids":["chrome.laptop_large","chrome.laptop_large"],"disableCors":false,"disableCsp":true,"follow_redirects":true,"httpVersion":"any","ignoreServerCertificateError":true,"initialNavigationTimeout":46404480,"min_failure_duration":-77163806,"min_location_failed":17162468,"monitor_name":"aute nostrud dolor","monitor_options":{"renotify_interval":663},"monitor_priority":3,"noScreenshot":false,"restricted_roles":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],"retry":{"count":30047337,"interval":692977.0306222737},"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":165858},"type":"api","message":"Notification message","monitor_id":12345678,"public_id":"123-abc-456","status":"live","subtype":"http","tags":["env:production"]}