Voice / Call Controls

Play an audio file into the call

Play an audio file into the call. The response includes a playback_id you can use to correlate playback lifecycle webhooks.

post/api/v1/voice/calls/{call_id}/play

Request

  • Base URL: https://api.frejun.ai
  • URL: https://api.frejun.ai/api/v1/voice/calls/{call_id}/play
  • Auth: API key in header x-api-key

Path parameters

call_idstring required

Request body

leg_idstring nullable

Leg to play audio into (cl_ prefix). Defaults to the primary leg.

media_urlstring uri required

HTTPS URL of the audio file to play (WAV or MP3).

loopinteger

How many times to play the file (1–10).

on_dtmf'stop' | 'ignore'

Whether an inbound DTMF digit stops playback (stop) or is ignored (ignore).

Example request

{
  "loop": 1,
  "media_url": "https://example.com/audio/greeting.wav",
  "on_dtmf": "stop"
}

Response

Successful Response

request_idstring required

Identifier for this control request. Reuse it to correlate retries and webhooks.

playback_idstring nullable

Identifier of the started playback (pb_ prefix). Only returned by the play action.

Example response

{
  "request_id": "req_9f8e7d6c5b4a3f2e1d0c9b8a"
}

Changes

No recorded changes to this operation across all 1 revision of this API.