API referenceWorkflows
Save workflow
Creates a workflow from spec, or updates an existing one when workflowId is given.
POST
bearerAuthheader
AuthorizationBearer <token>An organization API key (koast_sk_…) with the API surface enabled, or an OAuth access token issued by Koast (koast_at_…) whose audience covers this API. REST access requires an active Agency plan.
brandId*integerThe brand the request acts on. Every brand-scoped resource lives under its brand.
Idempotency-Key?stringRetrying with the same key within 24 hours returns the first response without acting again.
Length
length <= 255application/json- body
workflowId?stringMatch
^[1-9]\d*$Length
1 <= lengthname?stringtype?stringValue in
"visual""agent""template"spec*Full workflow spec: { name, type, trigger, triggerAdded, nodes[], agentPrompt? }
Save workflow
application/json- response
[key: string]?unknowncurl -X POST "https://example.com/v1/brands/0/workflows" \ -H "Authorization: Bearer koast_sk_..." \ -H "Content-Type: application/json" \ -d '{ "spec": { "property1": null, "property2": null } }'{ "property1": null, "property2": null}Required scope: write. CLI: koast save-workflow, see Workflows commands. Authentication, headers, errors and pagination work the same on every operation. See Conventions.