POST
/
v1
/
calls
/
create-web-call

Body

application/json
ai_agent_id
string
required

Identifier of the AI agent that will handle this web call

metadata
object | null

Custom key-value pairs for storing call-specific information

override_ai_agent_id
string | null

Optional alternative AI agent identifier for special handling scenarios

pia_llm_dynamic_data
object | null

Dynamic data to be used by the AI agent during this call

Response

201 - application/json
call_status
enum<string>
required

Current status of the call: 'registered' for initialized calls, 'ongoing' for active calls, 'ended' for completed calls, 'error' for failed calls

Available options:
registered,
ongoing,
ended,
error
_id
string

Unique identifier for the call session, automatically generated as a MongoDB ObjectId

access_token
string | null

Security token for accessing call-related resources

ai_agent_id
string | null

Identifier of the AI agent handling this call

call_duration_seconds
integer | null

Duration of the call in seconds

call_end_time
string | null

Timestamp when the call was terminated, in UTC

call_finish_reason
enum<string> | null

Detailed reason why the web call ended, if applicable

Available options:
user_ended_call,
agent_ended_call,
call_transferred,
inactivity_timeout,
maximum_duration_exceeded,
concurrent_call_limit_reached,
invalid_payment,
potential_scam_detected,
inbound_webhook_error,
line_busy,
call_failed,
no_answer,
llm_websocket_initialization_error,
llm_websocket_connection_lost,
llm_websocket_runtime_error,
llm_websocket_payload_corruption,
twilio_error,
no_audio_input,
speech_recognition_error,
pia_platform_internal_error,
unknown_error,
user_connection_failure
call_start_time
string | null

Timestamp when the call was initiated, in UTC

call_type
enum<string>
default:
web_call

Indicates this response is for a web-based call

Available options:
web_call
messages
object[] | null

Chronological list of messages exchanged during the call

metadata
object | null

Custom key-value pairs storing additional information about the call

override_ai_agent_id
string | null

Optional identifier for an alternative AI agent handling this call

pia_llm_dynamic_data
object | null

Dynamic data used by the AI agent during the call

recorded_call_audio_url
string | null

URL to access the recorded audio file of the call