Files

Files is the asset-management layer of Callaba Engine. It is where uploaded media becomes something the rest of the platform can actually reuse: an archive source, a playback asset, an overlay file, or a deliverable that should be copied somewhere durable.

In practice this module matters whenever the platform stops being only live. The file manager sits in the middle of the day-two work that teams actually do: prepare media, convert it into the right shape, reuse it in more than one workflow, and move it out to storage when it is ready.

Examples by preset

The file manager is easiest to understand when you separate three recurring production shapes: register an uploaded asset, save a converted derivative, and move a finished asset into storage.

{
  "file_name": "Main stage mezzanine",
  "file_visibility": "private",
  "file_description": "Uploaded mezzanine asset for overlay and playback workflows.",
  "file_path": "uploaded/f-01abc-main-stage.mp4",
  "output_format": "mp4",
  "file_unique_id": "file_01abc",
  "transcoding": {
    "video_transcoding": "Disabled",
    "audio_transcoding": "Disabled",
    "output_audio_bitrate": 128,
    "sample_rate": 44100
  }
}
{
  "file_id": "680100000000000000000001",
  "storage_type": "STORAGE_TYPE_S3",
  "storage_id": "680200000000000000000001"
}

Workflow examples

Upload once, reuse many times

Use the file manager when one uploaded asset should later feed overlays, playlist-style playback, or additional output modules without being uploaded again.

Convert at save time

Use the file create and update flows when the saved file should become a different deliverable such as MP3 or HLS. The team can then follow progress through getStat instead of guessing whether conversion is still moving.

Push completed assets to storage

Use copyTo and getCopyProgressById when local or generated assets should be moved into S3-style storage after capture or preparation is complete.

Create file
Collapse
POST
/api/files/create

Create saves a managed file row in the file manager. Use it when an uploaded asset should become something the rest of the platform can work with reliably: a named file, a converted deliverable, or a reusable playback or overlay asset.

This method is more than metadata storage. If the requested output_format or transcoding settings differ from the uploaded asset, Callaba can start the conversion work that turns the source file into the deliverable the team actually needs.

Examples by preset on this method show the most useful create shapes: preserve an uploaded MP4 as-is, derive an MP3 deliverable, or materialize an HLS package.

Direct asset registration

Use this preset when an uploaded mezzanine file should become a reusable managed asset without additional conversion.

Uploaded MP4 asset

This is the cleanest file-manager path: upload first, then register the asset with metadata, visibility, and a durable file row.

Uploaded MP4 asset
curl --request POST \
--url http://localhost/api/files/create \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"file_name": "Main stage mezzanine",
"file_visibility": "private",
"file_description": "Uploaded mezzanine asset for overlay and playback workflows.",
"file_path": "uploaded/f-01abc-main-stage.mp4",
"output_format": "mp4",
"file_unique_id": "file_01abc",
"transcoding": {
"video_transcoding": "Disabled",
"audio_transcoding": "Disabled",
"output_audio_bitrate": 128,
"sample_rate": 44100
}
}'
Save and convert

Use this preset when the stored asset should be rewritten into a simpler audio deliverable during the save flow.

Uploaded file to MP3 derivative

The file row is created first, then the background transcoding worker produces the derivative output and exposes progress through getStat.

Uploaded file to MP3 derivative
curl --request POST \
--url http://localhost/api/files/create \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"file_name": "Main stage audio extract",
"file_visibility": "private",
"file_description": "Audio-only derivative prepared from the uploaded mezzanine file.",
"file_path": "uploaded/f-01abc-main-stage.mp4",
"output_format": "mp3",
"file_unique_id": "file_01abc",
"transcoding": {
"video_transcoding": "Disabled",
"audio_transcoding": "mp3",
"output_audio_bitrate": 128,
"sample_rate": 44100
}
}'
Segmented output

Use this preset when the resulting asset should be materialized as an HLS package instead of a single file.

Uploaded file to HLS package

This is useful when the managed file will be handed to a playback or delivery workflow that expects an HLS-style directory output.

Uploaded file to HLS package
curl --request POST \
--url http://localhost/api/files/create \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"file_name": "Main stage HLS package",
"file_visibility": "private",
"file_description": "Segmented HLS output prepared from an uploaded mezzanine file.",
"file_path": "uploaded/f-01abc-main-stage.mp4",
"output_format": "m3u8",
"file_unique_id": "file_01abc",
"transcoding": {
"video_transcoding": "h264",
"audio_transcoding": "aac",
"output_audio_bitrate": 128,
"sample_rate": 44100
}
}'
Request body parameters
Identity
file_name
string

