Workflows
Create a workflow
Save a workflow, agent, bot or campaign.
The same row Studio and the MCP tools show. yaml is validated against the CNL schema and the kind lint before anything is stored (a bot on a frozen runtime such as harness-agent with posture is refused). folder names an existing folder or creates it. A kind: campaign create with campaign_config also sets up the ledger and the schedule. Save as YAML: send the pure workflow YAML as a text/yaml body and the metadata as the kind (required), name (required unless workflow.name is in the YAML), description and folder query parameters; a YAML body without kind is 400 invalid_request, and campaign_config stays JSON-only.
Authorizations
Authorization: Bearer ozk_…. ozk_ platform API key (Authorization: Bearer ozk_…)Query parameters
Available options: workflow, agent, bot, campaign
workflow.name is in the YAML (the query wins when both are set). PATCH: renamesMaximum string length: 200
folder fieldMaximum string length: 120
Body
application/jsontext/yaml
Maximum string length: 200
Available options: workflow, agent, bot, campaign
Maximum string length: 120
Available options: json, yaml, markdown, text
Response
Saved; the Location header names the new workflow. Response format negotiates via the format field, an Accept header (application/json, text/yaml, text/markdown, text/plain), or the request Content-Type mirror; default JSON.
application/jsontext/yamltext/markdowntext/plain
invalid_json / invalid_yaml / invalid_body — unreadable body; invalid_format — format must be one of json, yaml, markdown, text
application/json
unauthorized — missing, invalid or revoked ozk_ key
application/json
not_found — no route for this method on this path: every other method answers it
application/json
payload_too_large — body over 1 MiB (MAX_REQUEST_SIZE)
application/json
invalid_workflow — the YAML failed validation or the kind lint (the envelope carries errors and warnings; nothing was written). invalid_params — a field is missing or malformed
application/json
storage_error — the database or storage layer failed; no detail is returned, retry
application/json