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

> Updates an existing frontend action by its unique ID. Use this endpoint to modify a frontend action's parameters, description, or trigger function.

# Update Frontend Action

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


## OpenAPI

````yaml patch /ai-agents/agent-builder/frontend-actions/{id}
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/frontend-actions/{id}:
    patch:
      tags:
        - Agent Builder Frontend Actions
      summary: Update Frontend Action
      description: >-
        Updates an existing frontend action by its unique ID. Use this endpoint
        to modify a frontend action's parameters, description, or trigger
        function.
      operationId: FrontendActionsController_updateFrontendAction
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFrontendActionDto'
      responses:
        '200':
          description: Frontend action updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  _id:
                    type: string
                    example: myapp_onUserClick
                  appId:
                    type: string
                    example: my-app-id
                  name:
                    type: string
                    example: User Click Action
                  description:
                    type: string
                    example: Triggered when a user clicks a button
                  triggerFunction:
                    type: string
                    example: onUserClick
                  icon:
                    type: string
                    example: https://example.com/icon.png
                  parameters:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          example: userId
                        type:
                          type: string
                          example: string
                        description:
                          type: string
                          example: The user identifier
                        required:
                          type: boolean
                          example: true
                  tool:
                    type: object
                    properties:
                      name:
                        type: string
                        example: onUserClick
                      description:
                        type: string
                        example: Triggered when a user clicks a button
                      parameters:
                        type: object
                        example:
                          type: object
                          properties: {}
                          required: []
                  createdAt:
                    type: number
                    example: 1700000000000
                  updatedAt:
                    type: number
                    example: 1700000000000
      security:
        - apiKey: []
components:
  schemas:
    UpdateFrontendActionDto:
      type: object
      properties:
        name:
          type: string
          description: Name of the frontend action
          example: Open Product Modal
        description:
          type: string
          description: Description of what the frontend action does
          example: Opens a modal displaying product details
        parameters:
          description: Array of parameters for the frontend action
          type: array
          items:
            $ref: '#/components/schemas/FrontendActionParameter'
        icon:
          type: string
          description: Icon URL for the frontend action
          example: https://example.com/icon.png
    FrontendActionParameter:
      type: object
      properties:
        key:
          type: string
          description: Parameter key/name
          example: productId
        type:
          type: string
          description: Parameter type
          example: string
        description:
          type: string
          description: Parameter description
          example: The ID of the product to display
        required:
          type: boolean
          description: Whether the parameter is required
          example: true
      required:
        - key
        - type
        - description
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````