Bulk create check rules
/api/alerting/check-rules/bulkAtomically create up to 1000 Prometheus alert rules in a single request.
Create-only — every item produces a brand-new check rule. The public
schema uses id as the user-defined origin; per-item resolution
priority mirrors the single-rule POST handler (id → server-generated
UUID with "api-" prefix). Any item whose resolved origin or id
collides with an existing rule (including soft-deleted rules whose
origin is still reserved by the unique constraint) is rejected with a
per-item diagnostic.
If any item fails validation (PromQL, intervals, summary length, template functions, origin/id collision, etc.) the whole batch is rejected with a 400 that carries per-item diagnostics in the message; nothing is written. On any DB failure the entire batch is rolled back and 500 is returned. The endpoint is not idempotent — a successful batch retried verbatim will 400 on every item the second time.
This endpoint accepts request bodies up to 2 MB (vs. the 256 KB default for other endpoints) to accommodate batched payloads of up to 1000 rules per request.
Parameters 1
datasetqueryrequiredThe dataset to deploy rules into. Required to prevent accidental deployment to the wrong dataset.
Optional dataset to query across. Defaults to whatever is configured to be the default dataset for the organization.
"^[a-zA-Z0-9_-]{3,26}$"Sample request1234567891011curl --request POST 'https://api.eu-west-1.aws.dash0.com/api/alerting/check-rules/bulk?dataset=default' \--header "Authorization: Bearer ${DASH0_AUTH_TOKEN}" \--header 'Content-Type: application/json' \--data-raw '{"items": [{"name": "Example","expression": "up == 0"}]}'
Request body required
Responses
All items were successfully created.
Number of check rules that were newly created.