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>",
"source_type": {},
"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 new file record. For uploads, only a filename is required — a presigned URL is returned for direct upload to S3. For external URLs (YouTube, Vimeo, Wistia), pass source_type “external” with a url.
Upload flow:
{"file": {"filename": "photo.png"}}upload_url with the provided upload_headersPOST /v1/files/{id}/uploaded to confirm the upload and transition to readyimport { 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>",
"source_type": {},
"upload_status": {},
"url": {},
"created_at": {},
"updated_at": {},
"filename": "<string>",
"content_type": "<string>",
"size": 123,
"provider": "<string>",
"file_url": "<string>",
"upload_url": "<string>",
"upload_headers": {}
}API key in the format: Bearer {api_token}
File created
Was this page helpful?