Dashboard label: Name.

Human-facing asset name stored in the file manager.

Asset path
file_path
string

Dashboard label: File.

Path produced by uploadFile or already known to the platform.

file_unique_id
string

Upload correlation id used to connect an in-progress upload with the saved file row.

Policy
file_visibility
string

Dashboard label: Visibility.

Controls whether the stored file should be treated as public or private in downstream UI flows.

file_description
string

Optional description stored on the file row.

Processing
output_format
string

Dashboard label: Output format.

If the requested format differs from the uploaded extension, the backend starts a background rewrite flow.

transcoding
object

Optional transcoding settings used when the file should be converted into a different deliverable.

Context
module_name
string

Optional source context for UI-driven flows. In practice the file manager most often saves rows under MODULE_FILES.

Create file
curl --request POST \
--url http://localhost/api/files/create \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"file_name": "Main stage mezzanine",
"file_visibility": "private",
"file_description": "Uploaded mezzanine asset for overlay and playback workflows.",
"file_path": "uploaded/f-01abc-main-stage.mp4",
"output_format": "mp4",
"file_unique_id": "file_01abc",
"transcoding": {
"video_transcoding": "Disabled",
"audio_transcoding": "Disabled",
"output_audio_bitrate": 128,
"sample_rate": 44100
}
}'
Response
Identity
_id / id / file_name
mixed

Saved file identifiers and the persisted file name.

Asset path
file_path / file_unique_id
mixed

Stored file location plus the upload correlation id.

Policy
file_visibility / file_description
mixed

Saved visibility and descriptive metadata for the asset.

Processing
output_format / transcoding / overlay
mixed

Output-format and processing state stored with the file row.

Runtime
size_bytes / duration_ms / created
mixed

Computed media metrics and backend-managed timestamp fields.

Response: Create file
JSON
{
"_id": "680100000000000000000001",
"id": "680100000000000000000001",
"file_name": "Main stage mezzanine",
"file_unique_id": "file_01abc",
"file_description": "Uploaded mezzanine asset for overlay and playback workflows.",
"file_path": "uploaded/f-01abc-main-stage.mp4",
"storage_type": "STORAGE_TYPE_INTERNAL_DISK",
"storage_id": null,
"file_visibility": "private",
"module_name": "MODULE_FILES",
"entity_name": "",
"entity_id": null,
"output_format": "mp4",
"transcoding": {
"video_transcoding": "Disabled",
"audio_transcoding": "Disabled",
"output_audio_bitrate": 128,
"sample_rate": 44100
},
"overlay": {
"type": "DISABLED"
},
"duration_ms": 612000,
"size_bytes": 832640000,
"created": "2026-03-24T18:55:00.000Z"
}
Upload file
Expand
POST
/api/files/uploadFile

Use this when the first production need is simple: get the media into Callaba so the asset can be named, converted, reused, copied, or attached to later workflows.

If file_unique_id is provided, the upload path can reconnect the finished file to a file row that was already created while the upload was still in progress.

Request body parameters
file
multipart/form-data

Binary file payload uploaded to the managed file area.

file_unique_id
string

Optional correlation id used by the dashboard to attach the upload to a pending file row.

Upload file
curl --request POST \
--url http://localhost/api/files/uploadFile \
--header 'x-access-token: <your_api_token>' \
--form 'file=@/absolute/path/to/main-stage.mp4' \
--form 'file_unique_id=file_01abc'
Response
file_name
string

Stored file name generated for the uploaded asset.

folder_name
string

Base folder used by the uploaded-file storage path.

uploaded
string

Timestamp returned by the upload path.

Response: Upload file
JSON
{
"file_name": "f-01abc-main-stage.mp4",
"folder_name": "uploaded",
"uploaded": "2026-03-24T18:54:40.000Z"
}
Get files count
Expand
POST
/api/files/getCount

Get files count is the quick inventory companion for the file-manager listing. Use it when the team needs fast pagination or capacity numbers without pulling the full asset list first.

Request body parameters
filter
object

Optional filter object used to scope the file count by module, entity, or custom search conditions.

Get files count
curl --request POST \
--url http://localhost/api/files/getCount \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"filter": {
"module_name": "MODULE_FILES"
}
}'
Response
count
integer

Total number of files visible to the authenticated user for the applied filter.

