curl --request POST \
--url https://app.agentika.site/api/v1/workflow/create/template \
--header 'Content-Type: application/json' \
--data '
{
"use_case": "<string>",
"activity_description": "<string>",
"goals": [
"<string>"
],
"collect_fields": [
{
"name": "<string>",
"question": "<string>",
"required": false,
"on_refusal": "<string>"
}
],
"first_message_hint": "<string>",
"business_card": {},
"agent_name": "<string>",
"origin": "wizard",
"dry_run": false
}
'import requests
url = "https://app.agentika.site/api/v1/workflow/create/template"
payload = {
"use_case": "<string>",
"activity_description": "<string>",
"goals": ["<string>"],
"collect_fields": [
{
"name": "<string>",
"question": "<string>",
"required": False,
"on_refusal": "<string>"
}
],
"first_message_hint": "<string>",
"business_card": {},
"agent_name": "<string>",
"origin": "wizard",
"dry_run": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
use_case: '<string>',
activity_description: '<string>',
goals: ['<string>'],
collect_fields: [
{
name: '<string>',
question: '<string>',
required: false,
on_refusal: '<string>'
}
],
first_message_hint: '<string>',
business_card: {},
agent_name: '<string>',
origin: 'wizard',
dry_run: false
})
};
fetch('https://app.agentika.site/api/v1/workflow/create/template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.agentika.site/api/v1/workflow/create/template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'use_case' => '<string>',
'activity_description' => '<string>',
'goals' => [
'<string>'
],
'collect_fields' => [
[
'name' => '<string>',
'question' => '<string>',
'required' => false,
'on_refusal' => '<string>'
]
],
'first_message_hint' => '<string>',
'business_card' => [
],
'agent_name' => '<string>',
'origin' => 'wizard',
'dry_run' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.agentika.site/api/v1/workflow/create/template"
payload := strings.NewReader("{\n \"use_case\": \"<string>\",\n \"activity_description\": \"<string>\",\n \"goals\": [\n \"<string>\"\n ],\n \"collect_fields\": [\n {\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"required\": false,\n \"on_refusal\": \"<string>\"\n }\n ],\n \"first_message_hint\": \"<string>\",\n \"business_card\": {},\n \"agent_name\": \"<string>\",\n \"origin\": \"wizard\",\n \"dry_run\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.agentika.site/api/v1/workflow/create/template")
.header("Content-Type", "application/json")
.body("{\n \"use_case\": \"<string>\",\n \"activity_description\": \"<string>\",\n \"goals\": [\n \"<string>\"\n ],\n \"collect_fields\": [\n {\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"required\": false,\n \"on_refusal\": \"<string>\"\n }\n ],\n \"first_message_hint\": \"<string>\",\n \"business_card\": {},\n \"agent_name\": \"<string>\",\n \"origin\": \"wizard\",\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.agentika.site/api/v1/workflow/create/template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"use_case\": \"<string>\",\n \"activity_description\": \"<string>\",\n \"goals\": [\n \"<string>\"\n ],\n \"collect_fields\": [\n {\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"required\": false,\n \"on_refusal\": \"<string>\"\n }\n ],\n \"first_message_hint\": \"<string>\",\n \"business_card\": {},\n \"agent_name\": \"<string>\",\n \"origin\": \"wizard\",\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"workflow_definition": {},
"current_definition_id": 123,
"template_context_variables": {},
"call_disposition_codes": {
"disposition_codes": []
},
"target_actions": {
"actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": [
"<string>"
]
}
]
},
"total_runs": 123,
"workflow_configurations": {},
"version_number": 123,
"version_status": "<string>",
"workflow_uuid": "<string>",
"model_is_realtime": true
}Сгенерировать по описанию
Сгенерировать голосового агента из описания задачи на естественном языке
curl --request POST \
--url https://app.agentika.site/api/v1/workflow/create/template \
--header 'Content-Type: application/json' \
--data '
{
"use_case": "<string>",
"activity_description": "<string>",
"goals": [
"<string>"
],
"collect_fields": [
{
"name": "<string>",
"question": "<string>",
"required": false,
"on_refusal": "<string>"
}
],
"first_message_hint": "<string>",
"business_card": {},
"agent_name": "<string>",
"origin": "wizard",
"dry_run": false
}
'import requests
url = "https://app.agentika.site/api/v1/workflow/create/template"
payload = {
"use_case": "<string>",
"activity_description": "<string>",
"goals": ["<string>"],
"collect_fields": [
{
"name": "<string>",
"question": "<string>",
"required": False,
"on_refusal": "<string>"
}
],
"first_message_hint": "<string>",
"business_card": {},
"agent_name": "<string>",
"origin": "wizard",
"dry_run": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
use_case: '<string>',
activity_description: '<string>',
goals: ['<string>'],
collect_fields: [
{
name: '<string>',
question: '<string>',
required: false,
on_refusal: '<string>'
}
],
first_message_hint: '<string>',
business_card: {},
agent_name: '<string>',
origin: 'wizard',
dry_run: false
})
};
fetch('https://app.agentika.site/api/v1/workflow/create/template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.agentika.site/api/v1/workflow/create/template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'use_case' => '<string>',
'activity_description' => '<string>',
'goals' => [
'<string>'
],
'collect_fields' => [
[
'name' => '<string>',
'question' => '<string>',
'required' => false,
'on_refusal' => '<string>'
]
],
'first_message_hint' => '<string>',
'business_card' => [
],
'agent_name' => '<string>',
'origin' => 'wizard',
'dry_run' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.agentika.site/api/v1/workflow/create/template"
payload := strings.NewReader("{\n \"use_case\": \"<string>\",\n \"activity_description\": \"<string>\",\n \"goals\": [\n \"<string>\"\n ],\n \"collect_fields\": [\n {\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"required\": false,\n \"on_refusal\": \"<string>\"\n }\n ],\n \"first_message_hint\": \"<string>\",\n \"business_card\": {},\n \"agent_name\": \"<string>\",\n \"origin\": \"wizard\",\n \"dry_run\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.agentika.site/api/v1/workflow/create/template")
.header("Content-Type", "application/json")
.body("{\n \"use_case\": \"<string>\",\n \"activity_description\": \"<string>\",\n \"goals\": [\n \"<string>\"\n ],\n \"collect_fields\": [\n {\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"required\": false,\n \"on_refusal\": \"<string>\"\n }\n ],\n \"first_message_hint\": \"<string>\",\n \"business_card\": {},\n \"agent_name\": \"<string>\",\n \"origin\": \"wizard\",\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.agentika.site/api/v1/workflow/create/template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"use_case\": \"<string>\",\n \"activity_description\": \"<string>\",\n \"goals\": [\n \"<string>\"\n ],\n \"collect_fields\": [\n {\n \"name\": \"<string>\",\n \"question\": \"<string>\",\n \"required\": false,\n \"on_refusal\": \"<string>\"\n }\n ],\n \"first_message_hint\": \"<string>\",\n \"business_card\": {},\n \"agent_name\": \"<string>\",\n \"origin\": \"wizard\",\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"workflow_definition": {},
"current_definition_id": 123,
"template_context_variables": {},
"call_disposition_codes": {
"disposition_codes": []
},
"target_actions": {
"actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": [
"<string>"
]
}
]
},
"total_runs": 123,
"workflow_configurations": {},
"version_number": 123,
"version_status": "<string>",
"workflow_uuid": "<string>",
"model_is_realtime": true
}POST /api/v1/workflow/templates/duplicate. См. Шаблоны.Повтор запроса без дублей
Если ответ потерялся, агент уже мог быть создан. Для предусмотренного этой операцией повтора передавайте заголовокIdempotency-Key: уникальный ключ для одной попытки создания.
При повторе с тем же ключом отправляйте то же тело запроса. В пределах срока хранения ключа сервер вернёт результат первой попытки; у такого ответа есть заголовок Idempotent-Replayed: true. Изменённое тело с прежним ключом отклоняется с 422 и кодом idempotency_key_reuse.
| Ответ | Что произошло | Что делать |
|---|---|---|
409, detail.code = "creation_in_progress", Retry-After | Первая попытка ещё выполняется | Подождать указанное число секунд и повторить тот же запрос с тем же ключом |
409, detail.code = "workflow_archived" | Созданный по этому ключу агент уже в архиве | Восстановить агента либо начать новое создание с новым ключом |
422, detail.code = "idempotency_key_reuse" | Ключ уже использовался с другими данными | Для другого запроса выбрать новый ключ |
Headers
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).
Body
Response
Successful Response
- WorkflowResponse
- WorkflowTemplateDryRunResponse
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.