Create File

View Markdown

Create a new file by ingesting an existing URL.

For more upload options, see Uploads.


POST
/files

Authorization

AuthorizationRequiredBearer <token>

See API Security for more details.

In: header

Request Body

application/jsonRequired

The request body should contain a properly formatted JSON object with a url property. Other optional properties are listed below. See File Object for more details.

urlRequiredstring
media_idstring
folderstring
filenamestring
refstring
metadataobject

Header Parameters

Accept-Versionstring

Specifies the API Version

Default: "2025-08-20"Value in: "2025-08-20" | "latest"

Response Body

Success

idRequiredstring
media_idRequiredstring
objectRequiredstring
Value in: "source" | "track" | "intelligence"
kindRequiredstring
Value in: "video" | "image" | "audio"
typeRequiredstring
codecstring
containerstring
widthinteger
heightinteger
orientationstring
rotationnumber
transparencyboolean
animatedboolean
framesinteger
durationnumber
Format: "float"
fpsnumber
Format: "float"
filesizeRequiredinteger
bitrateinteger
languagestring
labelstring
refstring
folderstring
filenamestring
urlRequiredstring
Format: "uri"
placeholderstring
backgroundstring
metadataobject
originalboolean
created_bystring
createdRequiredstring
Format: "date-time"
updatedRequiredstring
Format: "date-time"
statusRequiredstring
Value in: "waiting" | "processing" | "ready" | "failed"
const body = {
  url: "https://ittyb.it/sample.mp4",
  folder: "ittybit/samples",
  filename: "video.mp4",
  metadata: {
    "customKey": "your custom value"
  }
}

const file = await fetch("https://api.ittybit.com/files", {
  method: "POST",
  headers: { "Authorization": "Bearer ITTYBIT_API_KEY" },
  body: JSON.stringify(body)
});
{
  "id": "file_abcdefgh1234",
  "media_id": "med_abcdefgh1234",
  "object": "source",
  "kind": "video",
  "type": "video/mp4",
  "width": 1920,
  "height": 1080,
  "duration": 123.45,
  "filesize": 12345678,
  "folder": "ittybit/samples",
  "filename": "video.mp4",
  "url": "https://you.ittybit.net/ittybit/samples/video.mp4",
  "metadata": {
    "customKey": "your custom value"
  },
  "created": "2025-01-01T01:23:45Z",
  "updated": "2025-01-01T01:23:45Z",
  "status": "ready"
}