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

# Update a web tool by Id.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/voice-agents/web-tool/{id}
openapi: 3.0.1
info:
  title: Hamsa API
  description: Trying out our transcription and media-to-text APIs
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v1/voice-agents/web-tool/{id}:
    patch:
      summary: Update a web tool by Id.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            example: 8e8e9b4b-4d4b-4b4b-4b4b-4b4b4b4b4b4b
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebToolRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateWebToolResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '403':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      deprecated: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateWebToolRequest:
      type: object
      properties:
        type:
          type: string
          description: The type of the web tool.
          enum:
            - FUNCTION
            - MCP
        name:
          type: string
          description: The name of the web tool.
          minLength: 1
          maxLength: 250
        description:
          type: string
          description: A description of what the web tool does.
          minLength: 1
          maxLength: 1000
        async:
          type: boolean
          description: >-
            Whether the tool should run asynchronously. Required when type is
            FUNCTION, not allowed when type is MCP.
        toolSettings:
          type: object
          description: Server configuration settings for the web tool.
          properties:
            serverUrl:
              type: string
              format: uri
              description: The server URL for the web tool.
            authToken:
              type: string
              description: Authentication token for the server.
              minLength: 1
            timeOut:
              type: number
              description: Request timeout in milliseconds.
              minimum: 1
            methodType:
              type: string
              description: HTTP method type for the request.
            httpHeaders:
              type: object
              description: HTTP headers to include in the request.
              additionalProperties:
                type: string
            pathParameters:
              type: object
              description: The path parameters you've included in the request's URL.
              additionalProperties:
                type: string
          required:
            - serverUrl
            - methodType
        messages:
          type: array
          description: >-
            Array of message configurations for the web tool. Each message type
            must be unique.
          items:
            type: object
            description: Message configuration object
            properties:
              type:
                type: string
                description: The type of the message.
                example: system
              content:
                type: string
                description: The content of the message.
                example: system
        params:
          type: object
          description: >-
            Parameter schema definition for the web tool. Not allowed when type
            is MCP. This field is a recursive OpenAPI-style shape with 'type',
            'properties', 'required', 'items', ...etc. Please refer to the
            [OpenAPI specification](https://swagger.io/specification/) for more
            information.
          additionalProperties: true
    UpdateWebToolResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
        message:
          type: string
          default: success
        data:
          $ref: '#/components/schemas/WebToolSchema'
    ErrorSchema:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    WebToolSchema:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the web tool.
          example: d949f13f-40d2-4e48-ac86-b66633070603
        persistentId:
          type: string
          description: >-
            The unique identifier of the web tool across all versions of the
            tool.
          example: cmjx8qzw0000004kz3jek1ktu
        version:
          type: number
          description: The version of the tool.
          example: 1
        name:
          type: string
          description: The name of the web tool.
          example: Weather API Tool
        type:
          type: string
          description: The type of the web tool.
          enum:
            - FUNCTION
            - MCP
          example: FUNCTION
        userId:
          type: string
          description: The user ID associated with the web tool.
          example: 550e8400-e29b-41d4-a716-446655440000
        projectId:
          type: string
          description: The project ID associated with the web tool.
          example: d949f13f-40d2-4e48-ac86-b66633070603
        isActive:
          type: boolean
          description: >-
            Indicates whether the web tool is currently active in any voice
            agent.
          example: true
        async:
          type: boolean
          description: Whether the tool runs asynchronously.
          example: true
        description:
          type: string
          nullable: true
          description: A description of what the web tool does.
          example: >-
            A tool that fetches current weather information for a given
            location.
        collectionId:
          type: string
          description: The collection ID associated with the web tool.
          example: 550e8400-e29b-41d4-a716-446655440000
        toolSettings:
          type: object
          description: Server configuration settings for the web tool.
          properties:
            httpHeaders:
              type: object
              nullable: true
              description: HTTP headers to include in the request.
              example:
                Content-Type: application/json
                Authorization: Bearer token
            pathParameters:
              type: object
              nullable: true
              description: Path parameters you've included in the request's URL.
              example:
                userId: '12345'
            serverUrl:
              type: string
              description: The server URL for the web tool.
              example: https://api.example.com/webhook
            timeout:
              type: number
              nullable: true
              description: Request timeout in milliseconds.
              example: 5000
            authToken:
              type: string
              nullable: true
              description: Authentication token for the server.
              example: bearer_token_12345
            methodType:
              type: string
              nullable: true
              description: HTTP method type for the request.
              example: POST
          required:
            - serverUrl
        params:
          type: object
          description: Parameter schema definition for the web tool.
          nullable: true
          example:
            location:
              type: string
              description: The location to get weather for
        messages:
          type: array
          description: Array of message configurations for the web tool.
          items:
            type: object
            properties:
              type:
                type: string
                description: The type of the message.
                example: system
              content:
                type: string
                description: The content of the message.
                example: You are a helpful weather assistant.
            required:
              - type
              - content
          example:
            - type: system
              content: You are a helpful weather assistant.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````