Files

Introduction
Files are the most fundamental objects in ittybit.
Each file object in the API represents a single binary file in your storage system.
For example, a single video uploaded to your project might be represented by a file object that looks like this:
(Simplified example. We'll cover additional props in later sections.)
File Props
ID
The id
property is a unique identifier for the file.
It is set by the API and is immutable.
Object
The object
property of a file object describes the type of object it is.
The following objects are supported:
Object | Description |
---|---|
source | A source file, like a video or image which can be displayed in a website, player, or app |
track | A supplementary file that players can use to display subtitles, chapters, or thumbnails |
intelligence | A file containing AI-generated data about a source, like transcripts or tags |
Kind
The kind
property describes how to categorise the file.
For source
files you can think of it as the value you'd use to decide which element to display in a UI e.g. "kind"
: "image"
would use an <img>
tag, "kind"
: "video"
would use a <video>
tag, etc.
The following kinds are supported:
Object | Kinds |
---|---|
source | video , image , audio |
track | subtitles , chapters , thumbnails |
intelligence | speech , tags , description , nsfw , prompt |
Type
The type
property is the MIME type of the file.
Browsers and media players use the type
to determine how to handle the file.
A file's type
is set automatically by the API when you upload, ingest, or create a new file.
See Sources for a list of supported types.
Filesize
The filesize
is the size in bytes.
This will be the value used to calculate how much Storage you are using.
URL
The url
property of a file object is (unsurprisingly) the URL you can use to access the file in a browser or your application's code. 1
By default the url is formed from your project's domain 2 and the file's id
.
Filename
You can customise your file's url using the filename
property.
You can give the same filename to multiple files.
When URLs collide, the most recently updated file will be served.
Folder
If you want to further customise the url you can use the folder
property.
You can also use forward slashes to create nested folders.
This can be useful if you are transferring files from a legacy system and want to keep the same url structure, or (with custom domain2) avoid breaking existing any links.
Original
The original
property is a boolean that indicates if the file is the originally uploaded / ingested file.
Ref
The ref
is a convenience prop that can be used to organise your files.
Refs are not required, but if you provide one then the file's url
will be included in parent Media object's urls
object.
They can also be a useful hook to use inside your code. Ittybit customers often use the ref to get specific files from the sources array inside Media objects.
Created
The created
property is the date and time the file was created.
Ittybit uses ISO 8601 format for all date and time properties, and sets them to UTC (Coordinated Universal Time).
The created
property is set automatically by the API when you upload, ingest, or create a new file.
Updated
The updated
property is the date and time the file was last updated.
The updated
property is set automatically by the API. Initially it will be the same as the created
property, then it will be updated whenever the file is modified.
Metadata
See the Metadata section for more details.
Metadata
Other Props
Different file objects have different properties.
Take a look at the sections below for more details.
API Reference
See the API Reference section for a full rundown of the file object, its properties, the available endpoints, and how to use them.
API Reference
Footnotes
-
New projects default to public delivery, but depending on your Access Rules you may require a Signed URL to view the file. ↩
-
New projects default to a free
*.ittybit.net
domain, but you can add your own custom domain if you'd prefer to keep your URLs on-brand. ↩ ↩2