Bulk create monitors

POST /api/synthetics/monitors/_bulk_create

Spaces method and path for this operation:

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. This is a versioned public API (elastic-api-version: 2023-10-31).

application/json

Body Required

  • monitors array[object] Required

    A non-empty list of monitor configurations, up to 1000 monitors.

    At least 1 but not more than 1000 elements.

    One of:

Responses

  • 200 application/json

    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.

    Hide response attributes Show response attributes object
    • errors array

      Optional service-level errors from the bulk sync.

    • result array[object] Required
      Hide result attributes Show result attributes object
      • created boolean Required

        Whether the monitor Saved Object was created.

      • error string

        Present when created is false.

      • id string Required

        The config ID of the created monitor.

  • 400

    Bad request. Returned when the batch is empty or too large, a monitor configuration is invalid, or two monitors use the same name.

POST /api/synthetics/monitors/_bulk_create
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"]
    }
  ]
}'
Request example
{
  "monitors": [
    {
      "type": "http",
      "name": "Storefront",
      "url": "https://example.com",
      "locations": ["united_kingdom"]
    },
    {
      "type": "http",
      "name": "Documentation",
      "url": "https://docs.example.com",
      "locations": ["united_kingdom"]
    }
  ]
}
Response examples (200)
{
  "result": [
    {
      "id": "monitor1-id",
      "created": true
    },
    {
      "id": "monitor2-id",
      "created": true
    }
  ]
}