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

> Retrieves all enabled variables (predefined and custom) for the application. Use this endpoint to view variable definitions and understand where they are used.  **Usage tracking:** Each variable inclu

# List All Variables

For the complete error reference, see [Error Guide](/rest-api/ai-agents-apis/error-codes).


## OpenAPI

````yaml get /ai-agents/agent-builder/agents/variables/all
openapi: 3.0.0
info:
  title: AI Agents APIs
  description: API reference for CometChat AI Agents service
  version: '1.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: ai-agent
    description: ''
paths:
  /ai-agents/agent-builder/agents/variables/all:
    get:
      tags:
        - Agent Builder
      summary: List All Variables
      description: >-
        Retrieves all enabled variables (predefined and custom) for the
        application. Use this endpoint to view variable definitions and
        understand where they are used.


        **Usage tracking:** Each variable includes information showing which
        agents reference it in their instructions and which API tools use it.


        **Grouping:** Set `groupByCategory` to `true` to group results by
        category (e.g., auth, custom); otherwise results are returned as a flat
        array.
      operationId: AgentBuilderController_getAvailableVariables
      parameters:
        - name: groupByCategory
          required: false
          in: query
          description: Group variables by category
          schema:
            type: boolean
      responses:
        '200':
          description: List of variables (flat array or grouped by category)
          content:
            application/json:
              schema:
                oneOf:
                  - type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        description:
                          type: string
                        sourceType:
                          type: string
                        category:
                          type: string
                        usageCount:
                          type: number
                        usedByAgents:
                          type: array
                          items:
                            type: object
                        usedByTools:
                          type: object
                  - type: object
                    additionalProperties:
                      type: array
                      items:
                        type: object
                    example:
                      auth: []
                      custom: []
              example:
                - name: auth.uid
                  description: Authenticated user UID
                  sourceType: auth
                  category: auth
                  usageCount: 2
                  usedByAgents:
                    - uid: agent-1
                      name: Support Agent
                  usedByTools: {}
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````