Response: Get files count
JSON
18
Get all files
Expand
POST
/api/files/getAll

Get all files returns the visible file-manager rows for the current filter. Use it when the team needs one inventory view of reusable assets, generated files, or recording outputs that should still be treated as managed media.

Request body parameters
limit
integer

Optional page size for file-manager listing queries.

skip
integer

Optional offset for paginated file listing.

sort
object

Optional sort descriptor. The dashboard defaults to { created: -1 }.

filter
object

Optional filter object. In practice the UI uses this for free-text search and recording-owned subsets.

Get all files
curl --request POST \
--url http://localhost/api/files/getAll \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"limit": 10,
"skip": 0,
"sort": {
"created": -1
},
"filter": {
"module_name": "MODULE_FILES"
}
}'
Response
array of file objects
array

The backend returns a bare array of file rows, not a wrapped object.

Response: Get all files
JSON
[
{
"_id": "680100000000000000000001",
"id": "680100000000000000000001",
"file_name": "Main stage mezzanine",
"file_unique_id": "file_01abc",
"file_description": "Uploaded mezzanine asset for overlay and playback workflows.",
"file_path": "uploaded/f-01abc-main-stage.mp4",
"storage_type": "STORAGE_TYPE_INTERNAL_DISK",
"storage_id": null,
"file_visibility": "private",
"module_name": "MODULE_FILES",
"entity_name": "",
"entity_id": null,
"output_format": "mp4",
"transcoding": {
"video_transcoding": "Disabled",
"audio_transcoding": "Disabled",
"output_audio_bitrate": 128,
"sample_rate": 44100
},
"overlay": {
"type": "DISABLED"
},
"duration_ms": 612000,
"size_bytes": 832640000,
"created": "2026-03-24T18:55:00.000Z"
}
]
Get file by id
Expand
POST
/api/files/getById

Get file by id loads one saved file row. Use it when a form, picker, or downstream workflow needs the full metadata and processing state for a single asset.

Request body parameters
id
string

Identifier of the file row you want to inspect.

Get file by id
curl --request POST \
--url http://localhost/api/files/getById \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "680100000000000000000001"
}'
Response
file object
object

The saved file row including current metadata, media metrics, and processing settings.

Response: Get file by id
JSON
{
"_id": "680100000000000000000001",
"id": "680100000000000000000001",
"file_name": "Main stage mezzanine",
"file_unique_id": "file_01abc",
"file_description": "Uploaded mezzanine asset for overlay and playback workflows.",
"file_path": "uploaded/f-01abc-main-stage.mp4",
"storage_type": "STORAGE_TYPE_INTERNAL_DISK",
"storage_id": null,
"file_visibility": "private",
"module_name": "MODULE_FILES",
"entity_name": "",
"entity_id": null,
"output_format": "mp4",
"transcoding": {
"video_transcoding": "Disabled",
"audio_transcoding": "Disabled",
"output_audio_bitrate": 128,
"sample_rate": 44100
},
"overlay": {
"type": "DISABLED"
},
"duration_ms": 612000,
"size_bytes": 832640000,
"created": "2026-03-24T18:55:00.000Z"
}
Update file
Expand
POST
/api/files/update

Update is where the team adjusts a managed asset after it already exists. Simple metadata edits stay lightweight, while format or transcoding changes can also trigger the work needed to reshape the stored file into a better deliverable.

Request body parameters
id
string

Identifier of the file row being updated.

file payload fields
mixed

The update contract mirrors create and can also trigger a background rewrite when format or transcoding changes.

Update file
curl --request POST \
--url http://localhost/api/files/update \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"file_name": "Main stage mezzanine updated",
"file_visibility": "private",
"file_description": "Uploaded mezzanine asset for overlay and playback workflows.",
"file_path": "uploaded/f-01abc-main-stage.mp4",
"output_format": "mp4",
"file_unique_id": "file_01abc",
"transcoding": {
"video_transcoding": "Disabled",
"audio_transcoding": "Disabled",
"output_audio_bitrate": 128,
"sample_rate": 44100
},
"id": "680100000000000000000001"
}'
Response
updated file object
object

The backend returns the updated file row after the save path completes.

