Upload File
Upload a new file to the system.
Endpoint
POST ${baseUrl}/files/uploadRequest Body
Multipart form data with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
| file | File | Conditional | The file to upload. Required if url is not provided. Cannot be combined with url. |
| url | string | Conditional | The URL of the file to upload. Required if file is not provided. Cannot be combined with file. |
| filename | string | No | Preferred filename to save the file as. For URL uploads, used as the base name; the extension is inferred from the URL or content type. |
| headers | string | No | JSON-encoded object of HTTP headers to send when fetching url (e.g. Authorization for private S3/links). Ignored for direct file uploads. |
| duration | string | No | Duration of the audio/video in seconds. Used only with the internal ScribieDotComUpload flow. |
Response
interface FileUploadResponse {
success: boolean
data: {
fileId: string
}
}Example Request
// Direct file upload
const formData = new FormData()
formData.append('file', file)
const response = await fetch('${baseUrl}/files/upload', {
method: 'POST',
headers: {
Authorization: 'Basic YOUR_API_KEY',
},
body: formData,
})
const data = await response.json()// URL upload with custom filename and auth headers
const formData = new FormData()
formData.append('url', 'https://example.com/private-file.mp3')
formData.append('filename', 'deposition-2026-04-24')
formData.append(
'headers',
JSON.stringify({ Authorization: 'Bearer SOURCE_TOKEN' }),
)
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 |