Skip to main content
POST
Create variable

Autorizações

X-Api-Key
string
header
obrigatório

Parâmetros de caminho

agentPublicId
string<uuid>
obrigatório

Corpo

application/json

Body for creating a new dynamic prompt variable on an agent.

type
enum<string>
obrigatório

Type of the variable, controlling shape and validation of values.

Opções disponíveis:
text_short,
text_long,
number,
date,
time,
datetime,
single_choice,
multi_choice,
bool
booleanTextWhenFalse
string

Text to inject when a boolean variable resolves to false.

Exemplo:

"no"

booleanTextWhenTrue
string

Text to inject when a boolean variable resolves to true.

Exemplo:

"yes"

defaultValue
object

Default value. Polymorphic: shape depends on type (string, number, boolean, choice).

Exemplo:

"Ada"

description
string

Optional help text shown next to the variable.

Maximum string length: 500
Exemplo:

"Full name of the customer being assisted."

label
string

Human-readable label shown in the prompt editor.

Maximum string length: 200
Exemplo:

"Customer name"

multiChoiceSeparator
string

Separator used when concatenating multi_choice options into a single string.

Maximum string length: 10
Exemplo:

", "

name
string

Stable identifier of the variable. Lowercase ASCII; must start with a letter and may contain digits and underscores. Up to 50 characters.

Minimum string length: 1
Pattern: ^[a-z][a-z0-9_]{0,49}$
Exemplo:

"customer_name"

options
object[]

Required (and validated 1..50) for single_choice / multi_choice variables.

required
boolean

Whether the variable must be set before the agent can respond.

Exemplo:

true

sortOrder
integer<int32>

Sort order of this variable in the prompt editor.

Exemplo:

10

Resposta

Created

Dynamic-prompt variable definition (per agent).

booleanTextWhenFalse
string

Prompt fragment when bool variable is false.

booleanTextWhenTrue
string

Prompt fragment when bool variable is true.

createdAt
string<date-time>
defaultValue
object

Default value (shape depends on type).

description
string
label
string

Display label shown in the Hub form.

multiChoiceSeparator
string

Joiner for multi_choice rendered values (default ,).

name
string

Slug used in {{name}} references inside the systemPrompt.

options
object[]

Options for single_choice / multi_choice (null otherwise).

publicId
string<uuid>
required
boolean

Whether the Hub form must submit this field.

sortOrder
integer<int32>
type
enum<string>
Opções disponíveis:
text_short,
text_long,
number,
date,
time,
datetime,
single_choice,
multi_choice,
bool
updatedAt
string<date-time>