Skip to main content
PUT
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

environmentId
string<uuid>
required

Body

application/json

Input for updating an environment. Only the fields sent are changed. Roark-curated environments cannot be edited.

name
string

Display name, shown wherever a flow variant references the environment

Minimum string length: 1
Example:

"Busy call centre"

description
string | null

Optional note on when to use this environment

Example:

"Open-plan office at peak hours"

backgroundNoise
enum<string>

The noise bed played underneath the simulated caller. NONE plays nothing.

Available options:
NONE,
AIRPORT,
CHILDREN_PLAYING,
CITY,
COFFEE_SHOP,
CONSTRUCTION,
CRYING_BABY,
DRIVING,
LIBRARY,
OFFICE,
THUNDERSTORM,
TRAIN
Example:

"OFFICE"

backgroundNoiseVolume
number
default:0.1

How loud the bed plays, as a gain from 0 (silent) to 1 (as loud as the caller). Defaults to 0.1, which sits well under the caller. Ignored on Vapi endpoints, which have no level control.

Required range: 0 <= x <= 1
Example:

0.3

lineQuality
enum<string>
default:CLEAR

The phone line the simulated caller is on: packet loss applied to its 20 ms audio packets, per direction. The loss pattern is seeded per call, so a redial loses the same packets. CLEAR: No loss. MINOR_LOSS: 1% random, both ways. CELL_EDGE: 5% in 80 ms gaps, both ways. POOR_CONNECTION: 10% in 120 ms gaps, both ways. ONE_WAY_DEGRADED: 8% in 80 ms gaps, toward the agent only. CUSTOM: the per-direction loss in lineCustom, up to 20% in 0.5 steps, with a mean burst of up to 10 packets (omit it for random loss). Defaults to CLEAR.

Available options:
CLEAR,
MINOR_LOSS,
CELL_EDGE,
POOR_CONNECTION,
ONE_WAY_DEGRADED,
CUSTOM
Example:

"CELL_EDGE"

lineCustom
object | null

Required with lineQuality CUSTOM, and refused with any other line.

phone
enum<string> | null

The phone the simulated caller is on: the codecs the call passes through, both ways, on top of any loss in lineQuality. Null is no phone. LANDLINE: The narrow band of a phone handset and the codec of the phone network. MOBILE: The narrow band and the compressed voice codec of a mobile call. BLUETOOTH: A mobile on a car kit or headset: the Bluetooth link adds fizz under the voice, then the mobile codec. Defaults to null.

Available options:
LANDLINE,
MOBILE,
BLUETOOTH
Example:

"MOBILE"

lineNoise
number
default:0

Hiss on the line, both ways, from 0 (none) to 1 (heavy, about 10 dB under phone speech). Combines with the phone and lineQuality. Defaults to 0.

Required range: 0 <= x <= 1
Example:

0.4

Response

The updated environment

data
object
required

A simulation environment: the ambient conditions a customer flow variant runs under. The list includes both your own and the ones Roark curates for every project.