call.ended arrives once when a call is over, whether it was answered, missed or went to voicemail. call.recording_ready arrives once when the call’s recording is ready, with its transcript and summary when Blujay has them. You download the audio itself from GET /v1/calls/{call_id}/recording with your API key.
Subscribe to call events
Addcall.ended and call.recording_ready to a webhook subscription’s event_types. You can subscribe to either one on its own.
curl
Response (201)
PATCH /v1/webhook-subscriptions/{subscription_id} with the full list you want. event_types replaces the current list, so include your existing events too.
Call events follow the subscription’s phone_number_filter: a subscription limited to some numbers only gets calls on those numbers. See Select phone numbers. The call payloads are the same on every webhook version.
Know when each event arrives
call.endedis sent once, when the call is over. An incoming call nobody answered is sent asmissedas soon as the ringing stops. An outgoing phone call can take up to about a minute after it ends, while Blujay works out whether it reached voicemail.call.recording_readyis sent once, when the call’s recording is ready: after its transcript and summary are done, or after at most 30 minutes. A call with no recording, such as a missed call where the caller left no voicemail, sends onlycall.ended.
event_id, as for every webhook.
Read the call.ended payload
call.ended
Outcomes
An incoming call that rang out stays
missed in call.ended, even if the caller then leaves a voicemail. The voicemail arrives later in call.recording_ready, with outcome: "voicemail". See Voicemails.
Find the person
Whencontact_id is set, read the contact with GET /v1/contacts/{contact_id}:
curl
null, the other person isn’t a contact in your workspace yet. Use from for an incoming call or to for an outgoing one. A blocked caller has no number at all: from is null and caller_id_blocked is true.
To match team_member_id to a name, list your workspace’s active members with GET /v1/team-members/assignable. See Assign a contact.
Get the recording
call.recording_ready carries every call.ended field, plus recording, transcript and summary. Only data is shown here; the envelope is the same as above.
call.recording_ready
recording.download_urlis a path on the Blujay API.recording.duration_secondsis the recording’s length, ornullwhen Blujay doesn’t know it.recording.kindiscallfor a recorded conversation orvoicemailfor a voicemail.transcript.statusiscompletedwith thetextand itslanguage, orunavailablewith bothnull.languageis alsonullwhen the call was transcribed in multi-language mode.summary.statusiscompletedwith thetext, orunavailablewithtext: nullwhen there was too little conversation to summarize or the summary failed.
Download the audio
Call thedownload_url path on https://api.blujay.io with your usual Authorization header:
curl
Content-Type: audio/mpeg. Never send your API key to a URL on any other host.
Voicemails
A voicemail arrives ascall.recording_ready with recording.kind: "voicemail". That covers a voicemail a caller left you and an outgoing call that reached the other person’s voicemail. Download it the same way as any other recording.
When someone calls, nobody answers and they leave a voicemail, you get two events for the same call_id:
call.endedas soon as the ringing stops, withoutcome: "missed",answered_at: nullandduration_seconds: 0.call.recording_readyonce the voicemail is ready, withoutcome: "voicemail"andrecording.kind: "voicemail".
call.ended doesn’t change afterwards, so call.recording_ready is the only event that tells you a voicemail was left.
Errors
These come fromGET /v1/calls/{call_id}/recording.
Limitations
- The API reports calls; it doesn’t make or control them. There are no endpoints to place, answer or end a call, or to list or read calls. The recording download is the only call endpoint.
- There are no events while a call is in progress, such as ringing or answered.
call.endedis the first event for a call. - Transcripts and summaries arrive only in
call.recording_ready. Store them when you receive them. - A call doesn’t count as a response from the contact under the sending rules.
- To see whether a number is ready for calls, read
capabilities.voiceonGET /v1/phone-numbers. Free Plan numbers leave it out. See Phone numbers.
Next steps
Webhook events
The call event payloads next to every other event.
Webhooks overview
Set up an endpoint, verify signatures and pick numbers.
Contacts
Look up and update the person behind a call.
Phone numbers
Your numbers and whether each is ready for calls.