Skip to main content
POST
/
agents
/
{agentId}
/
variables
Add Variable
curl --request POST \
  --url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/variables \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "variable": {
    "in": "<string>",
    "type": "string",
    "value": "<unknown>",
    "defaultValue": "<unknown>",
    "key": "<string>",
    "description": "<string>",
    "required": true,
    "reusable": true,
    "isEnv": true,
    "isSystem": true,
    "isGlobal": true
  }
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "id": "<string>",
    "in": "<string>",
    "type": "string",
    "value": "<unknown>",
    "defaultValue": "<unknown>",
    "key": "<string>",
    "description": "<string>",
    "required": true,
    "reusable": true,
    "isEnv": true,
    "isSystem": true,
    "isGlobal": true,
    "agentId": "<string>",
    "userId": "<string>"
  }
}

Example Request

{
  "variable": {
    "key": "user_name",
    "type": "string",
    "description": "Stores the user's name during conversation",
    "defaultValue": "",
    "isGlobal": true
  }
}
The key must be unique within the agent. Duplicate keys will return a 400 error.
Set isGlobal: true for variables that should persist across conversation nodes.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agentId
string
required

The unique identifier of the agent

Body

application/json
variable
object
required

Variable configuration

{key}
any

Response

Successful response

success
boolean
required

Indicates if the variable was created successfully

message
string
required

Response message

data
object
required

Created variable object