curl --request POST \
--url https://api.voxworks.ai/api/v1/create-web-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"script_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"participant_identity": "visitor-4821"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
script_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
participant_identity: 'visitor-4821'
})
};
fetch('https://api.voxworks.ai/api/v1/create-web-session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voxworks.ai/api/v1/create-web-session"
payload = {
"script_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"participant_identity": "visitor-4821"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"session_id": "<string>",
"session_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"ws_url": "wss://MEDIA_EDGE_HOST",
"sip_domain": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"target": "sip:web@MEDIA_EDGE_HOST",
"headers": {},
"script_id": "<string>",
"contact_id": "<string>",
"did": "<string>",
"max_concurrent": 123
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "Invalid API key"
}{
"success": false,
"message": "script_id not found or does not belong to your team"
}{
"success": false,
"message": "Team is at its concurrent call limit of 10",
"max_concurrent": 10
}{
"success": false,
"message": "Internal server error"
}Create web session
Mint a single-use session for a browser call placed from a page you host. Returns a short-lived token plus the SIP bootstrap the browser needs to reach the Voxworks media edge directly; audio never passes through this API.
The session fixes the script, contact and destination at mint time. A page holding the token cannot point it at a different script, and cannot start a second call with it.
The 429 on this endpoint is your team’s concurrent-call ceiling, which web calls share
with phone calls — distinct from the per-key rate limit, which also returns 429.
curl --request POST \
--url https://api.voxworks.ai/api/v1/create-web-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"script_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"participant_identity": "visitor-4821"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
script_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
participant_identity: 'visitor-4821'
})
};
fetch('https://api.voxworks.ai/api/v1/create-web-session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voxworks.ai/api/v1/create-web-session"
payload = {
"script_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"participant_identity": "visitor-4821"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"session_id": "<string>",
"session_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"ws_url": "wss://MEDIA_EDGE_HOST",
"sip_domain": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"target": "sip:web@MEDIA_EDGE_HOST",
"headers": {},
"script_id": "<string>",
"contact_id": "<string>",
"did": "<string>",
"max_concurrent": 123
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "Invalid API key"
}{
"success": false,
"message": "script_id not found or does not belong to your team"
}{
"success": false,
"message": "Team is at its concurrent call limit of 10",
"max_concurrent": 10
}{
"success": false,
"message": "Internal server error"
}Authorizations
API key from Voxworks, sent as Authorization: Bearer YOUR_API_KEY.
Body
The script the call runs. Must belong to your team.
Attach the call to a known contact. Omit to use your team's shared web contact.
One of your team's numbers, used as the AI-side number identity on the call record. Omit for a browser-only call.
A label for the visitor, carried through to the transcript.
Object data keyed by object type name, linked to the contact.
Show child attributes
Show child attributes
Response
Session minted.
true
Identifies this session. No call exists yet — the call is created when the visitor connects.
Single-use token authorising this one call. Pass it to the browser client; it is already included in headers.
When the token stops being redeemable. Roughly two minutes after minting.
Secure WebSocket URL to connect to. Read it from the response on every call rather than hardcoding it.
"wss://MEDIA_EDGE_HOST"
Connection bootstrap, not a credential. It grants no access on its own — the session token is what authorises the call.
SIP URI the browser dials.
"sip:web@MEDIA_EDGE_HOST"
Call metadata to forward verbatim. Pass through unchanged; do not construct these yourself.
Show child attributes
Show child attributes
Your team's concurrent-call ceiling, shared between web and phone calls.

