Upload File
Upload a new file to the system.
Endpoint
POST ${baseUrl}/files/upload
Request Body
Multipart form data with the following fields:
Field | Type | Description |
---|---|---|
file | File | The file to upload (required if url not provided) |
url | string | The URL of the file to upload (required if file not provided) |
Response
interface FileUploadResponse {
success: boolean
data: {
fileId: string
}
}
Example Request
const formData = new FormData()
formData.append('file', file)
formData.append('url', 'https://example.com/file.mp3')
const response = await fetch('${baseUrl}/files/upload', {
method: 'POST',
headers: {
Authorization: 'Basic YOUR_API_KEY',
},
body: formData,
})
const data = await response.json()
Error Codes
Status Code | Description |
---|---|
201 | File Uploaded Successfully |
400 | Invalid File or Request |
401 | Unauthorized |
413 | File Too Large |
415 | Unsupported File Type |
500 | Server Error |