Rufa API Reference
Overview
The Rufa API provides endpoints for audio processing and transcription in the TKM AI Agency Platform. It handles audio file uploads and transcription using advanced speech-to-text capabilities.
Endpoints
Transcribe Audio
POST /transcribe
Transcribes an uploaded audio file to text.
Request Body (multipart/form-data)
Name | Type | Required | Description |
---|---|---|---|
file | File | Yes | The audio file to transcribe |
user_id | string | Yes | The user ID |
conversation_id | string | Yes | The conversation ID |
organization_id | string | No | The organization ID (defaults to "tkm_123456") |
Response
{
"success": true,
"text": "string", // Transcribed text
"file_path": "string", // Path to stored audio file
"duration": 0.0, // Audio duration in seconds
"message": {
"type": "audio",
"content": "string", // Transcribed text
"timestamp": "string",
"source_agent": "rufa"
}
}
Error Response
{
"success": false,
"error": "Error message"
}
Integration Notes
Audio Processing Features
- Audio file validation
- Temporary file handling
- Duration calculation
- Format support
Conversation Integration
- Conversation verification with Atta
- Message storage
- Context preservation
- Organization isolation
File Management
- Secure temporary storage
- Automatic cleanup
- Format validation
- Path organization
Error Handling
- Input validation
- Processing errors
- Conversation validation
- File handling errors