POST
/
v1
/
calls
/
dial-outbound-phone-call

Body

application/json
direction
enum<string>
required

Specifies whether this is an incoming or outgoing call

Available options:
inbound,
outbound
from_number
string
required

The phone number initiating the call (E.164 format)

to_number
string
required

The phone number receiving the call (E.164 format)

call_id
string | null

Optional custom identifier for the call, if not provided, one will be generated

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
direction
enum<string>
required

Indicates whether the call was received by or initiated from the Pia Platform

Available options:
inbound,
outbound
from_number
string
required

The phone number that initiated the call (E.164 format)

to_number
string
required

The phone number that received the call (E.164 format)

_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 phone call ended, if applicable

Available options:
user_ended_call,
agent_ended_call,
call_transferred,
voicemail_detected,
inactivity_timeout,
answering_machine_detected,
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,
frontend_payload_corruption,
twilio_service_error,
no_audio_input,
speech_recognition_error,
retell_service_error,
unknown_error,
user_connection_failure,
registered_call_timed_out
call_start_time
string | null

Timestamp when the call was initiated, in UTC

call_type
enum<string>
default:
phone_call

Indicates this response is for a telephone call

Available options:
phone_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