curl --request PATCH \
--url https://api-prod.interactly.ai/assistants/v1/tools/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"async": false,
"messages": [
{
"type": "request-start",
"content": "Please wait while I fetch the details."
}
]
}
'import requests
url = "https://api-prod.interactly.ai/assistants/v1/tools/{id}"
payload = {
"async": False,
"messages": [
{
"type": "request-start",
"content": "Please wait while I fetch the details."
}
]
}
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({
async: false,
messages: [{type: 'request-start', content: 'Please wait while I fetch the details.'}]
})
};
fetch('https://api-prod.interactly.ai/assistants/v1/tools/{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-prod.interactly.ai/assistants/v1/tools/{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([
'async' => false,
'messages' => [
[
'type' => 'request-start',
'content' => 'Please wait while I fetch the details.'
]
]
]),
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-prod.interactly.ai/assistants/v1/tools/{id}"
payload := strings.NewReader("{\n \"async\": false,\n \"messages\": [\n {\n \"type\": \"request-start\",\n \"content\": \"Please wait while I fetch the details.\"\n }\n ]\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-prod.interactly.ai/assistants/v1/tools/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"async\": false,\n \"messages\": [\n {\n \"type\": \"request-start\",\n \"content\": \"Please wait while I fetch the details.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/assistants/v1/tools/{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 \"async\": false,\n \"messages\": [\n {\n \"type\": \"request-start\",\n \"content\": \"Please wait while I fetch the details.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "1f7b1b1b1b1b1b1b1b1b1b1b",
"teamId": "3f7b1b1b1b1b1b1b1b1b1b1b",
"type": "function",
"async": false,
"function": {
"name": "getUserDetailsByPhoneNumber",
"description": "Get user details by phone number, Run this tool when you want user details like name, dob etc by their phone number",
"parameters": {
"type": "object",
"properties": {
"dob": {
"type": "string",
"format": "date",
"description": "This is the date of birth of the user.",
"example": "1990-03-08"
},
"phoneNumber": {
"type": "string",
"description": "This is the phone number of the user.",
"example": "+919867543210"
}
},
"required": [
"phoneNumber"
],
"additionalProperties": false
},
"strict": false
},
"messages": [
{
"type": "request-start",
"content": "Please wait while I fetch the details."
}
],
"server": {
"url": "https://api.example.com/v1/getUserDetails",
"timeoutSeconds": 20,
"secret": "my-secret",
"headers": {}
},
"createdAt": "2020-10-05T00:00:00.000Z",
"updatedAt": "2020-10-05T00:00:00.000Z"
}{
"message": "Tool not found!"
}{
"message": "Tool already exists with the same name"
}{
"message": "Something went wrong!",
"error": "INTERNAL_ERROR"
}Update Tool
curl --request PATCH \
--url https://api-prod.interactly.ai/assistants/v1/tools/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"async": false,
"messages": [
{
"type": "request-start",
"content": "Please wait while I fetch the details."
}
]
}
'import requests
url = "https://api-prod.interactly.ai/assistants/v1/tools/{id}"
payload = {
"async": False,
"messages": [
{
"type": "request-start",
"content": "Please wait while I fetch the details."
}
]
}
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({
async: false,
messages: [{type: 'request-start', content: 'Please wait while I fetch the details.'}]
})
};
fetch('https://api-prod.interactly.ai/assistants/v1/tools/{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-prod.interactly.ai/assistants/v1/tools/{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([
'async' => false,
'messages' => [
[
'type' => 'request-start',
'content' => 'Please wait while I fetch the details.'
]
]
]),
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-prod.interactly.ai/assistants/v1/tools/{id}"
payload := strings.NewReader("{\n \"async\": false,\n \"messages\": [\n {\n \"type\": \"request-start\",\n \"content\": \"Please wait while I fetch the details.\"\n }\n ]\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-prod.interactly.ai/assistants/v1/tools/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"async\": false,\n \"messages\": [\n {\n \"type\": \"request-start\",\n \"content\": \"Please wait while I fetch the details.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/assistants/v1/tools/{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 \"async\": false,\n \"messages\": [\n {\n \"type\": \"request-start\",\n \"content\": \"Please wait while I fetch the details.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "1f7b1b1b1b1b1b1b1b1b1b1b",
"teamId": "3f7b1b1b1b1b1b1b1b1b1b1b",
"type": "function",
"async": false,
"function": {
"name": "getUserDetailsByPhoneNumber",
"description": "Get user details by phone number, Run this tool when you want user details like name, dob etc by their phone number",
"parameters": {
"type": "object",
"properties": {
"dob": {
"type": "string",
"format": "date",
"description": "This is the date of birth of the user.",
"example": "1990-03-08"
},
"phoneNumber": {
"type": "string",
"description": "This is the phone number of the user.",
"example": "+919867543210"
}
},
"required": [
"phoneNumber"
],
"additionalProperties": false
},
"strict": false
},
"messages": [
{
"type": "request-start",
"content": "Please wait while I fetch the details."
}
],
"server": {
"url": "https://api.example.com/v1/getUserDetails",
"timeoutSeconds": 20,
"secret": "my-secret",
"headers": {}
},
"createdAt": "2020-10-05T00:00:00.000Z",
"updatedAt": "2020-10-05T00:00:00.000Z"
}{
"message": "Tool not found!"
}{
"message": "Tool already exists with the same name"
}{
"message": "Something went wrong!",
"error": "INTERNAL_ERROR"
}Authorizations
Retrieve your API Key from Dashboard API Keys Section.
Body
This determines if the tool is async.
If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.
If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.
Defaults to synchronous (false).
false
Response
This determines if the tool is async.
If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.
If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.
Defaults to synchronous (false).
false