Spaces method and path for this operation:
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.
This is a versioned public API (elastic-api-version: 2023-10-31).
Body
Required
-
A non-empty list of monitor configurations, up to 1000 monitors.
At least
1but not more than1000elements.One of: Hide attributes Show attributes
-
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
Specify whether the monitor is enabled.
Default value is
true. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
The location to deploy the monitor. 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 you can:
- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Management and click Create monitor. Locations will be listed in Locations.
- Run the
-
The monitor name.
-
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-.Default value is
default. -
The monitor parameters.
-
The private locations to which the monitors will be deployed. These private locations refer to locations 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 you can:- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Settings and click Private locationsr. Private locations will be listed in the table.
You can provide
locationsorprivate_locationsor both. At least one is required. - Run the
-
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 will be created and if configured, an alert sent. The monitor will then resume running according to the defined schedule. Using
retest_on_failurecan reduce noise related to transient problems.Default value is
true. -
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. The default value is10minutes for Browser monitors. -
The APM service name.
-
An array of tags.
-
The monitor timeout in seconds. The monitor will fail if it doesn't complete within this time.
For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts are only applied when the monitor runs on private locations. If a browser monitor specifies a timeout but has no private locations configured, the timeout will have no effect and a warning will be returned in the response.
Default value is
16. -
PEM certificates whose public keys (SPKI) are allowlisted so Chromium bypasses certificate errors for matching presented certificates. This does not add a CA to Chromium's trust store.
Default value is
[](empty). -
Ignore HTTPS errors.
Default value is
false. -
The inline script.
-
Playwright options.
-
The screenshot option.
Values are
on,off, oronly-on-failure. Default value ison. -
Synthetics agent CLI arguments.
-
The monitor type.
Hide attributes Show attributes
-
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
Specify whether the monitor is enabled.
Default value is
true. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
The location to deploy the monitor. 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 you can:
- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Management and click Create monitor. Locations will be listed in Locations.
- Run the
-
The monitor name.
-
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-.Default value is
default. -
The monitor parameters.
-
The private locations to which the monitors will be deployed. These private locations refer to locations 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 you can:- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Settings and click Private locationsr. Private locations will be listed in the table.
You can provide
locationsorprivate_locationsor both. At least one is required. - Run the
-
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 will be created and if configured, an alert sent. The monitor will then resume running according to the defined schedule. Using
retest_on_failurecan reduce noise related to transient problems.Default value is
true. -
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. The default value is10minutes for Browser monitors. -
The APM service name.
-
An array of tags.
-
The monitor timeout in seconds. The monitor will fail if it doesn't complete within this time.
For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts are only applied when the monitor runs on private locations. If a browser monitor specifies a timeout but has no private locations configured, the timeout will have no effect and a warning will be returned in the response.
Default value is
16. -
The check request settings.
Hide check attributes Show check attributes object
-
An optional request to send to the remote host.
Hide request attributes Show request attributes object
-
The expected response.
Additional properties are allowed.
-
-
If
true, ping using the ipv4 protocol.Default value is
true. -
If
true, ping using the ipv6 protocol.Default value is
true. -
The maximum number of redirects to follow.
Default value is
0. -
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, you should useall.Values are
allorany. Default value isany. -
The password for authenticating with the server. The credentials are passed with the request.
-
Additional headers to send to proxies during CONNECT requests.
-
The URL of the proxy to use for this monitor.
-
Controls the indexing of the HTTP response body contents to the
http.response.body.contents field. -
The TLS/SSL connection settings for use with the HTTPS endpoint. If you don't specify settings, the system defaults are used.
-
The monitor type.
-
The URL to monitor.
-
The username for authenticating with the server. The credentials are passed with the request.
Hide attributes Show attributes
-
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
Specify whether the monitor is enabled.
Default value is
true. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
The location to deploy the monitor. 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 you can:
- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Management and click Create monitor. Locations will be listed in Locations.
- Run the
-
The monitor name.
-
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-.Default value is
default. -
The monitor parameters.
-
The private locations to which the monitors will be deployed. These private locations refer to locations 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 you can:- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Settings and click Private locationsr. Private locations will be listed in the table.
You can provide
locationsorprivate_locationsor both. At least one is required. - Run the
-
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 will be created and if configured, an alert sent. The monitor will then resume running according to the defined schedule. Using
retest_on_failurecan reduce noise related to transient problems.Default value is
true. -
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. The default value is10minutes for Browser monitors. -
The APM service name.
-
An array of tags.
-
The monitor timeout in seconds. The monitor will fail if it doesn't complete within this time.
For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts are only applied when the monitor runs on private locations. If a browser monitor specifies a timeout but has no private locations configured, the timeout will have no effect and a warning will be returned in the response.
Default value is
16. -
The host to ping.
-
The monitor type.
-
The wait time in seconds.
Default value is
1.
Hide attributes Show attributes
-
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
Specify whether the monitor is enabled.
Default value is
true. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
The location to deploy the monitor. 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 you can:
- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Management and click Create monitor. Locations will be listed in Locations.
- Run the
-
The monitor name.
-
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-.Default value is
default. -
The monitor parameters.
-
The private locations to which the monitors will be deployed. These private locations refer to locations 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 you can:- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Settings and click Private locationsr. Private locations will be listed in the table.
You can provide
locationsorprivate_locationsor both. At least one is required. - Run the
-
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 will be created and if configured, an alert sent. The monitor will then resume running according to the defined schedule. Using
retest_on_failurecan reduce noise related to transient problems.Default value is
true. -
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. The default value is10minutes for Browser monitors. -
The APM service name.
-
An array of tags.
-
The monitor timeout in seconds. The monitor will fail if it doesn't complete within this time.
For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts are only applied when the monitor runs on private locations. If a browser monitor specifies a timeout but has no private locations configured, the timeout will have no effect and a warning will be returned in the response.
Default value is
16. -
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".
-
The URL of the SOCKS5 proxy to use when connecting to the server. The value must be a URL with a scheme of
socks5://. If the SOCKS5 proxy server requires client authentication, then a username and password can be embedded in the URL. When using a proxy, hostnames are resolved on the proxy server instead of on the client. You can change this behavior by setting theproxy_use_local_resolveroption. -
Specify that hostnames are resolved locally instead of being resolved on the proxy server. If
false, name resolution occurs on the proxy server.Default value is
false. -
The TLS/SSL connection settings for use with the HTTPS endpoint. If you don't specify settings, the system defaults are used.
-
The monitor type.
Hide attributes Show attributes
-
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. -
Specify whether the monitor is enabled.
Default value is
true. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
The location to deploy the monitor. 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 you can:
- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Management and click Create monitor. Locations will be listed in Locations.
- Run the
-
The monitor name.
-
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-.Default value is
default. -
The monitor parameters.
-
The private locations to which the monitors will be deployed. These private locations refer to locations 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 you can:- Run the
elastic-synthetics locationscommand with the deployment's Kibana URL. - Go to Synthetics > Settings and click Private locationsr. Private locations will be listed in the table.
You can provide
locationsorprivate_locationsor both. At least one is required. - Run the
-
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 will be created and if configured, an alert sent. The monitor will then resume running according to the defined schedule. Using
retest_on_failurecan reduce noise related to transient problems.Default value is
true. -
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. The default value is10minutes for Browser monitors. -
The APM service name.
-
An array of tags.
-
The monitor timeout in seconds. The monitor will fail if it doesn't complete within this time.
For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts are only applied when the monitor runs on private locations. If a browser monitor specifies a timeout but has no private locations configured, the timeout will have no effect and a warning will be returned in the response.
Default value is
16. -
PEM certificates whose public keys (SPKI) are allowlisted so the API request context bypasses certificate errors for matching presented certificates. This does not add a CA to the trust store.
Default value is
[](empty). -
Ignore HTTPS errors.
Default value is
false. -
The inline API Journey script.
-
Playwright API request context options.
-
Synthetics agent CLI arguments.
-
The monitor type.
-
Responses
-
A successful response.
created: falseindicates an individual Saved Object creation or Fleet synchronization failure; seeerror. Batch-level Fleet synchronization errors are returned inerrors.Hide response attributes Show response attributes object
-
Optional service-level errors from the bulk sync.
-
-
Bad request. Returned when the batch is empty or too large, a monitor configuration is invalid, or two monitors use the same name.
curl \
--request POST 'https://localhost:5601/api/synthetics/monitors/_bulk_create' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"monitors": [
{
"type": "http",
"name": "Storefront",
"url": "https://example.com",
"locations": ["united_kingdom"]
},
{
"type": "http",
"name": "Documentation",
"url": "https://docs.example.com",
"locations": ["united_kingdom"]
}
]
}'
{
"monitors": [
{
"type": "http",
"name": "Storefront",
"url": "https://example.com",
"locations": ["united_kingdom"]
},
{
"type": "http",
"name": "Documentation",
"url": "https://docs.example.com",
"locations": ["united_kingdom"]
}
]
}
{
"result": [
{
"id": "monitor1-id",
"created": true
},
{
"id": "monitor2-id",
"created": true
}
]
}