> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create workflow draft

> Success

### Path parameters

<ParamField path="brand_id" type="string (uuid)" required />

### Request body

`CreateWorkflowDraftRequest`

<ParamField body="title" type="string" required />

<ParamField body="recipe_key" type="string" required />

<ParamField body="recipe_version" type="integer" required />

<ParamField body="spec" type="object" required>
  Non-executable draft specification; maximum encoded size 256 KiB.
</ParamField>

### Response

`WorkflowDraft`

<ResponseField name="id" type="string (uuid)" required />

<ResponseField name="brand_id" type="string (uuid)" required />

<ResponseField name="title" type="string" required />

<ResponseField name="recipe_key" type="string" required />

<ResponseField name="recipe_version" type="integer" required />

<ResponseField name="spec" type="object" required />

<ResponseField name="version" type="integer" required />

<ResponseField name="created_by" type="string" required />

<ResponseField name="updated_by" type="string" required />

<ResponseField name="created_at" type="string (date-time)" required />

<ResponseField name="updated_at" type="string (date-time)" required />

### Status codes

| Code  | Meaning          |
| ----- | ---------------- |
| `201` | Success          |
| `400` | Validation error |
| `401` | Unauthorized     |
| `404` | Not found        |
| `429` | Rate limited     |
| `500` | Internal error   |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.workstream.stateset.com/v1/brands/{brand_id}/workflow-drafts' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "title": "string",
    "recipe_key": "string",
    "recipe_version": 1,
    "spec": {}
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "brand_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "title": "string",
    "recipe_key": "string",
    "recipe_version": 1,
    "spec": {},
    "version": 1,
    "created_by": "string",
    "updated_by": "string",
    "created_at": "2026-07-24T12:00:00Z",
    "updated_at": "2026-07-24T12:00:00Z"
  }
  ```
</ResponseExample>
