> ## 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.

> Deletes a custom variable by its ID.  **Impact:** Any agent instructions referencing this variable will no longer resolve its value.

# Delete Custom Variable

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


## OpenAPI

````yaml delete /ai-agents/agent-builder/agents/variables/custom/{variableId}
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/custom/{variableId}:
    delete:
      tags:
        - Agent Builder
      summary: Delete Custom Variable
      description: >-
        Deletes a custom variable by its ID.


        **Impact:** Any agent instructions referencing this variable will no
        longer resolve its value.
      operationId: AgentBuilderController_deleteCustomVariable
      parameters:
        - name: variableId
          required: true
          in: path
          description: Variable ID to delete
          schema:
            type: string
      responses:
        '200':
          description: Custom variable deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessMessageResponse'
              example:
                success: true
                message: Variable deleted successfully
      security:
        - apiKey: []
components:
  schemas:
    SuccessMessageResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
          description: Indicates whether the operation was successful
        message:
          type: string
          example: Operation completed successfully
          description: Human-readable result message
      required:
        - success
        - message
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````