> ## 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 Web Tool

> Updates an existing web tool by ID. All fields are optional except projectId.



## OpenAPI

````yaml /api-reference/openapi.json patch /v2/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:
  /v2/voice-agents/web-tool/{id}:
    patch:
      summary: Update Web Tool
      description: >-
        Updates an existing web tool by ID. All fields are optional except
        projectId.
      parameters:
        - in: path
          name: id
          required: true
          description: The unique identifier of the web tool to update
          schema:
            type: string
            format: uuid
            example: 48f7656f-098b-4c43-b165-7cfd2cc8ac30
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebToolRequestV2'
      responses:
        '200':
          description: Web tool updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateWebToolResponseV2'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: Web tool not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Server Side Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    UpdateWebToolRequestV2:
      type: object
      required:
        - projectId
      properties:
        type:
          type: string
          enum:
            - FUNCTION
            - MCP
            - WEB_TOOL
          description: The type of web tool
          example: FUNCTION
        name:
          type: string
          maxLength: 250
          description: The name of the web tool
          example: Get Weather Data
        description:
          type: string
          maxLength: 1000
          description: A description of what the web tool does
          example: Fetches current weather data for a given location
        async:
          type: boolean
          description: Whether the tool runs asynchronously. Not allowed for MCP type.
          example: false
        toolSettings:
          $ref: '#/components/schemas/ToolSettings'
        messages:
          type: array
          description: Messages to display during tool execution
          items:
            $ref: '#/components/schemas/WebToolMessage'
        params:
          $ref: '#/components/schemas/ParamsSchema'
    UpdateWebToolResponseV2:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/WebToolData'
    ErrorSchema:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    ToolSettings:
      type: object
      description: >-
        Server configuration for the web tool. Required for FUNCTION and MCP
        types, not allowed for WEB_TOOL type.
      required:
        - serverUrl
        - methodType
      properties:
        serverUrl:
          type: string
          format: uri
          description: The URL of the server endpoint
          example: https://api.example.com/weather
        methodType:
          type: string
          description: The HTTP method type
          example: GET
        authToken:
          type: string
          nullable: true
          description: Optional authentication token
          example: Bearer sk-...
        timeOut:
          type: number
          minimum: 1
          maximum: 15
          description: Request timeout in seconds (1-15)
          example: 5
        httpHeaders:
          type: object
          additionalProperties:
            type: string
          description: Custom HTTP headers to include in requests
          example:
            Content-Type: application/json
        pathParameters:
          type: object
          additionalProperties:
            type: string
          description: Path parameters for the URL
          example:
            city: london
    WebToolMessage:
      type: object
      required:
        - type
        - content
      properties:
        type:
          type: string
          enum:
            - REQUEST_START
            - REQUEST_COMPLETE
          description: The type of message. Each type can only appear once.
          example: REQUEST_START
        content:
          type: string
          description: The message content to display
          example: Fetching weather data...
    ParamsSchema:
      type: object
      description: >-
        OpenAPI-style schema defining the parameters for the web tool. Not
        allowed for MCP type.
      properties:
        type:
          type: string
          enum:
            - object
          description: Must be 'object'
          example: object
        properties:
          type: object
          description: >-
            The properties of the parameters schema. Each property must have a
            description.
          additionalProperties:
            type: object
            required:
              - type
              - description
            properties:
              type:
                type: string
                enum:
                  - string
                  - number
                  - boolean
                  - array
                  - object
                description: The data type of the property
              description:
                type: string
                description: Description of the property (required)
              enum:
                type: array
                items:
                  type: string
                description: Allowed values (only for string type)
              items:
                type: object
                description: Item schema (required for array type)
              properties:
                type: object
                description: Nested properties (for object type)
              required:
                type: array
                items:
                  type: string
                description: Required nested properties
          example:
            location:
              type: string
              description: The city name to get weather for
            units:
              type: string
              description: Temperature units
              enum:
                - celsius
                - fahrenheit
        required:
          type: array
          items:
            type: string
          description: List of required property names
          example:
            - location
    WebToolData:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the web tool
          example: 48f7656f-098b-4c43-b165-7cfd2cc8ac30
        persistentId:
          type: string
          format: uuid
          nullable: true
          description: The persistent ID used for versioning
          example: 48f7656f-098b-4c43-b165-7cfd2cc8ac30
        version:
          type: integer
          description: The version number of the web tool
          example: 1
        name:
          type: string
          description: The name of the web tool
          example: Get Weather Data
        type:
          type: string
          enum:
            - FUNCTION
            - MCP
            - WEB_TOOL
          description: The type of web tool
          example: FUNCTION
        userId:
          type: string
          format: uuid
          description: The ID of the user who created the tool
          example: 48f7656f-098b-4c43-b165-7cfd2cc8ac30
        projectId:
          type: string
          format: uuid
          description: The ID of the project
          example: 48f7656f-098b-4c43-b165-7cfd2cc8ac30
        isActive:
          type: boolean
          description: Whether the web tool is active
          example: true
        async:
          type: boolean
          description: Whether the tool runs asynchronously
          example: false
        description:
          type: string
          nullable: true
          description: Description of the web tool
          example: Fetches current weather data for a given location
        collectionId:
          type: string
          format: uuid
          nullable: true
          description: The collection ID if grouped
          example: 48f7656f-098b-4c43-b165-7cfd2cc8ac30
        toolSettings:
          type: object
          nullable: true
          description: Tool server settings (null for WEB_TOOL type)
          properties:
            httpHeaders:
              type: object
              nullable: true
              description: Custom HTTP headers
            pathParameters:
              type: object
              nullable: true
              description: URL path parameters
            serverUrl:
              type: string
              nullable: true
              description: The server endpoint URL
            timeout:
              type: number
              nullable: true
              description: Request timeout in seconds
            authToken:
              type: string
              nullable: true
              description: Authentication token
            methodType:
              type: string
              nullable: true
              description: HTTP method type
        params:
          type: object
          nullable: true
          description: The parameters schema in OpenAPI format
        messages:
          type: array
          description: Messages to display during tool execution
          items:
            $ref: '#/components/schemas/WebToolMessage'
  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>'

````