Files make up the foundation of operating with Cloudglue. Files represent a video or audio file that you want to operate on.

Once you upload a file, you can use it anywhere in the Cloudglue platform, whether it may be for on-demand operations like transcribing or for use in collections like entities collections.

We do not use your files for any purpose other than to provide you with the service you signed up for.

Supported File Types

Cloudglue supports the following file types:

  • application/octet-stream
  • video/mp4
  • video/quicktime
  • video/avi
  • video/webm

Don’t see your file type? Contact us about it.

Uploading Files

There are a couple of ways to upload files to Cloudglue.

Web App

The Cloudglue web app allows you to upload files by dragging and dropping them into the web app or by selecting them from your file system.

API

You can also upload files via our Files API.

Example

curl --request POST \
  --url https://api.cloudglue.dev/v1/files \
  --header 'Authorization: Bearer cg-YOUR_API_KEY' \
  --header 'Content-Type: multipart/form-data' \
  --form 'metadata={}' \
  --form file=@file.mp4

SDKs

You can also use our SDKs to upload files to Cloudglue.

Example

import { CloudGlue } from '@aviaryhq/cloudglue-js';

const cloudGlue = new CloudGlue({
apiKey: 'cg-YOUR_API_KEY',
});

const file = await cloudGlue.files.uploadFile({
  file: new File([...videoData], 'video.mp4'),
  metadata: {},
});

console.log(file);

File Metadata

When uploading a file, you can pass in metadata. This metadata is for your own reference. You can use this to store your own custom data, such as identifiers or names from your own system.

When you retrieve a file, the metadata is included in the response.

Example

const file = await cloudGlue.files.uploadFile({
  file: new File([...videoData], 'video.mp4'),
  metadata: {
    my_own_id: '12345687890',
    type: 'Sales Footage',
  },
});

const file = await cloudGlue.files.getFile(file.id);

console.log(file);

Response

  {
    ...,
    "metadata": {
      "my_own_id": "12345687890",
      "type": "Sales Footage"
    }
  }

File Status

Cloudglue is inherently asynchronous.

We use the file status to indicate the current status of the file.

The possible values are:

  • pending - The file is pending and has not been processed yet.
  • processing - The file is being processed.
  • completed - The file has been processed successfully.
  • failed - The file failed to process.

You can check the status of a file by calling the getFile method.

Example

const file = await cloudGlue.files.getFile(file.id);

console.log(file.status);

Response

'pending' | 'processing' | 'completed' | 'failed';

Webhooks

To listen for file status updates asynchronously, you can use our webhooks. You can provide an endpoint to listen to the following file events:

  • file.job.processing - When a file is being processed.
  • file.job.completed - When a file has been processed successfully.
  • file.job.failed - When a file has failed to process.
  • file.job.deleted - When a file is deleted.

Limits

We do not charge you for the storage of your files. However, we do have some limits in place to prevent abuse.

To see the limits, please see the Rate Limits page.

Alongside that, we currently limit the maximum size of files to 2GB.

If you have larger file sizes, please contact us.