voice agents
start a web call
start a voice-agent call and return the credentials a browser joins it with over webrtc. media flows browser ↔ agent directly. requires an api key with the agent scope and an agent that has been deployed. the returned callId identifies the call in conversations and usage.
POST
/
v1
/
webcall
start a web call
curl --request POST \
--url https://silk-api.rumik.ai/v1/webcall \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "ua_fe3277d8"
}
'import requests
url = "https://silk-api.rumik.ai/v1/webcall"
payload = { "agentId": "ua_fe3277d8" }
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({agentId: 'ua_fe3277d8'})
};
fetch('https://silk-api.rumik.ai/v1/webcall', 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://silk-api.rumik.ai/v1/webcall",
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([
'agentId' => 'ua_fe3277d8'
]),
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://silk-api.rumik.ai/v1/webcall"
payload := strings.NewReader("{\n \"agentId\": \"ua_fe3277d8\"\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://silk-api.rumik.ai/v1/webcall")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"ua_fe3277d8\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://silk-api.rumik.ai/v1/webcall")
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 \"agentId\": \"ua_fe3277d8\"\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>",
"host": "wss://livekit.rumik.ai",
"roomName": "call-891e23fe503944c28dbf5e5a2a105190",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
your rumik api key, e.g. rk_live_.... create one in the rumik dashboard.
Body
application/json
the agent to run — its uuid or its ua_… handle. agent_id is accepted too.
Example:
"ua_fe3277d8"
Response
the call started; join with these credentials.
short-lived livekit access token for the browser to join with.
livekit websocket url to connect to.
Example:
"wss://livekit.rumik.ai"
the room created for this call.
Example:
"call-891e23fe503944c28dbf5e5a2a105190"
the call id, as shown in conversations and usage.
⌘I
start a web call
curl --request POST \
--url https://silk-api.rumik.ai/v1/webcall \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "ua_fe3277d8"
}
'import requests
url = "https://silk-api.rumik.ai/v1/webcall"
payload = { "agentId": "ua_fe3277d8" }
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({agentId: 'ua_fe3277d8'})
};
fetch('https://silk-api.rumik.ai/v1/webcall', 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://silk-api.rumik.ai/v1/webcall",
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([
'agentId' => 'ua_fe3277d8'
]),
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://silk-api.rumik.ai/v1/webcall"
payload := strings.NewReader("{\n \"agentId\": \"ua_fe3277d8\"\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://silk-api.rumik.ai/v1/webcall")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"ua_fe3277d8\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://silk-api.rumik.ai/v1/webcall")
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 \"agentId\": \"ua_fe3277d8\"\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>",
"host": "wss://livekit.rumik.ai",
"roomName": "call-891e23fe503944c28dbf5e5a2a105190",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}