Skip to main content
POST
/
voice
/
v1
/
sessions
/
{session_id}
/
end
End Session
curl --request POST \
  --url https://api.eka.care/voice/v1/sessions/{session_id}/end \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "audio_files_sent": 3
}
'
{
  "session_id": "ses_abc123def456",
  "status": "processing",
  "message": "Session ended. Processing started.",
  "audio_files_received": 3,
  "audio_files": [
    "0.webm",
    "1.webm",
    "2.webm"
  ]
}
Finalize the session and start asynchronous processing. After this call, no further audio uploads are accepted for the session.

What happens server-side

1

Collect & order chunks

The server lists every audio file uploaded to the session and sorts them by sequence number (0.webm, 1.webm, …).
2

Commit the session

The session is committed (user_status: commit) so it can no longer receive uploads.
3

Queue for processing

A processing event is queued; transcription and template extraction run asynchronously.
4

Return 202 Accepted

The response confirms how many audio files were received and lists them.

Path parameters

ParameterDescription
session_idThe session_id returned by Create Session.

Request fields

FieldTypeRequiredDescription
audio_files_sentintegerYesNumber of audio chunks/files the client sent. Used for validation against what the server received.

Response fields

FieldTypeDescription
session_idstringThe session identifier.
statusstringSession status after ending — typically processing.
messagestringHuman-readable status message.
audio_files_receivedintegerCount of audio files the server received and stored.
audio_filesstring[]Ordered list of stored audio files.

Retrieving results

Processing is asynchronous. After receiving 202 Accepted:
  • Poll GET /voice/v1/sessions/{session_id} until status is completed. Status codes mirror processing state — 202 (in progress), 200 (completed), 206 (partial), 410 (expired).
  • Or register a webhook to be notified automatically when processing completes.
The completed response includes the full transcript and the structured templates results for the template IDs requested at session creation.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

session_id
string
required

Session ID returned by Create Session

Example:

"ses_abc123def456"

Body

application/json
audio_files_sent
integer
required

Number of audio chunks/files the client sent, used for validation.

Required range: x >= 0
Example:

3

Response

Session ended, processing started

session_id
string
status
string
Example:

"processing"

message
string
Example:

"Session ended. Processing started."

audio_files_received
integer
Required range: x >= 0
audio_files
string[]