Response: Update file
JSON
{
"_id": "680100000000000000000001",
"id": "680100000000000000000001",
"file_name": "Main stage mezzanine updated",
"file_unique_id": "file_01abc",
"file_description": "Uploaded mezzanine asset for overlay and playback workflows.",
"file_path": "uploaded/f-01abc-main-stage.mp4",
"storage_type": "STORAGE_TYPE_INTERNAL_DISK",
"storage_id": null,
"file_visibility": "private",
"module_name": "MODULE_FILES",
"entity_name": "",
"entity_id": null,
"output_format": "mp4",
"transcoding": {
"video_transcoding": "Disabled",
"audio_transcoding": "Disabled",
"output_audio_bitrate": 128,
"sample_rate": 44100
},
"overlay": {
"type": "DISABLED"
},
"duration_ms": 612000,
"size_bytes": 832640000,
"created": "2026-03-24T18:55:00.000Z"
}
Remove file
Expand
POST
/api/files/remove

Remove deletes the managed file row and attempts to delete the backing asset from its current storage location. Use it when the team is sure the asset should disappear from both inventory and storage, not just from the current screen.

Request body parameters
id
string

Identifier of the file row to delete.

Remove file
curl --request POST \
--url http://localhost/api/files/remove \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "680100000000000000000001"
}'
Response
success
boolean

Indicates that the file row and its backing file path were removed successfully.

Response: Remove file
JSON
{
"success": true
}
Remove file by path
Expand
POST
/api/files/removeByPath

Use this when a temporary upload should be discarded quickly before it becomes part of a longer-lived asset workflow.

Request body parameters
file_path
string

Absolute or managed file path that should be cleared without first resolving a file id.

Remove file by path
curl --request POST \
--url http://localhost/api/files/removeByPath \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"file_path": "/cc-api/uploaded/f-01abc-main-stage.mp4"
}'
Response
success
boolean

The path cleanup flow completes without returning a file object.

Response: Remove file by path
JSON
{
"success": true
}
Copy file to storage
Expand
POST
/api/files/copyTo

Copy to starts a managed handoff of a file into another storage target. Use it when the asset is ready to leave local working storage and become part of a longer-lived archive or delivery destination.

Once the copy is accepted, use getCopyProgressById to track completion.

Request body parameters
Source
file_id
string

Identifier of the managed file being copied.

Destination
storage_type
string

Target storage family such as STORAGE_TYPE_INTERNAL_DISK or an external object-storage type.

storage_id
string

Optional storage identifier when the destination is an external configured storage target.

Copy file to storage
curl --request POST \
--url http://localhost/api/files/copyTo \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"file_id": "680100000000000000000001",
"storage_type": "STORAGE_TYPE_S3",
"storage_id": "680200000000000000000001"
}'
Response
success
boolean

The copy job has been accepted and progress can now be monitored by file id.

Response: Copy file to storage
JSON
{
"success": true
}
Get file copy progress by id
Expand
POST
/api/files/getCopyProgressById

Use this when the team needs a live answer about whether a file handoff is still moving and how far it is from completion.

Request body parameters
id
string

Identifier of the source file whose copy progress should be inspected.

Get file copy progress by id
curl --request POST \
--url http://localhost/api/files/getCopyProgressById \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "680100000000000000000001"
}'
Response
progress
number

Copy progress percentage derived from copied bytes versus total bytes.

completed
boolean

Becomes true after the destination copy has fully completed.

Response: Get file copy progress by id
JSON
{
"progress": 57.25,
"completed": false
}
Get file process stat
Expand
POST
/api/files/getStat

Get file process stat exposes the live progress of a file conversion or rewrite. This is the operator-facing companion to create and update when the team needs to know whether a new deliverable is still processing, nearly done, or stalled.

In practice the most useful fields are bitrate, FPS, output time, speed, and progress state.

Request body parameters
This method has no parameters
Get file process stat
curl --request POST \
--url http://localhost/api/files/getStat \
--header 'x-access-token: <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{}'
Response
processData[]
array

Current background transcoding-worker statistics exposed by the file manager polling loop.

processData[].bitrate / bitrate_kbits
mixed

Current FFmpeg-reported bitrate for the active rewrite process.

processData[].fps / out_time_ms / speed / progress
mixed

Operator-facing progress fields used by the dashboard while a file rewrite is running.

Response: Get file process stat
JSON
[
{
"processData": {
"id": "680100000000000000000001",
"name": "Main stage mezzanine",
"fileName": "f-01abc-main-stage.mp4",
"output_format": "mp4",
"frame": "1532",
"fps": "25.0",
"bitrate": "1842.1kbits/s",
"bitrate_kbits": 1842,
"out_time_ms": "61200000",
"speed": "1.00x",
"progress": "continue"
}
}
]