Skip to main content
POST
Create a new file upload

Path Parameters

app_id
string
required

The ID of the app

Body

Request body for creating a new file upload

Create a new file upload

allowed_types
string[] | null

The allowed mime types for the file field (e.g. image/*, application/pdf)

Maximum array length: 255
Maximum string length: 255
region
enum<string>

Region on R2/Cloudflare where the file will be stored

Available options:
auto,
north-america,
european-union
Example:

"european-union"

bucket
enum<string>

Storage bucket where the file will be stored

Available options:
dev-cortex,
cortex,
cortex-eu,
cortex-dev-eu,
devbucket
Example:

"cortex-eu"

document_extract_contents
boolean

Whether to extract contents from the document. If true, the file will be processed and contents extracted.

document_extract_images
boolean

Whether to extract images from the document. If true, images will be extracted.

document_pages
number[]

Array of page numbers to extract from the document

Maximum array length: 1024
Example:
expires_in_seconds
number

Timestamp when the uploaded file will expire. By default, it is set to 30 days

Required range: 1 <= x <= 315360000
Example:

3600

visibility
enum<string>

Whether the file is private or public, private files URLs are signed with a token and can be accessed temporarily

Available options:
PUBLIC,
PRIVATE
Example:

"PRIVATE"

storage
enum<string>
default:PERSISTENT

Whether the file is stored permanently or temporarily, indicating the storage type

Available options:
PERSISTENT,
TEMPORARY
Example:

"PERSISTENT"

metadata
object | null

Custom metadata for the uploaded file as key-value pairs (Max 2KB)

Response

200 - application/json

Uploaded file information

id
string
required

Unique identifier for the uploaded file

future_file_id
string
required

Future file ID for the uploaded file

file
object | null
required

The file associated with the upload, if available

upload_url
string
required

URL to upload the file

expires_at
string<date> | null
required

Timestamp when the uploaded file will expire

document_pages
number[] | null
required

Array of page numbers to extract from the document

Maximum array length: 1024
Example:
storage
enum<string>
default:PERSISTENT
required

Whether the file is stored permanently or temporarily, indicating the storage type

Available options:
PERSISTENT,
TEMPORARY
Example:

"PERSISTENT"

visibility
enum<string>
required

Whether the file is private or public, private files URLs are signed with a token and can be accessed temporarily

Available options:
PUBLIC,
PRIVATE
Example:

"PRIVATE"

created_at
string<date> | null
required

Timestamp when the uploaded file was created

updated_at
string<date> | null
required

Timestamp when the uploaded file was last updated

region
string

Region on R2/Cloudflare

Example:

"european-union"

bucket
string

Storage bucket for the file

Example:

"cortex-eu"

metadata
object | null

Custom metadata for the uploaded file as key-value pairs (Max 2KB)

allowed_types
string[] | null

The allowed mime types for the file field (e.g. image/*, application/pdf)

Maximum array length: 255
Maximum string length: 255
document_extract_contents
boolean

Whether to extract contents from the document. If true, the file will be processed and contents extracted.

document_extract_images
boolean

Whether to extract images from the document. If true, images will be extracted.