---
title: "Create the one editable workflow draft for a hosted agent"
method: POST
path: "/v1/agents/{agent_id}/workflow"
---

# Create the one editable workflow draft for a hosted agent

`POST /v1/agents/{agent_id}/workflow`

## Request

- Base URL: `https://api.skysay.ai`
- URL: `https://api.skysay.ai/v1/agents/{agent_id}/workflow`
- Auth: none declared

Creates only a workflow draft: no publish, call, tool authorization, or number attachment. From a starter template (blank, payment_reminder, payment_reminder_variables, customer_support, receptionist), blank, or a natural-language 'brief' generated by AI. template_id and brief are mutually exclusive. A brief that the model returns unreadable fails closed (400) and creates nothing; a readable-but-invalid AI-generated graph is still created so the canvas can show what needs fixing. Fails with a conflict if this agent already has a workflow -- edit the existing draft instead.

## Path parameters

- `agent_id` string, required

## Request body

- object
  - `brief` string
  - `name` string
  - `template_id` 'blank' | 'payment_reminder' | 'payment_reminder_variables' | 'customer_support' | 'receptionist'

## Response `201`

Created workflow draft

## Other responses

- `400`: Both template_id and brief given, unknown template, or the AI generation provider is unavailable/unreadable
- `409`: Agent already has a workflow

---

[API](https://skmtc.dev/skysay/apis/skysay-api.md) · [All operations](https://skmtc.dev/skysay/apis/skysay-api/llms.txt) · [OpenAPI document](https://skmtc.dev/skysay/apis/skysay-api/revisions/95b8c66f99aa?raw)
