Skip to main content
File management endpoints allow you to upload, list, download, and delete translation files. These endpoints support files up to 100MB in size and provide a simple way to manage your translation file storage.

The translation file upload response model

The upload response model contains information about the uploaded file.

Properties

message
string
A message describing the result of the operation.
file_name
string
The name of the uploaded file.
file_type
string
The file extension type.
file_size
integer
Size of the file in bytes.
uploaded_at
timestamp
Timestamp of when the file was uploaded.

The translation file list response model

The list response model contains information about files in a folder.

Properties

files
array
Array of file objects in the folder.
total
integer
Total number of files in the folder.
folder_path
string
The folder path that was listed.

The translation file delete response model

The delete response model confirms the file deletion.

Properties

message
string
A message describing the result of the operation.
deleted_file
string
The path of the deleted file.

Upload a translation file

POST /files/upload This endpoint allows you to upload a file to be translated. The maximum file size is 100MB.

Required attributes

file
file
required
The file to upload (max 100MB).
folder_path
string
required
Storage location for the file.

Optional attributes

X-Org-Id
string
Organization identifier (header). If not provided, uses your default organization.
curl -X POST https://api.elanlanguages.ai/v1/files/upload \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -F "file=@/path/to/file.txt" \
  -F "folder_path=/translations"
Response
{
  "message": "File uploaded successfully",
  "file_name": "file.txt",
  "file_type": "txt",
  "file_size": 1024,
  "uploaded_at": "2025-12-21T10:30:00.000Z"
}

List translation files

GET /v1/files/list This endpoint allows you to list translation files in a specific folder.

Required attributes

folder_path
string
required
Directory path for file listing.

Optional attributes

X-Org-Id
string
Organization identifier (header). If not provided, uses your default organization.
curl -G https://api.elanlanguages.ai/v1/files/list \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -d folder_path="/translations"
Response
{
  "files": [
    {
      "file_name": "file.txt",
      "file_path": "/translations/file.txt",
      "size": 1024,
      "modified_at": "2025-12-21T10:30:00Z"
    }
  ],
  "total": 1,
  "folder_path": "/translations"
}

Download a translation file

GET /v1/files/download This endpoint allows you to download a translation file. File path should have URL-encoded special characters.

Required attributes

file_path
string
required
File location (URL encoded).

Optional attributes

X-Org-Id
string
Organization identifier (header). If not provided, uses your default organization.
curl -G https://api.elanlanguages.ai/v1/files/download \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -d file_path="/translations/file.txt" \
  -o downloaded_file.txt
The file will be downloaded directly. Make sure to properly URL-encode the file_path parameter if it contains special characters.

Get file details

GET /v1/files/details This endpoint allows you to retrieve details about a file, including analysis results such as word count and detected language. You can poll this endpoint after upload to check when background analysis completes (analysis_status changes from pending to completed).

Required attributes

file_path
string
required
File location to inspect.

Optional attributes

X-Org-Id
string
Organization identifier (header). If not provided, uses your default organization.
curl -G https://api.elanlanguages.ai/v1/files/details \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -d file_path="/translations/file.txt"
Response
{
  "id": 1,
  "s3_key": "translations/file.txt",
  "file_name": "file.txt",
  "file_type": "txt",
  "file_size": 1024,
  "mime_type": "text/plain",
  "uploaded_at": "2025-12-21T10:30:00.000Z",
  "word_count": 182,
  "detected_language": "en",
  "detected_language_confidence": 0.98,
  "analysis_status": "completed"
}

Get a file stream URL

GET /v1/files/stream-url This endpoint returns a short-lived presigned GET URL for streaming a file directly from S3. This is useful for media playback, as it allows the browser to range-request (and seek) large files such as videos instead of downloading the whole object through the API.

Required attributes

file_path
string
required
Unprefixed file key (the form returned by the upload endpoint).

Optional attributes

X-Org-Id
string
Organization identifier (header). If not provided, uses your default organization.
curl -G https://api.elanlanguages.ai/v1/files/stream-url \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -d file_path="/translations/file.txt"
The response contains a short-lived presigned URL that can be used to stream the file directly from S3.

Delete a translation file

DELETE /v1/files/delete This endpoint allows you to delete a translation file.

Required attributes

file_path
string
required
File location to remove.

Optional attributes

X-Org-Id
string
Organization identifier (header). If not provided, uses your default organization.
curl -X DELETE https://api.elanlanguages.ai/v1/files/delete \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -d file_path="/translations/file.txt"
Response
{
  "message": "File deleted successfully",
  "deleted_file": "/translations/file.txt"
}