Skip to content

Feedback: api-reference-files-upload

Original URL: https://assemblyai.com/docs/api-reference/files/upload
Category: api-reference
Generated: 05/08/2025, 4:32:10 pm


Generated: 05/08/2025, 4:32:09 pm

Technical Documentation Analysis & Recommendations

Section titled “Technical Documentation Analysis & Recommendations”

Critical Issues Requiring Immediate Attention

Section titled “Critical Issues Requiring Immediate Attention”

Request Parameters & Headers:

  • No documentation of required headers beyond Content-Type
  • Missing authentication details (header format, where to get API key)
  • No file size limits specified
  • No supported file formats listed

Response Structure:

  • HTTP status codes listed but no response body examples
  • Missing successful response format (likely returns a file URL or ID)
  • No error response body structures

Current Issues:

  • 8 nearly identical curl examples with generic <filename> placeholders
  • No variety in programming languages
  • No realistic file paths or names

Recommended Replacement:

Terminal window
# Upload an audio file
curl -X POST https://api.assemblyai.com/v2/upload \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/octet-stream" \
--data-binary @recording.mp3
# Upload from a different directory
curl -X POST https://api.assemblyai.com/v2/upload \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/octet-stream" \
--data-binary @/path/to/audio/interview.wav
# Upload a Media File
Upload audio or video files to AssemblyAI's servers for transcription processing.
## Authentication
All requests require a valid API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

## Request Details
**Endpoint:** `POST https://api.assemblyai.com/v2/upload`
**EU Endpoint:** `POST https://api.eu.assemblyai.com/v2/upload`
### Headers
| Header | Value | Required |
|--------|-------|----------|
| Authorization | Bearer {your_api_key} | Yes |
| Content-Type | application/octet-stream | Yes |
### File Requirements
- **Supported formats:** MP3, MP4, WAV, M4A, AAC, FLAC, OGG, WMA
- **Maximum file size:** 5GB
- **Upload method:** Binary data in request body
## Response Format
### Success Response (200)
```json
{
"upload_url": "https://cdn.assemblyai.com/upload/your-file-id"
}
{
"error": "File too large. Maximum size is 5GB."
}
### 4. **Multi-Language Examples**
Add examples in popular programming languages:
```python
# Python
import requests
url = "https://api.assemblyai.com/v2/upload"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
with open("audio_file.mp3", "rb") as f:
response = requests.post(url, headers=headers, data=f)
upload_url = response.json()["upload_url"]
// JavaScript (Node.js)
const fs = require('fs');
const fetch = require('node-fetch');
const audioFile = fs.readFileSync('audio_file.mp3');
fetch('https://api.assemblyai.com/v2/upload', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/octet-stream'
},
body: audioFile
})
.then(response => response.json())
.then(data => console.log(data.upload_url));

Add Troubleshooting Section:

## Common Issues
**401 Unauthorized**
- Verify your API key is correct and active
- Ensure "Bearer " prefix is included in Authorization header
**413 Payload Too Large**
- File exceeds 5GB limit
- Consider compressing audio or splitting large files
**Unsupported Media Type**
- Check that your file format is supported
- Verify Content-Type header is set correctly
## What Happens Next?
1. File uploads to AssemblyAI servers
2. Returns `upload_url` for use in transcription requests
3. Use this URL in the `/v2/transcript` endpoint to start transcription
## Related Endpoints
- [Create Transcript](/docs/api-reference/transcript/create) - Start transcription with uploaded file
- [Get Transcript](/docs/api-reference/transcript/get) - Check transcription status
  1. High Priority: Add missing response format and authentication details
  2. High Priority: Replace redundant examples with diverse, realistic ones
  3. Medium Priority: Add file format and size limit specifications
  4. Medium Priority: Include multi-language code examples
  5. Low Priority: Add troubleshooting section and related endpoints

These changes will transform this from a basic reference into a comprehensive, user-friendly guide that reduces support requests and improves developer experience.