dunops.com/Docsbeta

API reference

REST API

The DunOps REST API gives you programmatic access to workspaces, runs, playbooks, and providers.

Base URL

bash
https://api.dunops.com/v1

All endpoints are versioned. The current stable version is v1. Pass DunOps-Version: 2026-01-01 to pin to a specific release and avoid breaking changes from future updates.


Common patterns

PatternDescription
GET /workspaces/meReturn the authenticated workspace
GET /playbooksList all playbooks in the workspace
POST /playbooks/:id/runsTrigger a playbook run
GET /runs/:idPoll the status of a run
GET /providersList connected providers

All list endpoints return a data array and a meta object with total, page, and per_page.


Example: trigger a playbook run

bash
# Trigger a playbook run
curl -X POST https://api.dunops.com/v1/playbooks/pb_1234/runs \
  -H "Authorization: Bearer dk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"inputs": {"branch": "main", "environment": "production"}}'

# Poll the run status
curl https://api.dunops.com/v1/runs/run_5678 \
  -H "Authorization: Bearer dk_live_..."
Run response (excerpt)
{
  "id": "run_5678",
  "status": "running",
  "playbook_id": "pb_1234",
  "started_at": "2026-06-17T12:00:00Z",
  "steps": [
    { "id": "step_1", "status": "succeeded", "capability": "vercel.create-deployment" },
    { "id": "step_2", "status": "waiting_approval" }
  ]
}

Error responses

StatusMeaning
400Bad request — check the request body
401Invalid or missing API key
403Key lacks permission for this action
404Resource not found
429Rate limit exceeded — see Rate limits
500DunOps internal error — transient, safe to retry

Next steps