Create a monitor
Create a new monitor with the specified attributes. A monitor can be one of the following types: HTTP, TCP, ICMP, or Browser. The required and default fields may vary based on the monitor type.
You must have all
privileges for the Synthetics feature in the Observability section of the Kibana feature privileges.
POST
/api/synthetics/monitors
curl \
--request POST 'https://localhost:5601/api/synthetics/monitors' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '"{\n \"type\": \"http\",\n \"name\": \"Website Availability\",\n \"url\": \"https://example.com\",\n \"tags\": [\"website\", \"availability\"],\n \"locations\": [\"united_kingdom\"]\n}"'
Request examples
HTTP monitor
Create an HTTP monitor to check a website's availability.
{
"type": "http",
"name": "Website Availability",
"url": "https://example.com",
"tags": ["website", "availability"],
"locations": ["united_kingdom"]
}
Create a TCP monitor to monitor a server's availability.
{
"type": "tcp",
"name": "Server Availability",
"host": "example.com",
"private_locations": ["my_private_location"]
}
Create an ICMP monitor to perform ping checks.
{
"type": "icmp",
"name": "Ping Test",
"host": "example.com",
"locations": ["united_kingdom"]
}
Create a browser monitor to check a website.
{
"type": "browser",
"name": "Example journey",
"inline_script": "step('Go to https://google.com.co', () => page.goto('https://www.google.com'))",
"locations": ["united_kingdom"]
}