Saltar para o conteúdo principal
PATCH
/
public
/
api
/
v1
/
agents
/
{agentPublicId}
/
prompt
/
variables
/
{variablePublicId}
Update variable
curl --request PATCH \
  --url https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/prompt/variables/{variablePublicId} \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "booleanTextWhenFalse": "no",
  "booleanTextWhenTrue": "yes",
  "defaultValue": "Ada",
  "description": "Full name of the customer being assisted.",
  "label": "Customer name",
  "multiChoiceSeparator": ", ",
  "name": "customer_name",
  "options": [
    {
      "injectedText": "the customer is on the Pro plan",
      "label": "Pro plan",
      "sortOrder": 1
    }
  ],
  "required": true,
  "sortOrder": 10
}
'
{
  "booleanTextWhenFalse": "<string>",
  "booleanTextWhenTrue": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "defaultValue": {},
  "description": "<string>",
  "label": "<string>",
  "multiChoiceSeparator": "<string>",
  "name": "<string>",
  "options": [
    {
      "injectedText": "<string>",
      "label": "<string>",
      "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "sortOrder": 123
    }
  ],
  "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "required": true,
  "sortOrder": 123,
  "updatedAt": "2023-11-07T05:31:56Z"
}

Autorizações

X-Api-Key
string
header
obrigatório

Parâmetros de caminho

agentPublicId
string<uuid>
obrigatório
variablePublicId
string<uuid>
obrigatório

Corpo

application/json

Body for updating an existing dynamic prompt variable. All fields are optional; only provided fields are updated. JsonNullable fields are tri-state: omit, set, or clear with null.

booleanTextWhenFalse
object

New text to inject when a boolean variable resolves to false.

Exemplo:

"no"

booleanTextWhenTrue
object

New text to inject when a boolean variable resolves to true.

Exemplo:

"yes"

defaultValue
object

New default value. Polymorphic: shape depends on the variable's type.

Exemplo:

"Ada"

description
object

New help text shown next to the variable.

Exemplo:

"Full name of the customer being assisted."

label
string

New human-readable label.

Maximum string length: 200
Exemplo:

"Customer name"

multiChoiceSeparator
object

New separator used when concatenating multi_choice options into a single string.

Exemplo:

", "

name
string

New stable identifier of the variable. Same naming rules as on create.

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

"customer_name"

options
object[]

When provided, replaces the option set entirely.

required
boolean

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

Exemplo:

true

sortOrder
integer<int32>

New sort order of this variable in the prompt editor.

Exemplo:

10

type
enum<string>

New variable type. Changing type may require resetting defaultValue/options.

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

Resposta

OK

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>