---
title: "Update function"
method: PUT
path: "/functions/{id}"
---

# Update function

`PUT /functions/{id}`

## Request

- Base URL: `https://api.vogent.ai/api`
- URL: `https://api.vogent.ai/api/functions/{id}`
- Auth: HTTP bearer

Updates a specific function.

## Request body

- union
  - object
    - `name` string: The name of the function.
    - `displayName` string: 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.
    - `description` string: A description of what the function does.
    - `type` 'transfer' | 'api'
    - `lifecycleMessages` FunctionLifecycleMessages
      - `started` string[], required: Messages to display when the function starts executing. One will be chosen at random.
      - `waiting` string[]: 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.
      - `awaitSpeech` boolean: 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.
    - `allowedNumbers` AllowedNumber[], required: The numbers that the agent is allowed to transfer to.
      - `number` string, required: The number in e.164 format.
    - `allowAnyNumber` boolean: Instead of using a fixed list of allowed numbers, allow the agent to transfer to any number (not recommended).
  - object
    - `name` string: The name of the function.
    - `displayName` string: 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.
    - `description` string: A description of what the function does.
    - `type` 'transfer' | 'api'
    - `lifecycleMessages` FunctionLifecycleMessages
      - `started` string[], required: Messages to display when the function starts executing. One will be chosen at random.
      - `waiting` string[]: 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.
      - `awaitSpeech` boolean: 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.
    - `apiPath` string, required: The path to the API.
    - `headers` KVMapping[], required: Headers to be sent with the API request
      - `key` string, required
      - `value` string, required
    - `inputJsonSchema` string, required: The JSON schema for the input to the function. Must be a top level object.

## Response `200`

Successful operation

- union
  - object
    - `id` string, required
    - `name` string, required: The name of the function.
    - `displayName` string, required: 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.
    - `description` string, required: A description of what the function does.
    - `type` 'transfer' | 'api', required
    - `lifecycleMessages` FunctionLifecycleMessages
      - `started` string[], required: Messages to display when the function starts executing. One will be chosen at random.
      - `waiting` string[]: 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.
      - `awaitSpeech` boolean: 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.
    - `allowedNumbers` AllowedNumber[], required: The numbers that the agent is allowed to transfer to.
      - `number` string, required: The number in e.164 format.
    - `allowAnyNumber` boolean, required: Instead of using a fixed list of allowed numbers, allow the agent to transfer to any number (not recommended).
  - object
    - `id` string, required
    - `name` string, required: The name of the function.
    - `displayName` string, required: 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.
    - `description` string, required: A description of what the function does.
    - `type` 'transfer' | 'api', required
    - `lifecycleMessages` FunctionLifecycleMessages
      - `started` string[], required: Messages to display when the function starts executing. One will be chosen at random.
      - `waiting` string[]: 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.
      - `awaitSpeech` boolean: 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.
    - `apiPath` string, required: The path to the API.
    - `headers` KVMapping[], required: Headers to be sent with the API request
      - `key` string, required
      - `value` string, required
    - `inputJsonSchema` string, required: The JSON schema for the input to the function. Must be a top level object.

## Other responses

- `400`: Invalid input
- `422`: Validation exception

---

[API](https://skmtc.dev/vogent/apis/vogent-openapi-3-0.md) - [All operations](https://skmtc.dev/vogent/apis/vogent-openapi-3-0/llms.txt) - [OpenAPI document](https://skmtc.dev/vogent/apis/vogent-openapi-3-0/revisions/a5966cc364ef?raw)
