Upload file
Uploads a new file.
Headers
Authorization
RequiredBearer <SONIOX_API_KEY>Request
multipart/form-data
Requiredclient_reference_id
stringOptional tracking identifier string. Does not need to be unique.
Maximum length:
256
file
RequiredfileThe file to upload. Original file name will be used unless a custom filename is provided.
Format:
"binary"
Response
201
Uploaded file.
id
RequiredstringUnique identifier of the file.
Format:
"uuid"
filename
RequiredstringName of the file.
size
RequiredintegerSize of the file in bytes.
created_at
RequiredstringUTC timestamp indicating when the file was uploaded.
Format:
"date-time"
client_reference_id
stringTracking identifier string.
Errors
Uploaded file.
{
"id": "84c32fc6-4fb5-4e7a-b656-b5ec70493753",
"filename": "example.mp3",
"size": 123456,
"created_at": "2024-11-26T00:00:00Z"
}
Invalid request.
Error types:
invalid_request
:- Invalid request.
- Exceeded maximum file size (maximum is 524288000 bytes).
{
"status_code": 400,
"error_type": "invalid_request",
"message": "Invalid request.",
"validation_errors": [
{
"error_type": "missing",
"location": "file.file",
"message": "Field required"
}
],
"request_id": "3d37a3bd-5078-47ee-a369-b204e3bbedda"
}
Authentication error.
{
"status_code": 401,
"error_type": "unauthenticated",
"message": "Incorrect API key provided. You can get an API key at https://console.soniox.com",
"validation_errors": [],
"request_id": "3d37a3bd-5078-47ee-a369-b204e3bbedda"
}
Internal server error.
{
"status_code": 500,
"error_type": "internal_error",
"message": "The server encountered an error. Please try again. If the issue persists contact support@soniox.com.",
"validation_errors": [],
"request_id": "3d37a3bd-5078-47ee-a369-b204e3bbedda"
}