Recordings
Finalize Streaming Recording
Complete a streaming recording, stitch audio chunks, and trigger transcription.
POST
Finalizes a streaming recording after all chunks have been uploaded. This endpoint marks the recording as complete, queues a background job to stitch audio chunks into a single file, and triggers transcription once stitching is complete.
Response:
Problem: Stitching takes too long
Solution: This is normal for recordings with many chunks (>50). Check stitching job status via webhooks or polling the recording endpoint.
Authentication
Requires a valid device token or API key withrecordings:write scope.
Path Parameters
Recording ID from the initial streaming recording creation (e.g.,
rec_abc123xyz)Request Body
Total number of chunks uploaded (must match actual chunk count)
Actual recording duration in milliseconds
MD5 checksum of the complete audio (optional, for integrity verification)
SHA-256 of the complete audio bytes as a 64-character lowercase hex string (optional). When supplied, the server recomputes the SHA-256 of the assembled object after chunk stitching and marks the recording
status=integrity_failure on mismatch.Optional base64-encoded bytes to append to the assembled audio after all chunks. Use this if your encoder writes bytes at close that were not captured in the chunk stream — for example, the final-page flush and EOS page that OGG/Opus encoders emit during
fclose(). Without this, those bytes are absent from the assembled S3 object and content_sha256 verification will fail even though the audio was transmitted correctly. Max 16384 base64 characters (≈12KB raw).Response
Returns the finalized recording status.Response Fields
Background Processing
After calling/finalize, the following happens asynchronously:
Typical Processing Times:
- Chunk stitching: 5-30 seconds (depending on chunk count)
- Transcription: 1-5 minutes (depending on duration)
Webhooks
You’ll receive webhooks for:recording.uploaded- Fired immediately after finalizationtranscription.queued- Transcription job queuedtranscription.completed- Transcription finished successfullytranscription.failed- Transcription failed
Streaming Upload Example (Full Flow)
Step 1: Create Streaming Recording
Note: When using device tokens (Response:dtok_*),device_idandend_user_idare automatically extracted from the token. When using API keys (sk_*), includedevice_idandend_user_idin the request body.
Step 2: Upload Chunks (Device)
Step 3: Finalize Recording
Step 4: Wait for Webhooks
Best Practices
Verify Chunk Count: Ensure
total_chunks matches the number of chunks you actually uploaded. The backend will verify chunk existence before stitching.Include Checksum: Provide an MD5 checksum for integrity verification, especially for critical recordings (e.g., medical, legal).
Idempotency: Calling
/finalize multiple times with the same parameters is safe (idempotent). Duplicate requests will return the same response without re-processing.Troubleshooting
Problem: “Chunk count mismatch” error Solution: Check that all chunks were uploaded successfully. Use the error response to identify missing chunks.Related Endpoints
- Create Recording - Create streaming recording
- Get Recording - Check stitching status
- Create Transcription - Manual transcription trigger

