Get or generate transcription for an audio file
Audio Transcription
Get or Generate Transcription
Retrieves the transcription for a given file.
If no transcription exists in the system, and a valid audioUrl is provided, a new transcription will be generated and stored.
POST
Get or generate transcription for an audio file
Retrieves the transcription for a given file. If no transcription exists in the system, and a valid
audioUrl is provided, a new transcription will be generated and stored.
Request
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token |
| Content-Type | string | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| fileId | string | Yes | Unique identifier of the audio file |
Parameter Details
- fileId: Must be a valid file identifier in the system
- Used to lookup existing transcriptions or store new ones
Request Body
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
| audioUrl | string | No | URL of the audio file for transcription |
Field Details
- audioUrl: Required only if no existing transcription is found
- Must be a publicly accessible URL
- Supports common audio formats (mp3, wav, m4a, etc.)
- Used to generate new transcription when none exists
Response
200 OK - Successfully retrieved or generated transcription
400 Bad Request
404 Not Found
500 Internal Server Error
Examples
Get existing transcription
Generate new transcription
Data Fields Explained
Transcription Data
| Field | Type | Description |
|---|---|---|
| status | string | Transcription status (completed, processing, failed) |
| text | string | Full transcribed text |
| duration | number | Audio duration in seconds |
| confidence | number | Overall confidence score (0-1) |
| language | string | Detected language code |
| createdAt | string | Transcription creation timestamp |
| updatedAt | string | Last update timestamp |
| wordCount | integer | Total word count in transcription |
| speakerCount | integer | Number of detected speakers |
Segments Array
| Field | Type | Description |
|---|---|---|
| start | number | Segment start time in seconds |
| end | number | Segment end time in seconds |
| text | string | Transcribed text for segment |
| confidence | number | Confidence score for segment (0-1) |
Use Cases
- Call Center Analytics: Analyze customer service calls
- Meeting Transcriptions: Transcribe meeting recordings
- Content Creation: Convert audio content to text
- Accessibility: Provide text alternatives for audio content
- Search and Analysis: Enable text search in audio content
Implementation Examples
React Transcription Component
Audio Player with Transcription Sync
Transcription Status Polling
Best Practices
- Error Handling: Handle transcription failures gracefully
- Progress Feedback: Show progress indicators for long transcriptions
- Audio Formats: Use supported audio formats for best results
- URL Validation: Validate audio URLs before submission
- Caching: Cache transcriptions to avoid reprocessing
Performance Considerations
- Processing Time: Transcription can take time for long audio files
- File Size: Large audio files may hit size limits
- Concurrent Requests: Limit concurrent transcription requests
- Storage: Consider storage costs for transcriptions
Related Endpoints
- Use
/transcription/{fileId}to delete transcriptions - Use audio upload endpoints to upload files for transcription
- Use user management endpoints to manage transcription permissions
Notes
- Transcription quality depends on audio quality and clarity
- Processing time varies with audio length and complexity
- Generated transcriptions are stored for future retrieval
- Speaker diarization may be available for multi-speaker audio
- Language detection is automatic but can be specified if needed
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the audio file.
Example:
"670fcae25abf2d8e5c8a4a12"
Body
application/json
URL of the audio file used for transcription (required only if no existing transcription is found).
Example:
"https://example.com/uploads/audio-file.mp3"