Voice via API

Voice calls in Elegant Machine are answered by AI agents and recorded as interactions. The Voice Chat API's documented surface today is read-only — call logs, transcripts, AI evaluations, and phone-number configuration lookups for reporting and analytics. Calls themselves are placed and connected by the platform, and write operations will be documented as they're opened up.

Base URL: https://medchatapp.com/voicechatapi · Scopes: read.voice_chats for calls, read.voice_chat_phone_numbers for numbers.

The voice chat object

GET /orgs/{orgId}/voiceChats/{voiceChatId} returns the complete call graph: status (queued, ringing, in-progress, completed, failed, busy, no-answer, canceled), direction (inbound/outbound), userPhoneNumber, callerName, endedReason (CallerHungUp, CallFailed, LineBusy, NoAnswer, Canceled, Transferred), plus memberships (Bot or ExternalUser), attributes, phoneNumber, and the AI evaluations.

Transcripts are typed message blocks: VoiceChatUserMessage bodies contain TranscriptionMessageBlock (the spoken text, with alternativeTranscript and background-audio hints), DtmfSequenceMessageBlock (keypad input), PauseMessageBlock, and InterruptionMessageBlock.

Retrieve call logs, transcripts, and evaluations

(Recipe: Retrieve Voice Call Logs and Evaluations.)

# Recent calls
curl "https://medchatapp.com/voicechatapi/orgs/$ORG_ID/voiceChats?\$filter=CreatedDateTime ge 2026-08-01T00:00:00Z&\$orderby=CreatedDateTime desc" \
  -H "Authorization: Bearer $TOKEN"

# One call — full graph in one request
curl "https://medchatapp.com/voicechatapi/orgs/$ORG_ID/voiceChats/$VOICE_CHAT_ID" \
  -H "Authorization: Bearer $TOKEN"

# The transcript (ordered by time, with per-message evals included)
curl "https://medchatapp.com/voicechatapi/orgs/$ORG_ID/voiceChats/$VOICE_CHAT_ID/messages" \
  -H "Authorization: Bearer $TOKEN"

AI evaluations run asynchronously after the call: GET .../resolution (caller intent, resolved or not, topics), GET .../sentiment, and GET .../analyzerOutputs. A 404 from the eval endpoints means not evaluated yet — the normal "not ready" signal, not an error. Per-message drilldowns: .../messages/{messageId}/modelDecision, /sentiment, /analyzerOutputs.

On the list endpoint, $expand=AnalyzerOutputs intentionally returns only call-level outputs (message-level ones come from the per-message endpoints).

Attributes

Calls carry key/value attributes — some system-populated (e.g. call direction), some set by automations. Read them with:

curl "https://medchatapp.com/voicechatapi/orgs/$ORG_ID/voiceChats/$VOICE_CHAT_ID/attributes?\$filter=Name eq 'claimNumber'" \
  -H "Authorization: Bearer $TOKEN"

Each attribute has a name, a raw-JSON value, an optional jsonSchema, and a scope (attributes created against the call itself use Interaction).

Phone numbers

Your org's numbers and their voice configuration are readable (provisioning happens platform-side):

# The numbers themselves
curl "https://medchatapp.com/voicechatapi/orgs/$ORG_ID/phoneNumbers" \
  -H "Authorization: Bearer $TOKEN"

# Which AI agent answers this number, and what task an inbound call opens
curl "https://medchatapp.com/voicechatapi/orgs/$ORG_ID/phoneNumbers/$PHONE_NUMBER_ID/config" \
  -H "Authorization: Bearer $TOKEN"

The config's taskCreationConfig block (taskTemplateId + parameterBindings) is what connects an inbound call to the task it creates.

Context amendments

Context injected into a call while it ran — typically by a parent task steering its AI agent — is readable as an append-only thread:

curl "https://medchatapp.com/voicechatapi/orgs/$ORG_ID/voiceChats/$VOICE_CHAT_ID/contextAmendments" \
  -H "Authorization: Bearer $TOKEN"

Each amendment records its originator: originatorInteractionType of Task means a task drove it, and originatorInteractionId is that task's ID.

Where's the task?

Task linkage shows up in two places:

  • Inbound calls that opened a task embed it in the call's startingInteractionContext as JSON: {"taskId": "<guid>"}.
  • Calls driven by a task (outbound outreach) carry context amendments whose originatorInteractionType is Task.

The task itself lives on the Automation API — see Tasks via API.


Did this page help you?