---
title: "Run a batch of chaos tests in parallel"
method: POST
path: "/chaos/batch"
tags: ["Execute"]
---

# Run a batch of chaos tests in parallel

`POST /chaos/batch`

## Request

- Base URL: `https://www.cloudworldmodel.ai/api`
- URL: `https://www.cloudworldmodel.ai/api/chaos/batch`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-PAYMENT`
  - API key in header `PAYMENT-SIGNATURE`

Execute multiple chaos engineering tests in parallel. Each scenario can use either
a pre-built scenario or custom failure injections. Results are aggregated across all tests.

**DigitalOcean compatibility:** All pre-built scenarios (`zone_failure`, `database_crash`,
`network_partition`, etc.) and custom injection types (`kill_instance`, `zone_outage`,
`database_slowdown`, etc.) work identically on DigitalOcean simulations.
Use Droplet-specific resource IDs (e.g. `droplet-web-1`) and DO datacenter region names
(e.g. `nyc3`, `sfo3`) when targeting a DigitalOcean simulation.

## Request body

- object
  - `simulationId` string, uuid, required: ID of the base simulation to test
  - `scenarios` object[], required: Array of chaos test scenarios to execute in parallel
    - `scenarioId` 'zone_failure' | 'database_crash' | 'network_partition' | 'cascading_failure' | 'random_instance_failure' | 'database_slowdown': Pre-built scenario ID (optional, mutually exclusive with customInjections)
    - `promotionDelaySeconds` integer: Prebuilt database_crash scenario only: simulated replica promotion delay (default 30 seconds); not a provider SLA. Cannot be combined with customInjections.
    - `restartDelaySeconds` integer: Prebuilt database_crash scenario only: simulated sole-writer restart delay (default 1800 seconds); not a provider SLA. Cannot be combined with customInjections.
    - `customInjections` object[]: Custom failure injections (optional, mutually exclusive with scenarioId)
      - `failureType` 'database_crash' | 'database_slowdown' | 'database_overload' | 'zone_outage' | 'region_outage' | 'permanent_data_loss' | 'instance_failure' | 'eks_spot_interruption' | 'network_latency' | 'network_partition' | 'cascading_failure' | 'cpu_stress', required: Type of failure to inject
      - `targetResourceId` string: Internal ID of the specific resource to target (optional)
      - `targetResourceName` string: Resource display name to target instead of an internal ID. Resolved case-insensitively — exact name match first, then unique-prefix match (e.g. "aws-server" finds "aws-server-01"). If the name matches multiple resources the request fails with 400 and a `candidates` list of matching resources.
      - `targetZone` string: Availability zone to target (optional, e.g. for zone_outage)
      - `targetRegion` string: Canonical region key for region_outage or permanent_data_loss.
      - `targetProvider` 'aws' | 'gcp' | 'azure' | 'oci' | 'digitalocean': Cloud provider to scope the injection to (optional)
      - `duration` number: How long the failure lasts in simulation seconds (optional)
      - `promotionDelaySeconds` integer: database_crash only: explicit replica promotion delay in simulation seconds (default 30); not a provider SLA.
      - `restartDelaySeconds` integer: database_crash only: sole-writer restart delay after injection ends in simulation seconds (default 1800); not a provider SLA.
      - `intensity` number: Failure severity from 0 (minimal) to 100 (maximum, optional)
      - `startTime` number: Simulation time at which the failure begins (optional)
    - `duration` integer: Test duration in simulation steps
  - `webhookUrl` string, uri: Optional HTTPS URL to receive webhook notification when batch completes
  - `webhookSecret` string: Optional secret for HMAC-SHA256 webhook signature verification

## Response `202`

Batch chaos test job accepted and started

- object
  - `job` object
    - `id` string, uuid
    - `type` 'batch_chaos_test'
    - `status` 'pending' | 'running'
    - `totalJobs` integer: Number of child chaos tests in this batch
    - `createdAt` string, date-time
  - `message` string

## Other responses

- `400`: Invalid request data — structured field-level error
- `401`: Authentication required or invalid API key
- `402`: Payment required — the endpoint is metered and no API key was provided. The response body follows the [x402 v2 protocol](https://x402.org) and describes one or more USDC payment options that the caller can select before retrying the request. Base is always the first option and uses `X-PAYMENT`. When an `accepts` entry for Solana is present, it is an additional USDC-SPL option that uses `PAYMENT-SIGNATURE` and its `extra.feePayer` value. The server verifies either payment through the PayAI facilitator at `https://facilitator.payai.network`. The `PAYMENT-REQUIRED` response header carries this entire JSON body as a base64-encoded string for protocol-aware clients. Call `GET /api/billing/x402/config` to retrieve the current price table and wallet address and `paymentOptions` before constructing a payment.
- `404`: Simulation not found
- `429`: Rate limit exceeded — slow down requests or upgrade your API key's rate limit

---

[API](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api.md) · [All operations](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api/revisions/ecc3ad1ff07f?raw)
