Make a VoiceLink DID inbound-ready
Runs the secure, idempotent inbound setup workflow for one purchased VoiceLink DID. The deployment must enable the inbound runtime and configure a public WSS URL plus signing secret. Vocobase imports and enables the local number, optionally maps a currently-unmapped DID to an explicit client, creates or updates the client bot with a signed connection-scoped endpoint, points inbound routing to that bot, preserves every existing outbound routing field, and assigns the local number to the requested agent. The request cannot override the WebSocket URL.
curl --request POST \
--url https://api.vocobase.com/api/v2/voicelink/inbound-ready \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "9b7f1c44-c87f-4f0c-9124-3c802a9c1a20",
"did_id": 812,
"client_id": 415,
"agent_id": "f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55",
"bot_name": "Vocobase inbound +918011223344"
}
'import requests
url = "https://api.vocobase.com/api/v2/voicelink/inbound-ready"
payload = {
"connection_id": "9b7f1c44-c87f-4f0c-9124-3c802a9c1a20",
"did_id": 812,
"client_id": 415,
"agent_id": "f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55",
"bot_name": "Vocobase inbound +918011223344"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_id: '9b7f1c44-c87f-4f0c-9124-3c802a9c1a20',
did_id: 812,
client_id: 415,
agent_id: 'f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55',
bot_name: 'Vocobase inbound +918011223344'
})
};
fetch('https://api.vocobase.com/api/v2/voicelink/inbound-ready', 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.vocobase.com/api/v2/voicelink/inbound-ready",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_id' => '9b7f1c44-c87f-4f0c-9124-3c802a9c1a20',
'did_id' => 812,
'client_id' => 415,
'agent_id' => 'f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55',
'bot_name' => 'Vocobase inbound +918011223344'
]),
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.vocobase.com/api/v2/voicelink/inbound-ready"
payload := strings.NewReader("{\n \"connection_id\": \"9b7f1c44-c87f-4f0c-9124-3c802a9c1a20\",\n \"did_id\": 812,\n \"client_id\": 415,\n \"agent_id\": \"f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55\",\n \"bot_name\": \"Vocobase inbound +918011223344\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.vocobase.com/api/v2/voicelink/inbound-ready")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"9b7f1c44-c87f-4f0c-9124-3c802a9c1a20\",\n \"did_id\": 812,\n \"client_id\": 415,\n \"agent_id\": \"f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55\",\n \"bot_name\": \"Vocobase inbound +918011223344\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/voicelink/inbound-ready")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_id\": \"9b7f1c44-c87f-4f0c-9124-3c802a9c1a20\",\n \"did_id\": 812,\n \"client_id\": 415,\n \"agent_id\": \"f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55\",\n \"bot_name\": \"Vocobase inbound +918011223344\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"phone_number": "<string>",
"key": "<string>",
"ready": true,
"steps": [
{
"detail": "<string>",
"data": {}
}
],
"readiness_before": {
"key": "<string>",
"phone_number": "<string>",
"issues": [],
"remote_did": {
"phone_number": "<string>",
"is_expired": true,
"is_released": true,
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {},
"did_id": 123,
"did_number": "<string>"
},
"local_phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"status": "<string>",
"is_default": true,
"inbound_enabled": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"friendly_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"routing": {
"phone_number": "<string>",
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {},
"did_id": 123,
"did_number": "<string>",
"for_inbound_call": 123,
"for_outbound_call": 123,
"inbound_websocket_bot_id": 123,
"inbound_sip_trunk_id": 123,
"outbound_websocket_bot_id": 123,
"outbound_sip_trunk_id": 123
},
"bot": {
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {}
},
"actions": [
"<string>"
],
"action_items": [
{
"label": "<string>"
}
],
"inbound": {
"ready": true,
"issues": [],
"actions": [
"<string>"
],
"bot": {
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {}
},
"runtime": {
"enabled": true,
"configured": true,
"issues": []
}
}
},
"readiness": {
"key": "<string>",
"phone_number": "<string>",
"issues": [],
"remote_did": {
"phone_number": "<string>",
"is_expired": true,
"is_released": true,
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {},
"did_id": 123,
"did_number": "<string>"
},
"local_phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"status": "<string>",
"is_default": true,
"inbound_enabled": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"friendly_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"routing": {
"phone_number": "<string>",
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {},
"did_id": 123,
"did_number": "<string>",
"for_inbound_call": 123,
"for_outbound_call": 123,
"inbound_websocket_bot_id": 123,
"inbound_sip_trunk_id": 123,
"outbound_websocket_bot_id": 123,
"outbound_sip_trunk_id": 123
},
"bot": {
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {}
},
"actions": [
"<string>"
],
"action_items": [
{
"label": "<string>"
}
],
"inbound": {
"ready": true,
"issues": [],
"actions": [
"<string>"
],
"bot": {
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {}
},
"runtime": {
"enabled": true,
"configured": true,
"issues": []
}
}
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "agent_name is required and must be max 50 characters"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}Authorizations
API key in format: rg_live_xxxx. Pass as a Bearer token in the Authorization header.
Body
- Option 1
- Option 2
Request for secure inbound setup. Provide either did_id or did_number. Unlike outbound call-ready, this request cannot override the deployment-controlled signed WebSocket URL.
VoiceLink DID ID from /voicelink/dids/purchased.
x >= 1Optional unless multiple active VoiceLink connections exist.
Purchased DID number. Used when did_id is not available.
Maps the DID only when it is currently unmapped. Existing mappings are never replaced.
x >= 1Vocobase agent ID assigned to inbound calls on this DID. Ownership is enforced.
Optional bot name used when a bot must be created.
curl --request POST \
--url https://api.vocobase.com/api/v2/voicelink/inbound-ready \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "9b7f1c44-c87f-4f0c-9124-3c802a9c1a20",
"did_id": 812,
"client_id": 415,
"agent_id": "f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55",
"bot_name": "Vocobase inbound +918011223344"
}
'import requests
url = "https://api.vocobase.com/api/v2/voicelink/inbound-ready"
payload = {
"connection_id": "9b7f1c44-c87f-4f0c-9124-3c802a9c1a20",
"did_id": 812,
"client_id": 415,
"agent_id": "f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55",
"bot_name": "Vocobase inbound +918011223344"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_id: '9b7f1c44-c87f-4f0c-9124-3c802a9c1a20',
did_id: 812,
client_id: 415,
agent_id: 'f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55',
bot_name: 'Vocobase inbound +918011223344'
})
};
fetch('https://api.vocobase.com/api/v2/voicelink/inbound-ready', 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.vocobase.com/api/v2/voicelink/inbound-ready",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_id' => '9b7f1c44-c87f-4f0c-9124-3c802a9c1a20',
'did_id' => 812,
'client_id' => 415,
'agent_id' => 'f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55',
'bot_name' => 'Vocobase inbound +918011223344'
]),
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.vocobase.com/api/v2/voicelink/inbound-ready"
payload := strings.NewReader("{\n \"connection_id\": \"9b7f1c44-c87f-4f0c-9124-3c802a9c1a20\",\n \"did_id\": 812,\n \"client_id\": 415,\n \"agent_id\": \"f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55\",\n \"bot_name\": \"Vocobase inbound +918011223344\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.vocobase.com/api/v2/voicelink/inbound-ready")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"9b7f1c44-c87f-4f0c-9124-3c802a9c1a20\",\n \"did_id\": 812,\n \"client_id\": 415,\n \"agent_id\": \"f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55\",\n \"bot_name\": \"Vocobase inbound +918011223344\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/voicelink/inbound-ready")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_id\": \"9b7f1c44-c87f-4f0c-9124-3c802a9c1a20\",\n \"did_id\": 812,\n \"client_id\": 415,\n \"agent_id\": \"f4df9f8c-df95-46d8-bb0e-6f9f83fd4f55\",\n \"bot_name\": \"Vocobase inbound +918011223344\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"phone_number": "<string>",
"key": "<string>",
"ready": true,
"steps": [
{
"detail": "<string>",
"data": {}
}
],
"readiness_before": {
"key": "<string>",
"phone_number": "<string>",
"issues": [],
"remote_did": {
"phone_number": "<string>",
"is_expired": true,
"is_released": true,
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {},
"did_id": 123,
"did_number": "<string>"
},
"local_phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"status": "<string>",
"is_default": true,
"inbound_enabled": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"friendly_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"routing": {
"phone_number": "<string>",
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {},
"did_id": 123,
"did_number": "<string>",
"for_inbound_call": 123,
"for_outbound_call": 123,
"inbound_websocket_bot_id": 123,
"inbound_sip_trunk_id": 123,
"outbound_websocket_bot_id": 123,
"outbound_sip_trunk_id": 123
},
"bot": {
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {}
},
"actions": [
"<string>"
],
"action_items": [
{
"label": "<string>"
}
],
"inbound": {
"ready": true,
"issues": [],
"actions": [
"<string>"
],
"bot": {
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {}
},
"runtime": {
"enabled": true,
"configured": true,
"issues": []
}
}
},
"readiness": {
"key": "<string>",
"phone_number": "<string>",
"issues": [],
"remote_did": {
"phone_number": "<string>",
"is_expired": true,
"is_released": true,
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {},
"did_id": 123,
"did_number": "<string>"
},
"local_phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "<string>",
"status": "<string>",
"is_default": true,
"inbound_enabled": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"friendly_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"routing": {
"phone_number": "<string>",
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {},
"did_id": 123,
"did_number": "<string>",
"for_inbound_call": 123,
"for_outbound_call": 123,
"inbound_websocket_bot_id": 123,
"inbound_sip_trunk_id": 123,
"outbound_websocket_bot_id": 123,
"outbound_sip_trunk_id": 123
},
"bot": {
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {}
},
"actions": [
"<string>"
],
"action_items": [
{
"label": "<string>"
}
],
"inbound": {
"ready": true,
"issues": [],
"actions": [
"<string>"
],
"bot": {
"id": 123,
"name": "<string>",
"status": "<string>",
"client_id": 123,
"websocket_url": "<string>",
"websocket_configured": true,
"raw": {}
},
"runtime": {
"enabled": true,
"configured": true,
"issues": []
}
}
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "agent_name is required and must be max 50 characters"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}