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

# Update function

> Updates a specific function.



## OpenAPI

````yaml put /functions/{id}
openapi: 3.0.3
info:
  title: Vogent - OpenAPI 3.0
  description: Test Description
  version: 1.0.11
servers:
  - url: https://api.vogent.ai/api
security:
  - bearerAuth: []
paths:
  /functions/{id}:
    parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
        description: ID of the function.
    put:
      summary: Update function
      description: Updates a specific function.
      operationId: updateFunction
      requestBody:
        description: Update function properties
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFunctionInput'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Function'
        '400':
          description: Invalid input
        '422':
          description: Validation exception
components:
  schemas:
    UpdateFunctionInput:
      allOf:
        - $ref: '#/components/schemas/BasicUpdateFunctionInput'
        - oneOf:
            - $ref: '#/components/schemas/UpdateTransferFunctionInput'
              title: Transfer
            - $ref: '#/components/schemas/UpdateAPIFunctionInput'
              title: API
          discriminator:
            propertyName: type
            mapping:
              transfer: '#/components/schemas/UpdateTransferFunctionInput'
              api: '#/components/schemas/UpdateAPIFunctionInput'
    Function:
      allOf:
        - $ref: '#/components/schemas/BasicFunction'
        - oneOf:
            - $ref: '#/components/schemas/TransferFunction'
              title: Transfer
            - $ref: '#/components/schemas/APIFunction'
              title: API
          discriminator:
            propertyName: type
            mapping:
              transfer: '#/components/schemas/TransferFunction'
              api: '#/components/schemas/APIFunction'
    BasicUpdateFunctionInput:
      type: object
      properties:
        name:
          type: string
          description: The name of the function.
          nullable: false
        displayName:
          type: string
          description: >-
            A human readable label for the function, used in the Vogent
            dashboard instead of the name. Never shown to the model. Set it to
            an empty string to fall back to the name.
          nullable: false
        description:
          type: string
          description: A description of what the function does.
          nullable: false
        type:
          type: string
          enum:
            - transfer
            - api
        lifecycleMessages:
          $ref: '#/components/schemas/FunctionLifecycleMessages'
          description: Messages to display during function execution lifecycle events.
    UpdateTransferFunctionInput:
      type: object
      properties:
        allowedNumbers:
          type: array
          description: The numbers that the agent is allowed to transfer to.
          items:
            $ref: '#/components/schemas/AllowedNumber'
          nullable: false
        allowAnyNumber:
          type: boolean
          description: >-
            Instead of using a fixed list of allowed numbers, allow the agent to
            transfer to any number (not recommended).
      required:
        - allowedNumbers
    UpdateAPIFunctionInput:
      type: object
      properties:
        apiPath:
          type: string
          description: The path to the API.
          nullable: false
        headers:
          type: array
          description: Headers to be sent with the API request
          items:
            $ref: '#/components/schemas/KVMapping'
          nullable: false
        inputJsonSchema:
          type: string
          description: >-
            The JSON schema for the input to the function. Must be a top level
            object.
      required:
        - apiPath
        - headers
        - inputJsonSchema
    BasicFunction:
      type: object
      properties:
        id:
          type: string
          nullable: false
        name:
          type: string
          description: The name of the function.
          nullable: false
        displayName:
          type: string
          description: >-
            A human readable label for the function, used in the Vogent
            dashboard instead of the name. Never shown to the model, and empty
            when unset — display the name in that case.
          nullable: false
        description:
          type: string
          description: A description of what the function does.
          nullable: false
        type:
          type: string
          enum:
            - transfer
            - api
          nullable: false
        lifecycleMessages:
          $ref: '#/components/schemas/FunctionLifecycleMessages'
          description: Messages to display during function execution lifecycle events.
      required:
        - id
        - name
        - displayName
        - description
        - type
    TransferFunction:
      type: object
      properties:
        allowedNumbers:
          type: array
          description: The numbers that the agent is allowed to transfer to.
          items:
            $ref: '#/components/schemas/AllowedNumber'
          nullable: false
        allowAnyNumber:
          type: boolean
          description: >-
            Instead of using a fixed list of allowed numbers, allow the agent to
            transfer to any number (not recommended).
      required:
        - allowedNumbers
        - allowAnyNumber
    APIFunction:
      type: object
      properties:
        apiPath:
          type: string
          description: The path to the API.
          nullable: false
        headers:
          type: array
          description: Headers to be sent with the API request
          items:
            $ref: '#/components/schemas/KVMapping'
          nullable: false
        inputJsonSchema:
          type: string
          description: >-
            The JSON schema for the input to the function. Must be a top level
            object.
      required:
        - apiPath
        - headers
        - inputJsonSchema
    FunctionLifecycleMessages:
      type: object
      properties:
        started:
          type: array
          description: >-
            Messages to display when the function starts executing. One will be
            chosen at random.
          items:
            type: string
          nullable: false
        waiting:
          type: array
          description: >-
            Messages to play while the function is still running and the model
            returned StillWaiting. One will be chosen at random. If empty, a
            built-in default set of English phrases is used.
          items:
            type: string
          nullable: false
        awaitSpeech:
          type: boolean
          description: >-
            Hold the function until the agent has finished speaking — any text
            said alongside the call, then the started message — instead of
            running it while the agent is still talking. Defaults to false.
          nullable: false
      required:
        - started
    AllowedNumber:
      type: object
      properties:
        number:
          type: string
          nullable: false
          description: The number in e.164 format.
      required:
        - number
    KVMapping:
      type: object
      properties:
        key:
          type: string
          nullable: false
        value:
          type: string
          nullable: false
      required:
        - key
        - value
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        In the form `Bearer <api_key_here>`. You can find your api key in your
        dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.