POST
Create Workflow From Template
Опишите тип звонка, задачу и нужные действия агента. Агентика подготовит сценарий: шаги, инструкции и переходы. Результат можно изменить через обновление агента, затем протестировать и опубликовать. Если работаете в панели, начните с Создать агента → Визард и следуйте руководству первого разговора.
Несмотря на путь, этот эндпоинт не имеет отношения к галерее шаблонов. Он не принимает id шаблона и не читает сохранённые шаблоны — он генерирует новый граф по вашему описанию. Чтобы создать агента из сохранённого или системного шаблона, используйте POST /api/v1/workflow/templates/duplicate. См. Шаблоны.

Повтор запроса без дублей

Если ответ потерялся, агент уже мог быть создан. Для предусмотренного этой операцией повтора передавайте заголовок Idempotency-Key: уникальный ключ для одной попытки создания. При повторе с тем же ключом отправляйте то же тело запроса. В пределах срока хранения ключа сервер вернёт результат первой попытки; у такого ответа есть заголовок Idempotent-Replayed: true. Изменённое тело с прежним ключом отклоняется с 422 и кодом idempotency_key_reuse. Срок хранения ключа и время ожидания незавершённой попытки задаются платформой. Неверный формат ключа отклоняется; требования смотрите в схеме операции.

Headers

Idempotency-Key
string | null

Optional client-generated key (1-128 printable chars). A repeat POST with the same key by the same user in the same organization within the replay window (platform setting workflow.creation_idempotency.ttl_days, fixed per key when it is first used) returns the workflow the first request created (response header Idempotent-Replayed: true) instead of creating a duplicate, even for concurrent requests: while the first request is still generating, a repeat gets 409 creation_in_progress with Retry-After; a replay of an archived workflow is 409 workflow_archived. Ignored for dry_run=true (nothing is created, so nothing is replayed).

authorization
string | null
X-API-Key
string | null

Body

application/json
call_type
enum<string>
required
Available options:
inbound,
outbound
use_case
string
required
activity_description
string
required
tone
enum<string> | null
Available options:
friendly,
professional,
business,
caring,
neutral
goals
string[] | null
Maximum array length: 10
Maximum string length: 200
collect_fields
TemplateCollectField · object[] | null
Maximum array length: 50
first_message_hint
string | null
Maximum string length: 500
business_card
Business Card · object | null
gender
enum<string> | null
Available options:
male,
female
agent_name
string | null
language
enum<string> | null
Available options:
ru,
en
origin
string | null
Allowed value: "wizard"
dry_run
boolean
default:false

Response

Successful Response

id
integer
required
name
string
required
status
string
required
created_at
string<date-time>
required
workflow_definition
Workflow Definition · object
required
current_definition_id
integer | null
required
template_context_variables
Template Context Variables · object | null
call_disposition_codes
CallDispositionCodes · object | null
target_actions
TargetActionsConfig · object | null

The stored layer: {"actions": []} means explicitly off; the model itself is absent (NULL column) when the level inherits.

total_runs
integer | null
workflow_configurations
Workflow Configurations · object | null
version_number
integer | null
version_status
string | null
workflow_uuid
string | null
model_is_realtime
boolean | null

Whether the effective model of the returned workflow_configurations (draft if any, else published) is realtime — the runtime's resolution: the workflow's model_configuration_v2_override, else the organization's configuration with legacy model_overrides. A realtime model does not support conversation_start_policy wait_client / wait_then_greeting (saving that combination is 422 start_policy_unsupported_for_realtime). null: not computed by this endpoint, or the model configuration does not resolve.