curl --request PUT \
--url https://api-prod.interactly.ai/assistants/v1/numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assistantId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"inboundEnabled": true,
"outboundEnabled": true
}
'import requests
url = "https://api-prod.interactly.ai/assistants/v1/numbers/{id}"
payload = {
"assistantId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"inboundEnabled": True,
"outboundEnabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assistantId: 'a12f9c88-c155-461f-9771-4d240cdc9a04',
inboundEnabled: true,
outboundEnabled: true
})
};
fetch('https://api-prod.interactly.ai/assistants/v1/numbers/{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/numbers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'assistantId' => 'a12f9c88-c155-461f-9771-4d240cdc9a04',
'inboundEnabled' => true,
'outboundEnabled' => 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-prod.interactly.ai/assistants/v1/numbers/{id}"
payload := strings.NewReader("{\n \"assistantId\": \"a12f9c88-c155-461f-9771-4d240cdc9a04\",\n \"inboundEnabled\": true,\n \"outboundEnabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-prod.interactly.ai/assistants/v1/numbers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assistantId\": \"a12f9c88-c155-461f-9771-4d240cdc9a04\",\n \"inboundEnabled\": true,\n \"outboundEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/assistants/v1/numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assistantId\": \"a12f9c88-c155-461f-9771-4d240cdc9a04\",\n \"inboundEnabled\": true,\n \"outboundEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"_id": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"teamId": "1f7b1b1b1b1b1b1b1b1b1b1b",
"number": "+1234567890",
"provider": {
"name": "twilio"
},
"assistantId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"inboundEnabled": true,
"outboundEnabled": true,
"label": "friendly-name-1"
}{
"message": "Not received valid inputs!"
}{
"message": "Failed to update number",
"error": "INTERNAL_ERROR"
}Update Number
To attach or detach assistant to the number, or enable or disable the inbound/outbound call.
curl --request PUT \
--url https://api-prod.interactly.ai/assistants/v1/numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assistantId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"inboundEnabled": true,
"outboundEnabled": true
}
'import requests
url = "https://api-prod.interactly.ai/assistants/v1/numbers/{id}"
payload = {
"assistantId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"inboundEnabled": True,
"outboundEnabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assistantId: 'a12f9c88-c155-461f-9771-4d240cdc9a04',
inboundEnabled: true,
outboundEnabled: true
})
};
fetch('https://api-prod.interactly.ai/assistants/v1/numbers/{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/numbers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'assistantId' => 'a12f9c88-c155-461f-9771-4d240cdc9a04',
'inboundEnabled' => true,
'outboundEnabled' => 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-prod.interactly.ai/assistants/v1/numbers/{id}"
payload := strings.NewReader("{\n \"assistantId\": \"a12f9c88-c155-461f-9771-4d240cdc9a04\",\n \"inboundEnabled\": true,\n \"outboundEnabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-prod.interactly.ai/assistants/v1/numbers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assistantId\": \"a12f9c88-c155-461f-9771-4d240cdc9a04\",\n \"inboundEnabled\": true,\n \"outboundEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/assistants/v1/numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assistantId\": \"a12f9c88-c155-461f-9771-4d240cdc9a04\",\n \"inboundEnabled\": true,\n \"outboundEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"_id": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"teamId": "1f7b1b1b1b1b1b1b1b1b1b1b",
"number": "+1234567890",
"provider": {
"name": "twilio"
},
"assistantId": "a12f9c88-c155-461f-9771-4d240cdc9a04",
"inboundEnabled": true,
"outboundEnabled": true,
"label": "friendly-name-1"
}{
"message": "Not received valid inputs!"
}{
"message": "Failed to update number",
"error": "INTERNAL_ERROR"
}Authorizations
Retrieve your API Key from Dashboard API Keys Section.
Path Parameters
The ID of the number to update.
Body
To attach assistant, give id of the assistant. To detach assistant, give empty string.
"a12f9c88-c155-461f-9771-4d240cdc9a04"
To enable inbound call, set to true. To disable inbound call, set to false.
true
To enable outbound call, set to true. To disable outbound call, set to false.
true
Response
Successfully updated the number.
Unique identifier of the number
"a12f9c88-c155-461f-9771-4d240cdc9a04"
This is unique identifier of the team.
"1f7b1b1b1b1b1b1b1b1b1b1b"
Phone number associated with the team
"+1234567890"
Show child attributes
Show child attributes
ID of the associated assistant (if any)
"a12f9c88-c155-461f-9771-4d240cdc9a04"
If true, inbound call is enabled. If false, inbound call is disabled.
true
If true, outbound call is enabled. If false, outbound call is disabled.
true
Label for the number
"friendly-name-1"