> ## Documentation Index
> Fetch the complete documentation index at: https://hanabiaiinc-fish-772-enterprise-versions.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create 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). Attach it to agents via the agent config's

        `tools.tool_ids`. Credential headers (authorization_bearer /

        authorization_basic) are write-only and read back as `has_secret`.
      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:
                    items:
                      $ref: '#/components/schemas/AgentWebhookArgumentPayload'
                    title: Arguments
                    type: array
                  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
                required:
                  - tool_id
                  - workspace_id
                  - name
                  - tool_type
                  - method
                  - url
                  - created_at
                  - updated_at
                  - 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
                required:
                  - status
                  - message
                type: object
        '422':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                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:
          items:
            $ref: '#/components/schemas/AgentWebhookArgumentPayload'
          title: Arguments
          type: array
        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: ''
          maxLength: 100000
          title: Body Template
          type: string
        headers:
          items:
            $ref: '#/components/schemas/AgentWebhookHeaderPayload'
          title: Headers
          type: array
        timeout_seconds:
          default: 30
          maximum: 120
          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
      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
    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 credential kinds (authorization_bearer /
            authorization_basic), which are write-only.
          title: Value
        has_secret:
          default: false
          description: >-
            Whether a credential value is stored; 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
    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

````