Skip to main content
POST /workflows Create a new agent (funnel + statuses) from scratch — entirely via API. This is the first step in the API-first agent lifecycle:
  1. Create the agent (this endpoint). It’s born paused.
  2. Set its prompt — what it says and how it behaves.
  3. Optionally add custom statuses/fields or custom tools it can call.
  4. Activate it by setting is_paused: false.
Idempotent. If an agent with the same name already exists on your account, this returns the existing one (status: "existed") instead of creating a duplicate — safe to retry.

Request Body

Available goals

Onboarding also offers Qualify, then book. That option is stored as appointment with a qualification pipeline and rules; do not send qualify_then_book to this public endpoint.

The custom goal

Use custom when the agent’s objective is not one of the preset goals — debt collection, client win-back, post-sale follow-up, or surveys. The agent pursues an objective written in the operator’s own words, configured in the Dashboard under Agent settings → Goal and stored as config.goal_statement. It accepts up to 600 characters and should describe the outcome, not the procedure. Two things to know:
  • A custom agent does not schedule meetings — the calendar tools are not available to it. If the goal ends in a booked meeting, use appointment.
  • You must send statuses as with every other goal. This endpoint does not infer the pipeline; a typical custom setup can use new → contacted → engaged → converted → lost with transition instructions adapted to the written outcome.

statuses[] shape

Responses

201 — Agent created

200 — Already existed (idempotent replay)

400 — Validation error

Other validation errors:
  • "goal_type must be one of: appointment, sale, qualification, information, payment_link, support, custom, quote, document_collection"
  • "statuses must be a non-empty array"
  • "each status needs a key and a name"

401 — Authentication error

See Authentication.

500 — Internal server error

Last modified on August 9, 2026