Files

Create file

Create a file. The endpoint discriminates between three intents based on which fields you send:

1. Presigned upload — { "filename": "photo.png" } Returns an upload_url and upload_headers. PUT your bytes to that URL, then call POST /v1/files/{id}/uploaded to transition the file from pending to ready.

2. Server-side URL import — { "url": "https://..." } Crevio downloads the bytes for you. Returns immediately with upload_status: "processing". The status flips to ready (or failed) once the background download completes; poll GET /v1/files/{id} to check.

3. External video embed — { "kind": "external_video", "url": "https://youtube.com/..." } Pins a YouTube, Vimeo, or Wistia URL as an embeddable reference. No bytes are stored; status returns as ready immediately. Non-embed URLs are rejected with 422.

post/files

Request

  • Base URL: https://api.crevio.co/v1
  • URL: https://api.crevio.co/v1/files
  • Auth: API key in header Authorization

Headers

Idempotency-Keystring

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Request body

kind'file' | 'external_video' | 'null' nullable

Defaults to 'file'. Set to 'external_video' to pin a YouTube, Vimeo, or Wistia URL as an embed.

urlstring nullable

Required when kind=external_video, or for server-side URL imports of files.

filenamestring nullable

Required for presigned uploads. Optional for URL imports.

Response

File created

objectstring required
idstring required
kind'file' | 'external_video' required
upload_status'pending' | 'processing' | 'ready' | 'failed' required
source'upload' | 'url_import' | 'external_video' | 'generation' required
titlestring nullable required
descriptionstring nullable required
created_atstring date-time required
updated_atstring date-time required
urlstring nullable required
tagsstring[] nullable required
source_job_idstring nullable required
filenamestring nullable required
content_typestring nullable required
sizeinteger nullable required
providerstring nullable required
file_urlstring nullable required
upload_urlstring nullable
upload_headersobject nullable

Changes

No recorded changes to this operation across all 2 revisions of this API.