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.
[Required authorization] Route required privileges: uptime-read AND uptime-write.
Body
-
Create a synthetics monitor. Required and default fields vary by type (HTTP, TCP, ICMP, browser, or API).
At least
1but not more than1000elements.Create a synthetics monitor. Required and default fields vary by type (HTTP, TCP, ICMP, browser, or API).
One of: Hide attributes Show attributes
-
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }.Additional properties are allowed.
Hide alert attributes Show alert attributes object
-
The check request settings, as nested
requestandresponseobjects. -
Optional request body content.
-
A dictionary of additional HTTP headers to send. By default, Synthetics sets the User-Agent header to identify itself.
-
The HTTP method to use:
HEAD,GET,POST, orOPTIONS. -
A dictionary of expected HTTP headers. If the header is not found, the check fails.
-
Specify whether the monitor is enabled. Defaults to
true. -
If
true, ping using the ipv4 protocol. Defaults totrue. -
If
true, ping using the ipv6 protocol. Defaults totrue. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
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.Not more than
1000elements. -
The IDs of the maintenance windows to apply to the monitor.
Not more than
1000elements. Maximum length of each is1024. -
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 are
anyorall. -
The monitor name.
Maximum length is
4096. -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
The password for authenticating with the server. The credentials are passed with the request.
-
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.Not more than
1000elements. -
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.contentsfield. -
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. -
The APM service name.
-
The IDs of additional spaces to make the monitor available in, besides the current space.
Not more than
1000elements. Maximum length of each is1024. -
The TLS/SSL connection settings for use with the HTTPS endpoint. If you don't specify settings, the system defaults are used.
- timeout
string | null | 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.
-
The monitor type.
Value is
http. -
The URL to monitor.
Maximum length is
4096. -
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 } }.Additional properties are allowed.
Hide alert attributes Show alert attributes object
-
The check request settings, as nested
requestandresponseobjects. -
Specify whether the monitor is enabled. Defaults to
true. -
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".
Maximum length is
4096. -
If
true, ping using the ipv4 protocol. Defaults totrue. -
If
true, ping using the ipv6 protocol. Defaults totrue. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
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.Not more than
1000elements. -
The IDs of the maintenance windows to apply to the monitor.
Not more than
1000elements. Maximum length of each is1024. -
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 are
anyorall. -
The monitor name.
Maximum length is
4096. -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
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.Not more than
1000elements. -
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, 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, unlessproxy_use_local_resolveris set. -
Specify that hostnames are resolved locally instead of being resolved on the proxy server. If
false, name resolution occurs on the proxy server. Defaults tofalse. -
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. -
The APM service name.
-
The IDs of additional spaces to make the monitor available in, besides the current space.
Not more than
1000elements. Maximum length of each is1024. -
The TLS/SSL connection settings for use with the HTTPS endpoint. If you don't specify settings, the system defaults are used.
- timeout
string | null | 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.
-
The monitor type.
Value is
tcp.
Hide attributes Show attributes
-
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }.Additional properties are allowed.
Hide alert attributes Show alert attributes object
-
Specify whether the monitor is enabled. Defaults to
true. -
The host to ping.
Maximum length is
4096. -
If
true, ping using the ipv4 protocol. Defaults totrue. -
If
true, ping using the ipv6 protocol. Defaults totrue. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
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.Not more than
1000elements. -
The IDs of the maintenance windows to apply to the monitor.
Not more than
1000elements. Maximum length of each is1024. -
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 are
anyorall. -
The monitor name.
Maximum length is
4096. -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
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.Not more than
1000elements. -
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. -
The APM service name.
-
The IDs of additional spaces to make the monitor available in, besides the current space.
Not more than
1000elements. Maximum length of each is1024. - timeout
string | null | 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.
-
The monitor type.
Value is
icmp. -
The wait time in seconds. Defaults to
1.
Hide attributes Show attributes
-
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }.Additional properties are allowed.
Hide alert attributes Show alert attributes object
-
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.
-
Specify whether the monitor is enabled. Defaults to
true. -
Ignore HTTPS errors. Defaults to
false. -
The inline script.
Maximum length is
1000000. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
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.Not more than
1000elements. -
The IDs of the maintenance windows to apply to the monitor.
Not more than
1000elements. Maximum length of each is1024. -
The monitor name.
Maximum length is
4096. -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
Playwright options.
-
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.Not more than
1000elements. -
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. -
The screenshot option:
on,off, oronly-on-failure. Defaults toon. -
The APM service name.
-
The IDs of additional spaces to make the monitor available in, besides the current space.
Not more than
1000elements. Maximum length of each is1024. -
The TLS/SSL connection settings for use with the HTTPS endpoint. If you don't specify settings, the system defaults are used.
-
Synthetics agent CLI arguments.
- timeout
string | null | 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.
-
The monitor type.
Value is
browser.
Hide attributes Show attributes
-
The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }.Additional properties are allowed.
Hide alert attributes Show alert attributes object
-
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.
-
Specify whether the monitor is enabled. Defaults to
true. -
Ignore HTTPS errors. Defaults to
false. -
The inline script.
Maximum length is
1000000. -
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
-
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.Not more than
1000elements. -
The IDs of the maintenance windows to apply to the monitor.
Not more than
1000elements. Maximum length of each is1024. -
The monitor name.
Maximum length is
4096. -
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. Defaults todefault. -
Playwright options.
-
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.Not more than
1000elements. -
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. -
The APM service name.
-
The IDs of additional spaces to make the monitor available in, besides the current space.
Not more than
1000elements. Maximum length of each is1024. -
The TLS/SSL connection settings for use with the HTTPS endpoint. If you don't specify settings, the system defaults are used.
-
Synthetics agent CLI arguments.
- timeout
string | null | 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.
-
The monitor type.
Value is
api.
-
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 \
-X POST "${KIBANA_URL}/api/synthetics/monitors/_bulk_create" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{"monitors":[{"type":"http","name":"Storefront","url":"https://example.com","locations":["united_kingdom"]},{"type":"http","name":"Documentation","url":"https://docs.example.com","locations":["united_kingdom"]}]}'
POST kbn://api/synthetics/monitors/_bulk_create
{"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": [
{
"locations": [
"united_kingdom"
],
"name": "Storefront",
"type": "http",
"url": "https://example.com"
},
{
"locations": [
"united_kingdom"
],
"name": "Documentation",
"type": "http",
"url": "https://docs.example.com"
}
]
}
{
"result": [
{
"created": true,
"id": "monitor1-id"
},
{
"created": true,
"id": "monitor2-id"
}
]
}