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

# Create Voice Agent Tool

> Create a workspace tool.



## OpenAPI

````yaml post /v1/agent/tools
openapi: 3.1.0
info:
  title: FishAudio OpenAPI
  version: '1'
servers:
  - description: Fish Audio API
    url: https://api.fish.audio
security: []
tags: []
paths:
  /v1/agent/tools:
    post:
      tags:
        - Agent Tools
      summary: Create Tool
      description: >-
        Create a workspace tool. `tool_type: webhook` calls your HTTP endpoint

        during conversations; `tool_type: client` is executed by your own
        frontend

        through the SDK (no URL). Describe the call with `parameters` (a JSON

        Schema object, checked at call time under `parameter_mode: strict`) or

        the older `arguments` list (every argument a required string,
        unchecked).

        Attach it to agents via the agent config's `tools.tool_ids`. Credential

        headers (authorization_bearer / authorization_basic, and custom headers

        whose name looks like a credential, such as `X-Api-Key` or

        `X-Webhook-Token`) are write-only and

        read back as `has_secret`.


        Only what `body_template`, `url` and `headers` reference is sent to the

        endpoint. A non-GET tool with no `body_template` sends no body, so its

        parameters are lost unless the URL or headers use them; the response
        then

        lists them under `warnings` (as do Get Tool and Update Tool). The tool
        is

        still saved.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentToolCreatePayload'
      responses:
        '201':
          description: Document created, URL follows
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  tool_id:
                    title: Tool Id
                    type: string
                  workspace_id:
                    title: Workspace Id
                    type: string
                  name:
                    title: Name
                    type: string
                  description:
                    default: ''
                    title: Description
                    type: string
                  tool_type:
                    enum:
                      - webhook
                      - client
                    title: Tool Type
                    type: string
                  method:
                    enum:
                      - GET
                      - POST
                      - PUT
                      - PATCH
                      - DELETE
                    title: Method
                    type: string
                  url:
                    title: Url
                    type: string
                  used_by:
                    default: 0
                    description: >-
                      How many agents reference this tool in their draft
                      configuration.
                    title: Used By
                    type: integer
                  created_at:
                    format: date-time
                    title: Created At
                    type: string
                  updated_at:
                    format: date-time
                    title: Updated At
                    type: string
                  arguments:
                    description: >-
                      Older shape of `parameters`: each entry becomes a required
                      string parameter. Mutually exclusive with `parameters` in
                      one request. Reads return both, `arguments` being the
                      string parameters of the schema.
                    items:
                      $ref: '#/components/schemas/AgentWebhookArgumentPayload'
                    title: Arguments
                    type: array
                  parameters:
                    additionalProperties:
                      $ref: '#/components/schemas/JsonValue'
                    description: >-
                      Call parameters as a JSON Schema object (draft 2020-12):
                      `type: object` (filled in when omitted), `properties`,
                      `required`. Standard meaning throughout: `required` means
                      the key must be present, `type: ["string", "null"]` allows
                      null, `minLength: 1` makes a string non-empty, `enum` and
                      `pattern` constrain the value, `default` fills a key the
                      model left out. Mutually exclusive with `arguments` in one
                      request. A tool created with `parameters` starts in
                      `parameter_mode: strict`.
                    title: Parameters
                    type: object
                  parameter_mode:
                    default: legacy
                    description: >-
                      Whether the agent runtime checks each call's arguments
                      against `parameters` before running the tool. `legacy`
                      (the default for tools created with `arguments`, and every
                      tool from before this field existed): no check, the
                      model's arguments run as sent. `strict` (the default for
                      tools created with `parameters`): a call that does not
                      satisfy the schema is refused and the model is told to ask
                      the caller for the missing information, and the LLM
                      provider's constrained decoding is turned on where the
                      model supports it (OpenAI models and a custom
                      OpenAI-compatible endpoint receive the tool with `strict:
                      true`, Gemini on the platform's native channel runs
                      validated function calling). Changing `parameters` never
                      changes the mode, and the mode can be changed on its own.
                    enum:
                      - legacy
                      - strict
                    title: Parameter Mode
                    type: string
                  content_type:
                    title: Content Type
                    type: string
                  body_template:
                    default: ''
                    title: Body Template
                    type: string
                  headers:
                    items:
                      $ref: '#/components/schemas/PublicToolHeader'
                    title: Headers
                    type: array
                  timeout_seconds:
                    title: Timeout Seconds
                    type: integer
                  error_handling:
                    enum:
                      - passthrough
                      - hide
                    title: Error Handling
                    type: string
                  mock_responses:
                    items:
                      $ref: '#/components/schemas/AgentWebhookMockResponsePayload'
                    title: Mock Responses
                    type: array
                  expects_response:
                    default: true
                    title: Expects Response
                    type: boolean
                  execution_mode:
                    default: blocking
                    enum:
                      - blocking
                      - fire_and_forget
                      - background
                    title: Execution Mode
                    type: string
                  pre_tool_speech:
                    $ref: '#/components/schemas/AgentToolPreToolSpeech'
                    description: >-
                      What the caller hears as this tool starts, when the
                      agent's own reply has not said anything yet. `auto` (the
                      default for a new tool): the platform decides for each
                      call whether a line is worth saying, and the model writes
                      the line when one is said. `static`: the agent says
                      `message` as written (required, one language). `off`:
                      nothing (what a tool created before this field reads as).
                      Applies to blocking webhook tools and to client tools with
                      `expects_response: true`. It is stored but not used for
                      other tools.
                  signing:
                    $ref: '#/components/schemas/AgentWebhookToolSigningStatus'
                    description: >-
                      Request signing state. Secrets are write-only: rotate
                      returns the new one once.
                  warnings:
                    description: >-
                      Problems with a saved tool that do not stop it from being
                      saved. Empty when there are none.
                    items:
                      $ref: '#/components/schemas/PublicAgentToolWarning'
                    title: Warnings
                    type: array
                required:
                  - tool_id
                  - workspace_id
                  - name
                  - tool_type
                  - method
                  - url
                  - created_at
                  - updated_at
                  - parameters
                  - content_type
                  - timeout_seconds
                  - error_handling
                type: object
        '401':
          description: No permission -- see authorization schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '422':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '503':
          description: The server cannot process the request due to a high load
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: bash
          label: Create Webhook Tool
          source: |-
            curl --request POST \
              --url https://api.fish.audio/v1/agent/tools \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "name": "Book appointment",
                "description": "Creates an appointment in the scheduling system.",
                "method": "POST",
                "url": "https://api.example.com/appointments",
                "arguments": [
                  {"name": "date", "description": "Appointment date, YYYY-MM-DD"}
                ],
                "body_template": "{\"date\": \"{{date}}\"}",
                "headers": [
                  {"name": "Authorization", "value": "Bearer <api-token>", "kind": "authorization_bearer"}
                ]
              }'
