---
title: "Execute Runbook"
method: POST
path: "/runbooks/execute"
tags: ["DR Runbooks"]
---

# Execute Runbook

`POST /runbooks/execute`

## Request

- Base URL: `https://api.continueops.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.continueops.com/runbooks/execute`
- Auth: API key in header `X-Runner-Key`

Create a dr_runs row, seed dr_run_steps from the YAML, enqueue the job.

The tenant_id is the Supabase auth user.id (uuid as string). All DB writes
use the user's uuid for RLS tenant isolation.

## Request body

- ExecuteRunbookRequest
  - `tenant_id` string, required: Tenant (= Supabase auth user.id) as UUID string
  - `credential_id` string, uuid, required: Which stored cloud credential to use
  - `runbook_name` string, required: Display name / slug of the runbook
  - `runbook_path` string, nullable: Supabase Storage path to a user-supplied runbook YAML. Mutually exclusive with runbook_builtin.
  - `runbook_builtin` string, nullable: Slug of a baked-in runbook (e.g. 's3-route53-failover' or 'aws/s3-route53-failover'). Mutually exclusive with runbook_path.
  - `variables` object: Resolved runbook variables
  - `execute_on` 'continueops' | 'agent': Which executor runs the job. 'continueops' (default) enqueues to the CPLN-hosted cont-dr-runner via Redis. 'agent' skips Redis and leaves the dr_runs row pending so an enrolled in-VPC dr-agent picks it up via /agent/v1/jobs/poll.

## Response `200`

Successful Response

- ExecuteRunbookResponse
  - `run_id` string, uuid, required
  - `status` 'pending' | 'running' | 'completed' | 'failed' | 'cancelled'
  - `started_at` string, date-time, required
  - `steps` DrStepOut[], required
    - `step_id` string, uuid, required
    - `step_order` integer, required
    - `step_name` string, required
    - `step_type` 'validate' | 'execute' | 'approve' | 'monitor' | 'rollback', required
    - `status` 'pending' | 'running' | 'completed' | 'failed' | 'skipped', required
    - `command` string, nullable
    - `stdout` string, nullable
    - `stderr` string, nullable
    - `exit_code` integer, nullable
    - `captured_vars` object, nullable
    - `started_at` string, date-time, nullable
    - `finished_at` string, date-time, nullable
    - `error_message` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/continueops/apis/cloud-credential-proxy.md) · [All operations](https://skmtc.dev/continueops/apis/cloud-credential-proxy/llms.txt) · [OpenAPI document](https://skmtc.dev/continueops/apis/cloud-credential-proxy/revisions/f0940e341f41?raw)
