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

# Update custom tool

> Update an existing custom tool.



## OpenAPI

````yaml /api-reference/openapi.json put /v2/ai-agents/{ai_agent_id}/custom-tools/{tool_id}
openapi: 3.1.0
info:
  title: Verbex Platform API
  description: API for managing AI agents, calls, phone numbers, and more.
  version: 1.0.0
servers: []
security: []
paths:
  /v2/ai-agents/{ai_agent_id}/custom-tools/{tool_id}:
    put:
      tags:
        - Custom Tools
      summary: Update custom tool
      description: Update an existing custom tool.
      operationId: update_custom_tool_v2_ai_agents__ai_agent_id__custom_tools__tool_id__put
      parameters:
        - name: ai_agent_id
          in: path
          required: true
          schema:
            type: string
            title: Ai Agent Id
        - name: tool_id
          in: path
          required: true
          schema:
            type: string
            title: Tool Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePiaCustomToolRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PiaCustomToolResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdatePiaCustomToolRequest:
      properties:
        tool_id:
          type: string
          title: Tool Id
        tool_start_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Start Message
          description: Optional message to display when the tool is started
        tool_delayed_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Delayed Message
          description: Optional message to display when the tool is delayed
        tool_complete_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Complete Message
          description: Optional message to display when the tool is completed
        tool_failed_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Failed Message
          description: Optional message to display when the tool fails
        openai_tool:
          $ref: '#/components/schemas/OpenAIFormatFunctionDefinition-Input'
          description: Updated OpenAI function definition for the tool
        additional_tool_info:
          $ref: '#/components/schemas/AdditionalCustomToolInfo-Input'
          description: Updated API configuration and custom tool details
      type: object
      required:
        - openai_tool
        - additional_tool_info
      title: UpdatePiaCustomToolRequest
    PiaCustomToolResponse:
      properties:
        tool_id:
          type: string
          title: Tool Id
          description: Unique identifier for the custom tool
        tool_start_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Start Message
          description: Optional message to display when the tool is started
        tool_delayed_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Delayed Message
          description: Optional message to display when the tool is delayed
        tool_complete_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Complete Message
          description: Optional message to display when the tool is completed
        tool_failed_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Failed Message
          description: Optional message to display when the tool fails
        openai_tool:
          $ref: '#/components/schemas/OpenAIFormatFunctionDefinition-Output'
          description: >-
            OpenAI function definition containing the tool's interface
            specification
        additional_tool_info:
          $ref: '#/components/schemas/AdditionalCustomToolInfo-Output'
          description: Complete configuration for the custom tool including API details
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp indicating when this custom tool was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Timestamp indicating when this custom tool was last modified
      type: object
      required:
        - openai_tool
        - additional_tool_info
        - created_at
        - updated_at
      title: PiaCustomToolResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    OpenAIFormatFunctionDefinition-Input:
      properties:
        name:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
          title: Name
        description:
          type: string
          title: Description
        parameters:
          $ref: '#/components/schemas/FunctionParameters-Input'
      additionalProperties: false
      type: object
      required:
        - name
        - description
        - parameters
      title: OpenAIFormatFunctionDefinition
      examples:
        - description: Get the delivery date for a customer's order
          name: get_delivery_date
          parameters:
            additionalProperties: false
            properties:
              order_id:
                description: The customer's order ID
                type: string
            required:
              - order_id
            type: object
    AdditionalCustomToolInfo-Input:
      properties:
        tool_type:
          type: string
          const: custom
          title: Tool Type
          description: >-
            Identifier specifying this is a custom tool implementation. Will
            always be set to 'custom'
          default: custom
        api:
          $ref: '#/components/schemas/CustomToolAPI-Input'
          description: >-
            Complete API configuration including endpoint, method, headers, and
            parameters
      type: object
      required:
        - api
      title: AdditionalCustomToolInfo
    OpenAIFormatFunctionDefinition-Output:
      properties:
        name:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
          title: Name
        description:
          type: string
          title: Description
        parameters:
          $ref: '#/components/schemas/FunctionParameters-Output'
      additionalProperties: false
      type: object
      required:
        - name
        - description
        - parameters
      title: OpenAIFormatFunctionDefinition
      examples:
        - description: Get the delivery date for a customer's order
          name: get_delivery_date
          parameters:
            additionalProperties: false
            properties:
              order_id:
                description: The customer's order ID
                type: string
            required:
              - order_id
            type: object
    AdditionalCustomToolInfo-Output:
      properties:
        tool_type:
          type: string
          const: custom
          title: Tool Type
          description: >-
            Identifier specifying this is a custom tool implementation. Will
            always be set to 'custom'
          default: custom
        api:
          $ref: '#/components/schemas/CustomToolAPI-Output'
          description: >-
            Complete API configuration including endpoint, method, headers, and
            parameters
      type: object
      required:
        - api
      title: AdditionalCustomToolInfo
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    FunctionParameters-Input:
      properties:
        type:
          type: string
          const: object
          title: Type
          default: object
        properties:
          additionalProperties:
            $ref: '#/components/schemas/Parameter-Input'
          type: object
          title: Properties
        required:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Required
        additionalProperties:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Additionalproperties
          default: false
      type: object
      required:
        - properties
      title: FunctionParameters
    CustomToolAPI-Input:
      properties:
        endpoint:
          type: string
          title: Endpoint
          description: >-
            The complete URL endpoint where the API requests will be sent (e.g.,
            https://api.example.com/v1/resource)
        method:
          type: string
          title: Method
          description: >-
            The HTTP method to be used for the API request (e.g., GET, POST,
            PUT, DELETE)
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          description: >-
            HTTP headers required for the API request, such as authentication
            tokens or content type specifications
        parameters:
          $ref: '#/components/schemas/CustomToolAPIParameters'
          description: >-
            Configuration for both fixed and runtime parameters that will be
            used in API requests
      type: object
      required:
        - endpoint
        - method
        - headers
        - parameters
      title: CustomToolAPI
      example:
        endpoint: https://api.example.com/test
        headers:
          Content-Type: application/json
        method: POST
        parameters:
          fixed_params:
            api_key:
              description: API key for authentication
              value: test-api-key
          runtime_params: {}
    FunctionParameters-Output:
      properties:
        type:
          type: string
          const: object
          title: Type
          default: object
        properties:
          additionalProperties:
            $ref: '#/components/schemas/Parameter-Output'
          type: object
          title: Properties
        required:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Required
        additionalProperties:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Additionalproperties
          default: false
      type: object
      required:
        - properties
      title: FunctionParameters
    CustomToolAPI-Output:
      properties:
        endpoint:
          type: string
          title: Endpoint
          description: >-
            The complete URL endpoint where the API requests will be sent (e.g.,
            https://api.example.com/v1/resource)
        method:
          type: string
          title: Method
          description: >-
            The HTTP method to be used for the API request (e.g., GET, POST,
            PUT, DELETE)
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          description: >-
            HTTP headers required for the API request, such as authentication
            tokens or content type specifications
        parameters:
          $ref: '#/components/schemas/CustomToolAPIParameters'
          description: >-
            Configuration for both fixed and runtime parameters that will be
            used in API requests
      type: object
      required:
        - endpoint
        - method
        - headers
        - parameters
      title: CustomToolAPI
      example:
        endpoint: https://api.example.com/test
        headers:
          Content-Type: application/json
        method: POST
        parameters:
          fixed_params:
            api_key:
              description: API key for authentication
              value: test-api-key
          runtime_params: {}
    Parameter-Input:
      properties:
        type:
          anyOf:
            - $ref: '#/components/schemas/ParameterType'
            - items:
                $ref: '#/components/schemas/ParameterType'
              type: array
          title: Type
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        enum:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Enum
        items:
          anyOf:
            - type: object
            - type: 'null'
          title: Items
        format:
          anyOf:
            - type: string
            - type: 'null'
          title: Format
        minimum:
          anyOf:
            - type: number
            - type: 'null'
          title: Minimum
        maximum:
          anyOf:
            - type: number
            - type: 'null'
          title: Maximum
        default:
          anyOf:
            - {}
            - type: 'null'
          title: Default
        required:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Required
        properties:
          anyOf:
            - additionalProperties:
                type: object
              type: object
            - type: 'null'
          title: Properties
        additionalProperties:
          anyOf:
            - type: boolean
            - type: object
            - type: 'null'
          title: Additionalproperties
      additionalProperties: false
      type: object
      required:
        - type
      title: Parameter
    CustomToolAPIParameters:
      properties:
        fixed_params:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/FixedParams'
              type: object
            - type: 'null'
          title: Fixed Params
          description: >-
            Dictionary of parameters that remain constant across all API calls.
            Each parameter has a description and fixed value
        runtime_params:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/RuntimeParams'
              type: object
            - type: 'null'
          title: Runtime Params
          description: >-
            Dictionary of parameters that must be provided at runtime. Each
            parameter has a description explaining its purpose
      type: object
      title: CustomToolAPIParameters
    Parameter-Output:
      properties:
        type:
          anyOf:
            - $ref: '#/components/schemas/ParameterType'
            - items:
                $ref: '#/components/schemas/ParameterType'
              type: array
          title: Type
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        enum:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Enum
        items:
          anyOf:
            - type: object
            - type: 'null'
          title: Items
        format:
          anyOf:
            - type: string
            - type: 'null'
          title: Format
        minimum:
          anyOf:
            - type: number
            - type: 'null'
          title: Minimum
        maximum:
          anyOf:
            - type: number
            - type: 'null'
          title: Maximum
        default:
          anyOf:
            - {}
            - type: 'null'
          title: Default
        required:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Required
        properties:
          anyOf:
            - additionalProperties:
                type: object
              type: object
            - type: 'null'
          title: Properties
        additionalProperties:
          anyOf:
            - type: boolean
            - type: object
            - type: 'null'
          title: Additionalproperties
      additionalProperties: false
      type: object
      required:
        - type
      title: Parameter
    ParameterType:
      type: string
      enum:
        - string
        - number
        - integer
        - boolean
        - object
        - array
        - 'null'
      title: ParameterType
    FixedParams:
      properties:
        description:
          type: string
          title: Description
          description: >-
            Detailed explanation of what this fixed parameter represents and how
            it will be used
        value:
          type: string
          title: Value
          description: >-
            The actual value that will be used for this fixed parameter in API
            calls
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: Type of the parameter
      type: object
      required:
        - description
        - value
      title: FixedParams
    RuntimeParams:
      properties:
        description:
          type: string
          title: Description
          description: >-
            Detailed explanation of what this runtime parameter represents and
            how it should be provided during API calls
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: >-
            Type of the parameter (e.g., string, number, boolean) that should be
            provided at runtime
        required:
          type: boolean
          title: Required
          description: >-
            Indicates whether this parameter must be provided at runtime. If
            true, the API call will fail without this parameter.
          default: false
        default:
          anyOf:
            - type: string
            - type: 'null'
          title: Default
          description: >-
            Default value to use if the parameter is not provided at runtime.
            Only applicable when required is False.
      type: object
      required:
        - description
      title: RuntimeParams

````