PUT /api/synthetics/monitors/{id}

Spaces method and path for this operation:

put /s/{space_id}/api/synthetics/monitors/{id}

Refer to Spaces for more information.

Update a monitor with the specified attributes. 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. You can also partially update a monitor. This will only update the fields that are specified in the request body. All other fields are left unchanged. The specified fields should conform to the monitor type. For example, you can't update the inline_scipt field of a HTTP monitor.

Path parameters

  • id string Required

    The identifier for the monitor that you want to update.

application/json

Body object Required

The request body should contain the attributes of the monitor you want to update. The required and default fields differ depending on the monitor type.

One of:

Responses

  • 200 application/json

    A successful response. The response may include a warnings array when the monitor configuration has non-critical issues.

    Hide response attribute Show response attribute object
    • warnings array[object]

      An optional array of warnings about the monitor configuration.

      Hide warnings attributes Show warnings attributes object
      • message string

        A human-readable warning message.

      • monitorId string

        The monitor ID associated with the warning.

      • publicLocationIds array[string]

        The public location IDs associated with the warning.

  • 400

    Bad request. For browser monitors, a 400 error is returned if the timeout is less than 30 seconds.

PUT /api/synthetics/monitors/{id}
curl \
 --request PUT 'https://localhost:5601/api/synthetics/monitors/{id}' \
 --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
Update an HTTP monitor that checks a website's availability.
{
  "type": "http",
  "name": "Website Availability",
  "url": "https://example.com",
  "tags": ["website", "availability"],
  "locations": ["united_kingdom"]
}
Update a TCP monitor that monitors a server's availability.
{
  "type": "tcp",
  "name": "Server Availability",
  "host": "example.com",
  "private_locations": ["my_private_location"]
}
Update an ICMP monitor that performs ping checks.
{
  "type": "icmp",
  "name": "Ping Test",
  "host": "example.com",
  "locations": ["united_kingdom"]
}
Update a browser monitor that checks 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"]
}
Response examples (200)
A response when a browser monitor specifies a timeout but has no private locations.
{
  "type": "browser",
  "name": "Example journey",
  "enabled": true,
  "warnings": [
    {
      "id": "monitor-id",
      "message": "For browser monitors, timeout is only supported on private locations. Browser monitor \"Example journey\" specifies a timeout and is running on public locations: \"public-1, public-2\". The timeout will have no effect on these locations.",
      "publicLocationIds": ["public-1", "public-2"]
    }
  ]
}