Soniox
API referenceSpeech-to-TextFiles

Upload file

Uploads a new file.

POST
https://api.soniox.com/v1/files

Uploads a new file.

Headers

AuthorizationRequiredBearer <SONIOX_API_KEY>

Request

multipart/form-dataRequired
client_reference_idstring

Optional tracking identifier string. Does not need to be unique.

Maximum length: 256
fileRequiredfile

The file to upload. Original file name will be used unless a custom filename is provided.

Format: "binary"

Response

201

Uploaded file.

idRequiredstring

Unique identifier of the file.

Format: "uuid"
filenameRequiredstring

Name of the file.

sizeRequiredinteger

Size of the file in bytes.

created_atRequiredstring

UTC timestamp indicating when the file was uploaded.

Format: "date-time"
client_reference_idstring

Tracking 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: One or more parts of the multipart body are missing or invalid (missing file, filename or client_reference_id too long, malformed multipart body), or the uploaded file exceeds the per-file upload limit.

{
  "status_code": 400,
  "error_type": "invalid_request",
  "message": "Your request did not pass validation. One or more fields in the request body are missing or have invalid values. See `validation_errors` for the specific field and retry with corrected values.",
  "validation_errors": [
    {
      "error_type": "missing",
      "location": "file.file",
      "message": "Field required"
    }
  ],
  "request_id": "3d37a3bd-5078-47ee-a369-b204e3bbedda",
  "more_info": "https://soniox.com/docs/api-reference/errors#invalid-request"
}

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",
  "more_info": "https://soniox.com/docs/api-reference/errors#unauthenticated"
}

Rate / capacity limit exceeded.

Error types:

  • limit_exceeded: The caller hit a per-minute request rate, the total file count or total file size cap (organization or project), or this upload would exceed those caps. The message describes which limit was hit. Delete unused files via DELETE /v1/files/{id} or request a higher limit in the Soniox Console.

{
  "status_code": 429,
  "error_type": "limit_exceeded",
  "message": "Total file count limit has been exceeded for your organization. Please delete some.",
  "validation_errors": [],
  "request_id": "3d37a3bd-5078-47ee-a369-b204e3bbedda",
  "more_info": "https://soniox.com/docs/api-reference/errors#limit-exceeded"
}

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",
  "more_info": "https://soniox.com/docs/api-reference/errors#internal-error"
}