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.Documentation Index
Fetch the complete documentation index at: https://docs.bota.dev/llms.txt
Use this file to discover all available pages before exploring further.
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)
Response
Returns the finalized recording status.Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Recording ID. |
status | string | Recording status: uploaded, stitching, or failed. |
transcription_status | string | Transcription status: queued, processing, completed, or failed. |
chunks_received | integer | Number of chunks received by the backend. |
stitching_job_id | string | Background job ID for chunk stitching (for debugging). |
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

