import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.files.create({});
console.log(result);
}
run();{
"object": "<string>",
"id": "<string>",
"kind": {},
"upload_status": {},
"url": {},
"created_at": {},
"updated_at": {},
"filename": "<string>",
"content_type": "<string>",
"size": 123,
"provider": "<string>",
"file_url": "<string>",
"upload_url": "<string>",
"upload_headers": {}
}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.
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.files.create({});
console.log(result);
}
run();{
"object": "<string>",
"id": "<string>",
"kind": {},
"upload_status": {},
"url": {},
"created_at": {},
"updated_at": {},
"filename": "<string>",
"content_type": "<string>",
"size": 123,
"provider": "<string>",
"file_url": "<string>",
"upload_url": "<string>",
"upload_headers": {}
}Documentation Index
Fetch the complete documentation index at: https://docs.crevio.co/llms.txt
Use this file to discover all available pages before exploring further.
API key in the format: Bearer {api_token}
Defaults to 'file'. Set to 'external_video' to pin a YouTube, Vimeo, or Wistia URL as an embed.
file, external_video, null Required when kind=external_video, or for server-side URL imports of files.
Required for presigned uploads. Optional for URL imports.
File created
Was this page helpful?