Update Tool
curl --request PATCH \
--url https://api.fish.audio/v1/agent/tools/{tool_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"arguments": [
{
"name": "<string>",
"description": ""
}
],
"url": "<string>",
"content_type": "<string>",
"body_template": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>",
"kind": "custom"
}
],
"timeout_seconds": 60,
"mock_responses": [
{
"name": "",
"status_code": 200,
"content_type": "application/json",
"body": ""
}
],
"expects_response": true
}
'import requests
url = "https://api.fish.audio/v1/agent/tools/{tool_id}"
payload = {
"name": "<string>",
"description": "<string>",
"arguments": [
{
"name": "<string>",
"description": ""
}
],
"url": "<string>",
"content_type": "<string>",
"body_template": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>",
"kind": "custom"
}
],
"timeout_seconds": 60,
"mock_responses": [
{
"name": "",
"status_code": 200,
"content_type": "application/json",
"body": ""
}
],
"expects_response": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
arguments: [{name: '<string>', description: ''}],
url: '<string>',
content_type: '<string>',
body_template: '<string>',
headers: [{name: '<string>', value: '<string>', kind: 'custom'}],
timeout_seconds: 60,
mock_responses: [
{
name: '',
status_code: 200,
content_type: 'application/json',
body: JSON.stringify('')
}
],
expects_response: true
})
};
fetch('https://api.fish.audio/v1/agent/tools/{tool_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fish.audio/v1/agent/tools/{tool_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'arguments' => [
[
'name' => '<string>',
'description' => ''
]
],
'url' => '<string>',
'content_type' => '<string>',
'body_template' => '<string>',
'headers' => [
[
'name' => '<string>',
'value' => '<string>',
'kind' => 'custom'
]
],
'timeout_seconds' => 60,
'mock_responses' => [
[
'name' => '',
'status_code' => 200,
'content_type' => 'application/json',
'body' => ''
]
],
'expects_response' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fish.audio/v1/agent/tools/{tool_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"arguments\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"url\": \"<string>\",\n \"content_type\": \"<string>\",\n \"body_template\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"kind\": \"custom\"\n }\n ],\n \"timeout_seconds\": 60,\n \"mock_responses\": [\n {\n \"name\": \"\",\n \"status_code\": 200,\n \"content_type\": \"application/json\",\n \"body\": \"\"\n }\n ],\n \"expects_response\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.fish.audio/v1/agent/tools/{tool_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"arguments\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"url\": \"<string>\",\n \"content_type\": \"<string>\",\n \"body_template\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"kind\": \"custom\"\n }\n ],\n \"timeout_seconds\": 60,\n \"mock_responses\": [\n {\n \"name\": \"\",\n \"status_code\": 200,\n \"content_type\": \"application/json\",\n \"body\": \"\"\n }\n ],\n \"expects_response\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fish.audio/v1/agent/tools/{tool_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"arguments\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"url\": \"<string>\",\n \"content_type\": \"<string>\",\n \"body_template\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"kind\": \"custom\"\n }\n ],\n \"timeout_seconds\": 60,\n \"mock_responses\": [\n {\n \"name\": \"\",\n \"status_code\": 200,\n \"content_type\": \"application/json\",\n \"body\": \"\"\n }\n ],\n \"expects_response\": true\n}"
response = http.request(request)
puts response.read_body{
"tool_id": "<string>",
"workspace_id": "<string>",
"name": "<string>",
"url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"content_type": "<string>",
"timeout_seconds": 123,
"description": "",
"used_by": 0,
"arguments": [
{
"name": "<string>",
"description": ""
}
],
"body_template": "",
"headers": [
{
"name": "<string>",
"value": "<string>",
"has_secret": false
}
],
"mock_responses": [
{
"name": "",
"status_code": 200,
"content_type": "application/json",
"body": ""
}
],
"expects_response": true
}{
"status": 123,
"message": "<string>"
}{
"status": 123,
"message": "<string>"
}{
"status": 123,
"message": "<string>"
}{
"status": 123,
"message": "<string>"
}Tools
Update Tool
Patch tool fields; omitted fields keep their value (null is rejected — send an empty string to clear a text field).
PATCH
/
v1
/
agent
/
tools
/
{tool_id}
Update Tool
curl --request PATCH \
--url https://api.fish.audio/v1/agent/tools/{tool_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"arguments": [
{
"name": "<string>",
"description": ""
}
],
"url": "<string>",
"content_type": "<string>",
"body_template": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>",
"kind": "custom"
}
],
"timeout_seconds": 60,
"mock_responses": [
{
"name": "",
"status_code": 200,
"content_type": "application/json",
"body": ""
}
],
"expects_response": true
}
'import requests
url = "https://api.fish.audio/v1/agent/tools/{tool_id}"
payload = {
"name": "<string>",
"description": "<string>",
"arguments": [
{
"name": "<string>",
"description": ""
}
],
"url": "<string>",
"content_type": "<string>",
"body_template": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>",
"kind": "custom"
}
],
"timeout_seconds": 60,
"mock_responses": [
{
"name": "",
"status_code": 200,
"content_type": "application/json",
"body": ""
}
],
"expects_response": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
arguments: [{name: '<string>', description: ''}],
url: '<string>',
content_type: '<string>',
body_template: '<string>',
headers: [{name: '<string>', value: '<string>', kind: 'custom'}],
timeout_seconds: 60,
mock_responses: [
{
name: '',
status_code: 200,
content_type: 'application/json',
body: JSON.stringify('')
}
],
expects_response: true
})
};
fetch('https://api.fish.audio/v1/agent/tools/{tool_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fish.audio/v1/agent/tools/{tool_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'arguments' => [
[
'name' => '<string>',
'description' => ''
]
],
'url' => '<string>',
'content_type' => '<string>',
'body_template' => '<string>',
'headers' => [
[
'name' => '<string>',
'value' => '<string>',
'kind' => 'custom'
]
],
'timeout_seconds' => 60,
'mock_responses' => [
[
'name' => '',
'status_code' => 200,
'content_type' => 'application/json',
'body' => ''
]
],
'expects_response' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fish.audio/v1/agent/tools/{tool_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"arguments\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"url\": \"<string>\",\n \"content_type\": \"<string>\",\n \"body_template\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"kind\": \"custom\"\n }\n ],\n \"timeout_seconds\": 60,\n \"mock_responses\": [\n {\n \"name\": \"\",\n \"status_code\": 200,\n \"content_type\": \"application/json\",\n \"body\": \"\"\n }\n ],\n \"expects_response\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.fish.audio/v1/agent/tools/{tool_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"arguments\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"url\": \"<string>\",\n \"content_type\": \"<string>\",\n \"body_template\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"kind\": \"custom\"\n }\n ],\n \"timeout_seconds\": 60,\n \"mock_responses\": [\n {\n \"name\": \"\",\n \"status_code\": 200,\n \"content_type\": \"application/json\",\n \"body\": \"\"\n }\n ],\n \"expects_response\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fish.audio/v1/agent/tools/{tool_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"arguments\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\"\n }\n ],\n \"url\": \"<string>\",\n \"content_type\": \"<string>\",\n \"body_template\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"kind\": \"custom\"\n }\n ],\n \"timeout_seconds\": 60,\n \"mock_responses\": [\n {\n \"name\": \"\",\n \"status_code\": 200,\n \"content_type\": \"application/json\",\n \"body\": \"\"\n }\n ],\n \"expects_response\": true\n}"
response = http.request(request)
puts response.read_body{
"tool_id": "<string>",
"workspace_id": "<string>",
"name": "<string>",
"url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"content_type": "<string>",
"timeout_seconds": 123,
"description": "",
"used_by": 0,
"arguments": [
{
"name": "<string>",
"description": ""
}
],
"body_template": "",
"headers": [
{
"name": "<string>",
"value": "<string>",
"has_secret": false
}
],
"mock_responses": [
{
"name": "",
"status_code": 200,
"content_type": "application/json",
"body": ""
}
],
"expects_response": true
}{
"status": 123,
"message": "<string>"
}{
"status": 123,
"message": "<string>"
}{
"status": 123,
"message": "<string>"
}{
"status": 123,
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Required string length:
1 - 120Maximum string length:
2000Show child attributes
Show child attributes
Available options:
GET, POST, PUT, PATCH, DELETE Required string length:
1 - 4000Maximum string length:
128Maximum string length:
100000Show child attributes
Show child attributes
Required range:
1 <= x <= 120Available options:
passthrough, hide Show child attributes
Show child attributes
Response
Request fulfilled, document follows
Available options:
webhook, client Available options:
GET, POST, PUT, PATCH, DELETE Available options:
passthrough, hide How many agents reference this tool in their draft configuration.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I

