Skip to main content
POST
/
manage-dynamic-variables
curl -X POST "https://api.magpipe.ai/functions/v1/manage-dynamic-variables" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "caller_name",
    "description": "The full name of the caller",
    "var_type": "text"
  }'
{
  "id": "789e0123-e89b-12d3-a456-426614174000",
  "agent_id": "123e4567-e89b-12d3-a456-426614174000",
  "user_id": "456e7890-e89b-12d3-a456-426614174000",
  "name": "caller_name",
  "description": "The full name of the caller",
  "var_type": "text",
  "enum_options": null,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}
Create a dynamic variable that your AI agent will extract from conversations. Dynamic variables let you capture structured data (names, emails, order numbers, etc.) during calls.

Request Body

agent_id
string
required
UUID of the agent this variable belongs to
name
string
required
Variable name (e.g., caller_name, order_id). Used as the key in extracted data.
description
string
Description of what this variable captures. The AI uses this to know what to extract.
var_type
string
default:"text"
Data type: text, number, boolean, or enum
enum_options
array
Required when var_type is enum. List of allowed values.
["small", "medium", "large"]

Response

id
string
UUID of the created variable
agent_id
string
UUID of the agent
name
string
Variable name
description
string
Variable description
var_type
string
Data type (text, number, boolean, enum)
enum_options
array
Allowed values (only for enum type)
created_at
string
ISO 8601 timestamp
curl -X POST "https://api.magpipe.ai/functions/v1/manage-dynamic-variables" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "caller_name",
    "description": "The full name of the caller",
    "var_type": "text"
  }'
{
  "id": "789e0123-e89b-12d3-a456-426614174000",
  "agent_id": "123e4567-e89b-12d3-a456-426614174000",
  "user_id": "456e7890-e89b-12d3-a456-426614174000",
  "name": "caller_name",
  "description": "The full name of the caller",
  "var_type": "text",
  "enum_options": null,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}