API referenceWorkflows

Save workflow

Creates a workflow from spec, or updates an existing one when workflowId is given.

POST
/v1/brands/{brandId}/workflows
bearerAuth
headerAuthorizationBearer <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*integer

The brand the request acts on. Every brand-scoped resource lives under its brand.

Idempotency-Key?string

Retrying with the same key within 24 hours returns the first response without acting again.

Lengthlength <= 255
application/json
  1. body
workflowId?string
Match^[1-9]\d*$
Length1 <= length
name?string
type?string
Value in"visual""agent""template"
spec*

Full workflow spec: { name, type, trigger, triggerAdded, nodes[], agentPrompt? }

Response Body

Save workflow

application/json
  1. response
[key: string]?unknown
curl -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.