Skip to main content
POST
/
files
Typescript (SDK)
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>",
  "title": "<string>",
  "description": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "url": "<string>",
  "tags": [
    "<string>"
  ],
  "source_job_id": "<string>",
  "filename": "<string>",
  "content_type": "<string>",
  "size": 123,
  "provider": "<string>",
  "file_url": "<string>",
  "upload_url": "<string>",
  "upload_headers": {}
}

Authorizations

Authorization
string
header
required

API key in the format: Bearer {api_token}

Body

application/json
kind
enum<string> | null

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

Available options:
file,
external_video,
null
url
string | null

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

filename
string | null

Required for presigned uploads. Optional for URL imports.

Response

File created

object
string
required
id
string
required
kind
enum<string>
required
Available options:
file,
external_video
upload_status
enum<string>
required
Available options:
pending,
processing,
ready,
failed
source
enum<string>
required
Available options:
upload,
url_import,
external_video,
generation
title
string | null
required
description
string | null
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
url
string | null
required
tags
string[] | null
required
source_job_id
string | null
required
filename
string | null
required
content_type
string | null
required
size
integer | null
required
provider
string | null
required
file_url
string | null
required
upload_url
string | null
upload_headers
object