Pular para o conteúdo

POST /v1/agent-templates/{slug}/instantiate

POST
/v1/agent-templates/{slug}/instantiate
curl --request POST \
--url https://seu-endereco-da-api/v1/agent-templates/example/instantiate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "answers": { "additionalProperty": "example" }, "profile": { "company": "example", "niche": "example", "valueProp": "example", "serviceAreas": "example", "tone": "example", "products": "example", "faqs": "example", "reviewUrl": "https://example.com", "address": "example" }, "channelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "businessHoursConfigId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Permissão que a Chave de acesso precisa: Gerenciar agentes de IA (agents:manage).

slug
required
string
Media typeapplication/json
object
answers
object
key
additional properties
string
profile
object
company
string
<= 4000 characters
niche
string
<= 4000 characters
valueProp
string
<= 4000 characters
serviceAreas
string
<= 4000 characters
tone
string
<= 4000 characters
products
string
<= 4000 characters
faqs
string
<= 4000 characters
reviewUrl
string format: uri
<= 2000 characters
address
string
<= 4000 characters
channelId
string format: uuid
businessHoursConfigId
string format: uuid

Example generated

{
"answers": {
"additionalProperty": "example"
},
"profile": {
"company": "example",
"niche": "example",
"valueProp": "example",
"serviceAreas": "example",
"tone": "example",
"products": "example",
"faqs": "example",
"reviewUrl": "https://example.com",
"address": "example"
},
"channelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"businessHoursConfigId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
Media typeapplication/json
object
agent
required
object
id
required
string
name
required
string
avatar
required
string
description
required
string
status
required

Active answers its channels; flows answers only when a flow block or another AI passes it the conversation, and never holds a channel; paused and draft answer no one (draft still answers its test phone)

string
Allowed values: active flows paused draft
model
required
string
temperature
required
number
instructions
required
string
testPhone
required
string
nullable
businessHoursConfigId
required

Business hours the agent follows; null keeps the agent answering at any time

string format: uuid
nullable
outOfHours
required

What the agent does outside the business hours: tell the customer the right hours, or stay silent

string
Allowed values: avisar calado
forbiddenSubjects
required

Subjects the owner forbids the agent to talk about, added on top of the fixed rules; empty keeps the agent as it always was

Array<string>
attemptLimit
required

Consecutive turns without understanding before the agent hands off to a person; null never hands off for this reason

number
nullable >= 1 <= 10
typingWaitSeconds
required

Seconds the agent waits after the customer’s last message before answering, so a burst of short messages gets one reply; null answers each message at once

number
nullable >= 2 <= 10
understandAudio
required

True turns the customer’s audio into text before the agent answers, charged to the AI credit; false makes the agent ask the customer to write.

boolean
voiceReply
required

When the agent answers with a voice note generated from its reply, charged to the AI credit: never, only when the customer’s last message was audio, or always; replies with buttons or a list stay as text

string
Allowed values: never when_customer_audio always
voice
required

Voice of the agent’s voice notes

string
Allowed values: alloy ash ballad coral echo fable nova onyx sage shimmer verse
channelIds
required
Array<string>
intents
required
Array<object>
object
updatedAt
required
string format: date-time
template
required

Ready-made AI the agent was created from; null for an agent written by hand

object
id
required
string format: uuid
slug
required
string
name
required
string
version
required

Template version the agent follows

number
flows
required
Array<object>
object
key
required

Key of the flow in the template, the flowKey of a flow_template_pending warning

string
id
required
string format: uuid
name
required
string
status
required

Companion flows are created as drafts

string
warnings
required
Array<object>
object
code
required

Transfer_target_pending: the intent passes to another AI that is not created yet and turns on by itself when it is; flow_template_pending: the companion flow has no approved template for a closed 24-hour window yet; companion_draft: a companion the update created stayed in draft because its graph is invalid

string
Allowed values: charge_template_required transfer_target_pending account_setup_required flow_template_pending companion_draft
intentKey
required
string
nullable
flowKey
required
string
nullable
message
required
string
templateSlug
required
string
nullable
bindings
required
Array<object>
object
token
required

Placeholder of the template, e.g. @pipeline:vendas, @stage:vendas/qualificado, @department:financeiro, @tag:quente, @sequence:reativar

string
kind
required
string
Allowed values: pipeline stage department tag sequence template loss_reason service payment_template
value
required

Id the placeholder became in this account (the tag name for tags)

string
label
required
string
tests
required

The template test questions played against the new agent with the agent test

Array<object>
object
question
required
string
expected
required
string
reply
required
string
status
required

Unanswered questions also went to the unanswered questions list

string
Allowed values: answered unanswered not_run

Example

{
"agent": {
"status": "active",
"outOfHours": "avisar",
"voiceReply": "never",
"voice": "alloy"
},
"warnings": [
{
"code": "charge_template_required"
}
],
"bindings": [
{
"kind": "pipeline"
}
],
"tests": [
{
"status": "answered"
}
]
}