Bulk create monitors
- Base URL
-
https://{kibana_url}
- POST /api/synthetics/monitors/_bulk_create
- POST /s/{space_id}/api/synthetics/monitors/_bulk_create
Refer to Spaces for more information.
Create up to 1000 monitors in one request. Every monitor is validated before any monitor is persisted. The API creates the Saved Objects and synchronizes Fleet once for the batch.
You must have all privileges for the Synthetics feature in the Observability section of the Kibana feature privileges. If a monitor is shared to additional spaces, you must also have create privileges in each of those spaces.
Required authorization
- Privileges uptime-read and uptime-write
Authentication
Authorization: <value>
These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: Authorization: ApiKey base64AccessApiKey
Authorization: Basic <credentials>
Request body
-
monitorsunion oneOf[] · min items: 1 · max items: 1000required - One of:
-
alertmap string to {} object -
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
labelsmap string to string -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
<string>string · max length: 1000000 -
locationsunion anyOf[] · max items: 1000 -
The Elastic-managed locations to deploy the monitor to. Monitors can be deployed in multiple locations so that you can detect differences in availability and response times across those locations. To list available locations, run the
elastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Management and click Create monitor.You can provide
locationsorprivate_locationsor both. At least one is required. - Any of:
-
maintenance_windowsstring[] · max items: 1000 -
The IDs of the maintenance windows to apply to the monitor.
-
modeenum -
The mode of the monitor. If it is
all, the monitor pings all resolvable IPs for a hostname. If it isany, the monitor pings only one IP address for a hostname. If you're using a DNS-load balancer and want to ping every IP address for the specified hostname, useall. Defaults toany. -
Values:
anyall -
namespacestring -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
paramsunion anyOf -
The monitor parameters, as a JSON string or an object.
-
Any of:
stringorKey-value object -
private_locationsunion anyOf[] · max items: 1000 -
The private locations to deploy the monitor to. These locations are hosted and managed by you, whereas
locationsare hosted by Elastic. You can specify a private location using the location's name. To list available private locations, run theelastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Settings and click Private locations. - Any of:
-
retest_on_failureboolean -
Turn retesting for when a monitor fails on or off. By default, monitors are automatically retested if the monitor goes from "up" to "down". If the result of the retest is also "down", an error is created and, if configured, an alert is sent. Using
retest_on_failurecan reduce noise related to transient problems. -
scheduleunion anyOf -
The monitor's schedule in minutes. Supported values are
1,3,5,10,15,30,60,120, and240. The default value is3minutes for HTTP, TCP, and ICMP monitors, and10minutes for browser monitors. - Any of:
-
spacesstring[] · max items: 1000 -
The IDs of additional spaces to make the monitor available in, besides the current space.
-
timeoutunion string | number -
The monitor timeout in seconds. The monitor fails if it doesn't complete within this time. Defaults to
16.For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts only apply on private locations; on public locations the timeout has no effect and the response includes a warning.
-
alertmap string to {} object -
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
hoststring · max length: 4096 -
The host to monitor; it can be an IP address or a hostname. The host can include the port using a colon, for example "example.com:9200".
-
labelsmap string to string -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
<string>string · max length: 1000000 -
locationsunion anyOf[] · max items: 1000 -
The Elastic-managed locations to deploy the monitor to. Monitors can be deployed in multiple locations so that you can detect differences in availability and response times across those locations. To list available locations, run the
elastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Management and click Create monitor.You can provide
locationsorprivate_locationsor both. At least one is required. - Any of:
-
maintenance_windowsstring[] · max items: 1000 -
The IDs of the maintenance windows to apply to the monitor.
-
modeenum -
The mode of the monitor. If it is
all, the monitor pings all resolvable IPs for a hostname. If it isany, the monitor pings only one IP address for a hostname. If you're using a DNS-load balancer and want to ping every IP address for the specified hostname, useall. Defaults toany. -
Values:
anyall -
namespacestring -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
paramsunion anyOf -
The monitor parameters, as a JSON string or an object.
-
Any of:
stringorKey-value object -
private_locationsunion anyOf[] · max items: 1000 -
The private locations to deploy the monitor to. These locations are hosted and managed by you, whereas
locationsare hosted by Elastic. You can specify a private location using the location's name. To list available private locations, run theelastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Settings and click Private locations. - Any of:
-
retest_on_failureboolean -
Turn retesting for when a monitor fails on or off. By default, monitors are automatically retested if the monitor goes from "up" to "down". If the result of the retest is also "down", an error is created and, if configured, an alert is sent. Using
retest_on_failurecan reduce noise related to transient problems. -
scheduleunion anyOf -
The monitor's schedule in minutes. Supported values are
1,3,5,10,15,30,60,120, and240. The default value is3minutes for HTTP, TCP, and ICMP monitors, and10minutes for browser monitors. - Any of:
-
spacesstring[] · max items: 1000 -
The IDs of additional spaces to make the monitor available in, besides the current space.
-
timeoutunion string | number -
The monitor timeout in seconds. The monitor fails if it doesn't complete within this time. Defaults to
16.For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts only apply on private locations; on public locations the timeout has no effect and the response includes a warning.
-
alertmap string to {} object -
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
labelsmap string to string -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
<string>string · max length: 1000000 -
locationsunion anyOf[] · max items: 1000 -
The Elastic-managed locations to deploy the monitor to. Monitors can be deployed in multiple locations so that you can detect differences in availability and response times across those locations. To list available locations, run the
elastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Management and click Create monitor.You can provide
locationsorprivate_locationsor both. At least one is required. - Any of:
-
maintenance_windowsstring[] · max items: 1000 -
The IDs of the maintenance windows to apply to the monitor.
-
modeenum -
The mode of the monitor. If it is
all, the monitor pings all resolvable IPs for a hostname. If it isany, the monitor pings only one IP address for a hostname. If you're using a DNS-load balancer and want to ping every IP address for the specified hostname, useall. Defaults toany. -
Values:
anyall -
namespacestring -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
paramsunion anyOf -
The monitor parameters, as a JSON string or an object.
-
Any of:
stringorKey-value object -
private_locationsunion anyOf[] · max items: 1000 -
The private locations to deploy the monitor to. These locations are hosted and managed by you, whereas
locationsare hosted by Elastic. You can specify a private location using the location's name. To list available private locations, run theelastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Settings and click Private locations. - Any of:
-
retest_on_failureboolean -
Turn retesting for when a monitor fails on or off. By default, monitors are automatically retested if the monitor goes from "up" to "down". If the result of the retest is also "down", an error is created and, if configured, an alert is sent. Using
retest_on_failurecan reduce noise related to transient problems. -
scheduleunion anyOf -
The monitor's schedule in minutes. Supported values are
1,3,5,10,15,30,60,120, and240. The default value is3minutes for HTTP, TCP, and ICMP monitors, and10minutes for browser monitors. - Any of:
-
spacesstring[] · max items: 1000 -
The IDs of additional spaces to make the monitor available in, besides the current space.
-
timeoutunion string | number -
The monitor timeout in seconds. The monitor fails if it doesn't complete within this time. Defaults to
16.For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts only apply on private locations; on public locations the timeout has no effect and the response includes a warning.
-
alertmap string to {} object -
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
labelsmap string to string -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
<string>string · max length: 1000000 -
locationsunion anyOf[] · max items: 1000 -
The Elastic-managed locations to deploy the monitor to. Monitors can be deployed in multiple locations so that you can detect differences in availability and response times across those locations. To list available locations, run the
elastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Management and click Create monitor.You can provide
locationsorprivate_locationsor both. At least one is required. - Any of:
-
maintenance_windowsstring[] · max items: 1000 -
The IDs of the maintenance windows to apply to the monitor.
-
namespacestring -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
paramsunion anyOf -
The monitor parameters, as a JSON string or an object.
-
Any of:
stringorKey-value object -
private_locationsunion anyOf[] · max items: 1000 -
The private locations to deploy the monitor to. These locations are hosted and managed by you, whereas
locationsare hosted by Elastic. You can specify a private location using the location's name. To list available private locations, run theelastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Settings and click Private locations. - Any of:
-
retest_on_failureboolean -
Turn retesting for when a monitor fails on or off. By default, monitors are automatically retested if the monitor goes from "up" to "down". If the result of the retest is also "down", an error is created and, if configured, an alert is sent. Using
retest_on_failurecan reduce noise related to transient problems. -
scheduleunion anyOf -
The monitor's schedule in minutes. Supported values are
1,3,5,10,15,30,60,120, and240. The default value is3minutes for HTTP, TCP, and ICMP monitors, and10minutes for browser monitors. - Any of:
-
spacesstring[] · max items: 1000 -
The IDs of additional spaces to make the monitor available in, besides the current space.
-
timeoutunion string | number -
The monitor timeout in seconds. The monitor fails if it doesn't complete within this time. Defaults to
16.For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts only apply on private locations; on public locations the timeout has no effect and the response includes a warning.
-
alertmap string to {} object -
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
labelsmap string to string -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
<string>string · max length: 1000000 -
locationsunion anyOf[] · max items: 1000 -
The Elastic-managed locations to deploy the monitor to. Monitors can be deployed in multiple locations so that you can detect differences in availability and response times across those locations. To list available locations, run the
elastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Management and click Create monitor.You can provide
locationsorprivate_locationsor both. At least one is required. - Any of:
-
maintenance_windowsstring[] · max items: 1000 -
The IDs of the maintenance windows to apply to the monitor.
-
namespacestring -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
paramsunion anyOf -
The monitor parameters, as a JSON string or an object.
-
Any of:
stringorKey-value object -
private_locationsunion anyOf[] · max items: 1000 -
The private locations to deploy the monitor to. These locations are hosted and managed by you, whereas
locationsare hosted by Elastic. You can specify a private location using the location's name. To list available private locations, run theelastic-synthetics locationscommand with the deployment's Kibana URL, or go to Synthetics > Settings and click Private locations. - Any of:
-
retest_on_failureboolean -
Turn retesting for when a monitor fails on or off. By default, monitors are automatically retested if the monitor goes from "up" to "down". If the result of the retest is also "down", an error is created and, if configured, an alert is sent. Using
retest_on_failurecan reduce noise related to transient problems. -
scheduleunion anyOf -
The monitor's schedule in minutes. Supported values are
1,3,5,10,15,30,60,120, and240. The default value is3minutes for HTTP, TCP, and ICMP monitors, and10minutes for browser monitors. - Any of:
-
spacesstring[] · max items: 1000 -
The IDs of additional spaces to make the monitor available in, besides the current space.
-
timeoutunion string | number -
The monitor timeout in seconds. The monitor fails if it doesn't complete within this time. Defaults to
16.For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts only apply on private locations; on public locations the timeout has no effect and the response includes a warning.
Responses
A successful response. created: false indicates an individual Saved Object creation or Fleet synchronization failure; see error. Batch-level Fleet synchronization errors are returned in errors.
Bad request. Returned when the batch is empty or too large, a monitor configuration is invalid, or two monitors use the same name.