Skip to main content
GET
/
api
/
v1
/
voice
/
recordings
/
{recording_id}
Get Recording Status
curl --request GET \
  --url https://api.example.com/api/v1/voice/recordings/{recording_id}
{
  "recording_id": "<string>",
  "status": "<string>",
  "duration": 123,
  "recording_url": "<string>",
  "created_at": "<string>",
  "processed_at": "<string>"
}

Overview

Get the current status, duration, and URL of a voice recording by its ID. Use this endpoint to check if a recording has been processed and is ready for contract generation.

Path Parameters

recording_id
string
required
The unique identifier for the voice recording (returned from conference creation)

Response

recording_id
string
The unique recording identifier
status
string
Current processing status: recording, completed, processing, or failed
duration
number
Duration of the recording in seconds (null if not yet available)
recording_url
string
URL where the audio file can be accessed (null until webhook callback)
created_at
string
ISO 8601 timestamp when the recording was initiated
processed_at
string
ISO 8601 timestamp when processing completed (null if not yet processed)

Example Request

curl http://localhost:8000/api/v1/voice/recordings/conf_1234567890

Example Response (Completed)

{
  "recording_id": "conf_1234567890",
  "status": "completed",
  "duration": 342,
  "recording_url": "https://voice.africastalking.com/recording/abc123def456",
  "created_at": "2024-01-15T10:00:00.000Z",
  "processed_at": "2024-01-15T10:05:42.000Z"
}

Example Response (In Progress)

{
  "recording_id": "conf_1234567890",
  "status": "recording",
  "duration": null,
  "recording_url": null,
  "created_at": "2024-01-15T10:00:00.000Z",
  "processed_at": null
}

Error Response (Not Found)

{
  "detail": "Recording not found"
}

Status Codes

  • 200 - Recording found and status returned
  • 404 - Recording ID not found
  • 500 - Failed to query recording status

Recording Status Values

StatusDescription
recordingConference call is active and being recorded
processingRecording complete, processing audio
completedRecording processed and available
failedRecording or processing failed

Use Cases

  • Poll for completion: Check if a conference recording is ready
  • Get recording URL: Retrieve the audio file URL after the call ends
  • Monitor duration: Verify recording length before processing
  • Track processing: Monitor the status of voice-to-contract processing

Workflow

1

Create Conference

Call POST /api/v1/voice/conference/create to start recording
2

Poll Status

Periodically call this endpoint to check if recording is complete
3

Process Recording

Once status is completed and recording_url is available, call POST /api/v1/voice/process

Polling Strategy

async function waitForRecording(recordingId) {
  const maxAttempts = 30;
  const pollInterval = 2000; // 2 seconds
  
  for (let i = 0; i < maxAttempts; i++) {
    const response = await fetch(
      `http://localhost:8000/api/v1/voice/recordings/${recordingId}`
    );
    const data = await response.json();
    
    if (data.status === 'completed' && data.recording_url) {
      return data;
    }
    
    if (data.status === 'failed') {
      throw new Error('Recording failed');
    }
    
    await new Promise(resolve => setTimeout(resolve, pollInterval));
  }
  
  throw new Error('Recording timeout');
}

Implementation

This endpoint queries the voice_recordings table to retrieve recording metadata. The recording status and URL are updated by the voice webhook when Africa’s Talking sends the callback. Source: voice.py:261-289

Create Conference

Start a voice conference

Process Recording

Convert audio to contract

Voice Webhook

Webhook that updates recording status

Build docs developers (and LLMs) love