Files

Start a resumable upload (up to 2 GB)

The file goes straight to object storage in parts of part_size bytes (8 MB; the last part is smaller). Then: ask for part URLs with POST /v1/uploads/{uuid}/parts, PUT each part to its URL and keep the ETag response header, then POST /v1/uploads/{uuid}/complete. An unfinished upload expires after 24 hours.

With sha256 of a file already in your library, nothing is uploaded: upload_id is null and existing_file_uuid names that file.

Types: video/mp4, video/quicktime, video/webm, video/x-matroska, video/mpeg, audio/mpeg, audio/wav, audio/mp4, audio/aac, audio/ogg, audio/webm, audio/flac, image/png, image/jpeg, image/webp, image/gif. Images up to 25 MB, video and audio up to 2 GB. After completion the content is checked; a file that is not what it claims is deleted and the upload fails.

post/v1/uploads

Request

  • Base URL: https://contentmaschine.ai/api
  • URL: https://contentmaschine.ai/api/v1/uploads
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://contentmaschine.ai/api/oauth/authorize, token URL https://contentmaschine.ai/api/oauth/token)

Request body

filenamestring required

Display name of the file.

sizeinteger required

Size in bytes.

mime_typestring

The file type. Empty: taken from the file extension.

sha256string

Optional hex digest, for dedupe against your library.

purpose'library' | 'transcription' | 'studio' | 'studio_export'

What the file is for.

Response

The upload, or the existing file.

successboolean
timestampstring date-time

Example response

{
  "success": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.