curl --request PATCH \
--url https://api.tryhamsa.com/v1/voice-agents/web-tool/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"async": true,
"messages": [
{
"type": "system",
"content": "system"
}
],
"params": {}
}
'import requests
url = "https://api.tryhamsa.com/v1/voice-agents/web-tool/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"async": True,
"messages": [
{
"type": "system",
"content": "system"
}
],
"params": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
async: true,
messages: [{type: 'system', content: 'system'}],
params: {}
})
};
fetch('https://api.tryhamsa.com/v1/voice-agents/web-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.tryhamsa.com/v1/voice-agents/web-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>',
'async' => true,
'messages' => [
[
'type' => 'system',
'content' => 'system'
]
],
'params' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.tryhamsa.com/v1/voice-agents/web-tool/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"async\": true,\n \"messages\": [\n {\n \"type\": \"system\",\n \"content\": \"system\"\n }\n ],\n \"params\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.tryhamsa.com/v1/voice-agents/web-tool/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"async\": true,\n \"messages\": [\n {\n \"type\": \"system\",\n \"content\": \"system\"\n }\n ],\n \"params\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v1/voice-agents/web-tool/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"async\": true,\n \"messages\": [\n {\n \"type\": \"system\",\n \"content\": \"system\"\n }\n ],\n \"params\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": false,
"message": "success",
"data": {
"id": "d949f13f-40d2-4e48-ac86-b66633070603",
"persistentId": "cmjx8qzw0000004kz3jek1ktu",
"version": 1,
"name": "Weather API Tool",
"type": "FUNCTION",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"projectId": "d949f13f-40d2-4e48-ac86-b66633070603",
"isActive": true,
"async": true,
"description": "A tool that fetches current weather information for a given location.",
"collectionId": "550e8400-e29b-41d4-a716-446655440000",
"toolSettings": {
"serverUrl": "https://api.example.com/webhook",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "Bearer token"
},
"pathParameters": {
"userId": "12345"
},
"timeout": 5000,
"authToken": "bearer_token_12345",
"methodType": "POST"
},
"params": {
"location": {
"type": "string",
"description": "The location to get weather for"
}
},
"messages": [
{
"type": "system",
"content": "You are a helpful weather assistant."
}
]
}
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Update a web tool by Id.
curl --request PATCH \
--url https://api.tryhamsa.com/v1/voice-agents/web-tool/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"async": true,
"messages": [
{
"type": "system",
"content": "system"
}
],
"params": {}
}
'import requests
url = "https://api.tryhamsa.com/v1/voice-agents/web-tool/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"async": True,
"messages": [
{
"type": "system",
"content": "system"
}
],
"params": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
async: true,
messages: [{type: 'system', content: 'system'}],
params: {}
})
};
fetch('https://api.tryhamsa.com/v1/voice-agents/web-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.tryhamsa.com/v1/voice-agents/web-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>',
'async' => true,
'messages' => [
[
'type' => 'system',
'content' => 'system'
]
],
'params' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.tryhamsa.com/v1/voice-agents/web-tool/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"async\": true,\n \"messages\": [\n {\n \"type\": \"system\",\n \"content\": \"system\"\n }\n ],\n \"params\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.tryhamsa.com/v1/voice-agents/web-tool/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"async\": true,\n \"messages\": [\n {\n \"type\": \"system\",\n \"content\": \"system\"\n }\n ],\n \"params\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v1/voice-agents/web-tool/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"async\": true,\n \"messages\": [\n {\n \"type\": \"system\",\n \"content\": \"system\"\n }\n ],\n \"params\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": false,
"message": "success",
"data": {
"id": "d949f13f-40d2-4e48-ac86-b66633070603",
"persistentId": "cmjx8qzw0000004kz3jek1ktu",
"version": 1,
"name": "Weather API Tool",
"type": "FUNCTION",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"projectId": "d949f13f-40d2-4e48-ac86-b66633070603",
"isActive": true,
"async": true,
"description": "A tool that fetches current weather information for a given location.",
"collectionId": "550e8400-e29b-41d4-a716-446655440000",
"toolSettings": {
"serverUrl": "https://api.example.com/webhook",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "Bearer token"
},
"pathParameters": {
"userId": "12345"
},
"timeout": 5000,
"authToken": "bearer_token_12345",
"methodType": "POST"
},
"params": {
"location": {
"type": "string",
"description": "The location to get weather for"
}
},
"messages": [
{
"type": "system",
"content": "You are a helpful weather assistant."
}
]
}
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Authorizations
Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '
Path Parameters
"8e8e9b4b-4d4b-4b4b-4b4b-4b4b4b4b4b4b"
Body
The type of the web tool.
FUNCTION, MCP The name of the web tool.
1 - 250A description of what the web tool does.
1 - 1000Whether the tool should run asynchronously. Required when type is FUNCTION, not allowed when type is MCP.
Server configuration settings for the web tool.
Show child attributes
Show child attributes
Array of message configurations for the web tool. Each message type must be unique.
Show child attributes
Show child attributes
Parameter schema definition for the web tool. Not allowed when type is MCP. This field is a recursive OpenAPI-style shape with 'type', 'properties', 'required', 'items', ...etc. Please refer to the OpenAPI specification for more information.
Was this page helpful?