> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eigi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Agent Dynamic Variables

> Retrieve the normalized dynamic variable definitions configured for an agent

## Overview

Use this endpoint to fetch the dynamic variables an agent expects at runtime.

This is useful before:

* placing outbound calls that need personalized values
* creating Daily sessions with agent-specific runtime fields
* building forms that collect required variables for a specific agent

## Authentication

<ParamField header="X-API-Key" type="string" required>
  Your eigi.ai API key. Must be prefixed with `vk_`.
</ParamField>

## Path Parameters

<ParamField path="agent_id" type="string" required>
  The unique agent ID.

  Example: `68ea2517dbb84c09bae1ba0a`
</ParamField>

## Response

<ResponseField name="agent_id" type="string">
  The agent ID.
</ResponseField>

<ResponseField name="agent_name" type="string">
  The agent name.
</ResponseField>

<ResponseField name="dynamic_variables" type="array">
  Normalized dynamic variable definitions configured for the agent.
</ResponseField>

<ResponseField name="dynamic_variables[].variable_name" type="string">
  Canonical variable key used in prompts and runtime payloads.
</ResponseField>

<ResponseField name="dynamic_variables[].required" type="boolean">
  Whether the variable must be provided before starting the conversation.
</ResponseField>

<ResponseField name="dynamic_variables[].field_type" type="string">
  Expected value type: `STRING`, `NUMBER`, `EMAIL`, or `PHONE`.
</ResponseField>

<ResponseField name="dynamic_variables[].description" type="string">
  Guidance describing what value should be passed for that variable.
</ResponseField>

## Example Use Cases

<AccordionGroup>
  <Accordion title="Build a runtime input form">
    Fetch the dynamic variables for an agent, render the required fields in your
    UI, then collect the values before placing a call or creating a session.
  </Accordion>

  <Accordion title="Validate required inputs before calling">
    Use the `required` and `field_type` fields to validate your payload before
    sending runtime values to eigi.ai.
  </Accordion>

  <Accordion title="Keep agent-specific forms in sync">
    Call this endpoint whenever an agent changes so your application always uses
    the latest variable definitions.
  </Accordion>
</AccordionGroup>

## Notes

* Variable names are normalized before they are returned.
* If an agent has no configured dynamic variables, the endpoint returns an empty array.
* This endpoint only returns variables for agents owned by the authenticated API key holder.


## OpenAPI

````yaml GET /v1/public/agents/{agent_id}/dynamic-variables
openapi: 3.0.0
info:
  title: eigi.ai API
  description: REST API for managing AI voice agents and conversations
  version: 1.0.0
  contact:
    email: buddy@eigi.ai
    url: https://eigi.ai
servers:
  - url: https://api.eigi.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/public/agents/{agent_id}/dynamic-variables:
    get:
      tags:
        - Agents
      summary: Get Agent Dynamic Variables
      description: Retrieve normalized dynamic variable definitions for a specific agent.
      operationId: getAgentDynamicVariables
      parameters:
        - name: agent_id
          in: path
          required: true
          description: The unique agent ID
          schema:
            type: string
          example: 68ea2517dbb84c09bae1ba0a
      responses:
        '200':
          description: Successfully retrieved agent dynamic variables
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDynamicVariablesResponse'
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - Access denied to agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AgentDynamicVariablesResponse:
      type: object
      properties:
        agent_id:
          type: string
          description: The agent ID
        agent_name:
          type: string
          description: The agent name
        dynamic_variables:
          type: array
          description: Normalized dynamic variable definitions configured for the agent
          items:
            $ref: '#/components/schemas/DynamicVariableDefinition'
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Error message
    DynamicVariableDefinition:
      type: object
      properties:
        variable_name:
          type: string
          description: Canonical key used in prompts and runtime payloads
        required:
          type: boolean
          description: Whether a value must be provided before a call or session starts
          default: false
        field_type:
          type: string
          enum:
            - STRING
            - NUMBER
            - EMAIL
            - PHONE
          description: Expected runtime value type for this variable
        description:
          type: string
          description: Human and LLM guidance for what value should be provided
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get your API key from the eigi.ai Dashboard
        under Settings â†’ API Keys.

````