Bulk update monitors added in 9.5.0

PUT /api/synthetics/monitors/_bulk_update

Spaces method and path for this operation:

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

Refer to Spaces for more information.

Partially update multiple monitors in a single request. Each updates entry has its own id and attributes patch, so one request can apply a different change per monitor. Unspecified fields are left unchanged. Patches use the same merge, validate, and encrypt path as PUT /api/synthetics/monitors/{id}. For private-location monitors, Fleet is synced once for the batch instead of once per monitor. You must have all privileges for the Synthetics feature in the Observability section of the Kibana feature privileges. This is a versioned public API (elastic-api-version: 2023-10-31).

application/json

Body Required

  • updates array[object] Required

    Monitors to update. Minimum 1 entry, maximum 1000. Each id may appear at most once. attributes must contain at least one field.

    At least 1 but not more than 1000 elements.

    Hide updates attributes Show updates attributes object
    • attributes object Required

      Attributes to update for the monitor. You can specify the same fields as in PUT /api/synthetics/monitors/{id}. An empty object is rejected.

      Additional properties are allowed.

    • id string Required

      The monitor config ID to update.

      Minimum length is 1, maximum length is 1024.

Responses

  • 200 application/json

    A successful response. The result array is in request order. Per-id failures (not found, validation, Fleet sync) set updated: false and error without failing the whole batch. errors is present only when there are service-level sync 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
      • error string

        Present when updated is false.

      • id string Required

        The monitor config ID from the request.

      • updated boolean Required

        If true, the monitor was updated. If false, see error.

  • 400

    Bad request. Returned when updates is missing or empty, an attributes object is empty, or the same id appears more than once.

PUT /api/synthetics/monitors/_bulk_update
curl \
 --request PUT 'https://localhost:5601/api/synthetics/monitors/_bulk_update' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{
  "updates": [
    {
      "id": "monitor1-id",
      "attributes": {
        "enabled": false
      }
    },
    {
      "id": "monitor2-id",
      "attributes": {
        "tags": ["bulk-patched"]
      }
    },
    {
      "id": "monitor3-id",
      "attributes": {
        "schedule": {
          "number": "15",
          "unit": "m"
        }
      }
    }
  ]
}'
Request example
Run `PUT /api/synthetics/monitors/_bulk_update` to apply a different partial update to each monitor.
{
  "updates": [
    {
      "id": "monitor1-id",
      "attributes": {
        "enabled": false
      }
    },
    {
      "id": "monitor2-id",
      "attributes": {
        "tags": ["bulk-patched"]
      }
    },
    {
      "id": "monitor3-id",
      "attributes": {
        "schedule": {
          "number": "15",
          "unit": "m"
        }
      }
    }
  ]
}
Response examples (200)
A response from a bulk update with one failure.
{
  "result": [
    {
      "id": "monitor1-id",
      "updated": true
    },
    {
      "id": "missing-id",
      "updated": false,
      "error": "Monitor id missing-id not found!"
    },
    {
      "id": "monitor3-id",
      "updated": true
    }
  ]
}