components:
  schemas:
    PublicAgentToolCreatePayload:
      additionalProperties: false
      description: Console payload minus the folder concept (folders are console-only).
      properties:
        name:
          maxLength: 120
          minLength: 1
          title: Name
          type: string
        description:
          default: ''
          maxLength: 2000
          title: Description
          type: string
        tool_type:
          default: webhook
          enum:
            - webhook
            - client
          title: Tool Type
          type: string
        arguments:
          description: >-
            Older shape of `parameters`: each entry becomes a required string
            parameter. Mutually exclusive with `parameters` in one request.
            Reads return both, `arguments` being the string parameters of the
            schema.
          items:
            $ref: '#/components/schemas/AgentWebhookArgumentPayload'
          title: Arguments
          type: array
        parameters:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/JsonValue'
              type: object
            - type: 'null'
          default: null
          description: >-
            Call parameters as a JSON Schema object (draft 2020-12): `type:
            object` (filled in when omitted), `properties`, `required`. Standard
            meaning throughout: `required` means the key must be present, `type:
            ["string", "null"]` allows null, `minLength: 1` makes a string
            non-empty, `enum` and `pattern` constrain the value, `default` fills
            a key the model left out. Mutually exclusive with `arguments` in one
            request. A tool created with `parameters` starts in `parameter_mode:
            strict`.
          title: Parameters
        parameter_mode:
          anyOf:
            - enum:
                - legacy
                - strict
              type: string
            - type: 'null'
          default: null
          description: >-
            Whether the agent runtime checks each call's arguments against
            `parameters` before running the tool. `legacy` (the default for
            tools created with `arguments`, and every tool from before this
            field existed): no check, the model's arguments run as sent.
            `strict` (the default for tools created with `parameters`): a call
            that does not satisfy the schema is refused and the model is told to
            ask the caller for the missing information, and the LLM provider's
            constrained decoding is turned on where the model supports it
            (OpenAI models and a custom OpenAI-compatible endpoint receive the
            tool with `strict: true`, Gemini on the platform's native channel
            runs validated function calling). Changing `parameters` never
            changes the mode, and the mode can be changed on its own.
          title: Parameter Mode
        method:
          default: POST
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          title: Method
          type: string
        url:
          default: ''
          maxLength: 4000
          title: Url
          type: string
        content_type:
          default: application/json
          maxLength: 128
          title: Content Type
          type: string
        body_template:
          default: ''
          description: >-
            Request body sent for non-GET calls. `{{argument}}`, `{{system.*}}`
            and custom session variable placeholders are filled in at call time;
            a missing value becomes empty. When the body's content type is JSON
            (the default `application/json`, any `+json` type, or a
            `Content-Type` header saying so), a placeholder inside a JSON
            string, such as `{"note": "{{note}}"}`, is JSON-escaped, so quotes,
            backslashes and newlines in the value keep the body valid JSON. A
            placeholder outside a string, such as `{"count": {{count}}}`, is
            inserted as is. Other content types are filled in as is. The body is
            only this template: parameters are not added on their own. With an
            empty template a non-GET call sends no body, and a parameter that
            `url` and `headers` do not reference either never reaches the
            endpoint.
          maxLength: 100000
          title: Body Template
          type: string
        headers:
          items:
            $ref: '#/components/schemas/AgentWebhookHeaderPayload'
          title: Headers
          type: array
        timeout_seconds:
          default: 30
          maximum: 300
          minimum: 1
          title: Timeout Seconds
          type: integer
        error_handling:
          default: passthrough
          enum:
            - passthrough
            - hide
          title: Error Handling
          type: string
        mock_responses:
          items:
            $ref: '#/components/schemas/AgentWebhookMockResponsePayload'
          title: Mock Responses
          type: array
        expects_response:
          default: true
          title: Expects Response
          type: boolean
        execution_mode:
          default: blocking
          enum:
            - blocking
            - fire_and_forget
            - background
          title: Execution Mode
          type: string
        pre_tool_speech:
          anyOf:
            - $ref: '#/components/schemas/AgentToolPreToolSpeech'
            - type: 'null'
          default: null
          description: >-
            What the caller hears as this tool starts, when the agent's own
            reply has not said anything yet. `auto` (the default for a new
            tool): the platform decides for each call whether a line is worth
            saying, and the model writes the line when one is said. `static`:
            the agent says `message` as written (required, one language). `off`:
            nothing (what a tool created before this field reads as). Applies to
            blocking webhook tools and to client tools with `expects_response:
            true`. It is stored but not used for other tools.
      required:
        - name
      title: PublicAgentToolCreatePayload
      type: object
    AgentWebhookArgumentPayload:
      properties:
        name:
          maxLength: 64
          minLength: 1
          title: Name
          type: string
        description:
          default: ''
          maxLength: 500
          title: Description
          type: string
      required:
        - name
      title: AgentWebhookArgumentPayload
      type: object
    JsonValue: {}
    PublicToolHeader:
      properties:
        name:
          title: Name
          type: string
        kind:
          enum:
            - custom
            - authorization_bearer
            - authorization_basic
          title: Kind
          type: string
        value:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Header value; null for write-only headers: the credential kinds
            (authorization_bearer / authorization_basic) and custom headers
            whose name looks like a credential (containing auth, token, secret,
            password, cookie, signature, credential, bearer, jwt, api-key or a
            standalone key).
          title: Value
        has_secret:
          default: false
          description: >-
            Whether a write-only header has a stored value; the value itself is
            never returned.
          title: Has Secret
          type: boolean
      required:
        - name
        - kind
      title: PublicToolHeader
      type: object
    AgentWebhookMockResponsePayload:
      properties:
        name:
          default: ''
          maxLength: 120
          title: Name
          type: string
        status_code:
          default: 200
          maximum: 599
          minimum: 100
          title: Status Code
          type: integer
        content_type:
          default: application/json
          maxLength: 128
          title: Content Type
          type: string
        body:
          default: ''
          maxLength: 100000
          title: Body
          type: string
      title: AgentWebhookMockResponsePayload
      type: object
    AgentToolPreToolSpeech:
      additionalProperties: false
      properties:
        mode:
          enum:
            - auto
            - 'off'
            - static
          title: Mode
          type: string
        message:
          default: ''
          description: What to say. Required, and only used, when `mode` is `static`.
          maxLength: 500
          title: Message
          type: string
      required:
        - mode
      title: AgentToolPreToolSpeech
      type: object
    AgentWebhookToolSigningStatus:
      description: |-
        Request signing state of a webhook tool. Secret values never appear in
        reads: the rotate call returns the new secret once.
      properties:
        enabled:
          default: false
          description: >-
            Whether requests carry `X-Fish-Webhook-Signature` (HMAC-SHA256 over
            `{t}.{body}`, the post-call webhook scheme).
          title: Enabled
          type: boolean
        secret_created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          title: Secret Created At
        previous_secret_expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: >-
            Set while the rotated-out secret still signs as a second `v1`; null
            once it expired or was revoked.
          title: Previous Secret Expires At
      title: AgentWebhookToolSigningStatus
      type: object
    PublicAgentToolWarning:
      properties:
        code:
          const: parameters_not_sent
          description: >-
            `parameters_not_sent`: the tool sends a request body but has no
            `body_template`, and these parameters appear in neither `url` nor
            `headers`, so they never reach the endpoint.
          title: Code
          type: string
        parameters:
          description: Names of the parameters the endpoint will not receive.
          items:
            type: string
          title: Parameters
          type: array
        message:
          title: Message
          type: string
      required:
        - code
        - parameters
        - message
      title: PublicAgentToolWarning
      type: object
    AgentWebhookHeaderPayload:
      properties:
        name:
          maxLength: 128
          minLength: 1
          title: Name
          type: string
        value:
          maxLength: 4000
          title: Value
          type: string
        kind:
          default: custom
          enum:
            - custom
            - authorization_bearer
            - authorization_basic
          title: Kind
          type: string
      required:
        - name
        - value
      title: AgentWebhookHeaderPayload
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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