Skip to main content
POST
Create File

Path Parameters

app_id
string
required

The ID of the app

Query Parameters

bucket
string

Optional bucket name for storage operations

Example:

"cortex-eu"

Body

File data and options for upload

file

File to be uploaded. It can be a file object, a base64 encoded string, or a file data object containing base64 data, name, and type.

file_url
string

URL of the file to be uploaded

Example:

"https://example.com/files/document.pdf"

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

Flag indicating whether to extract contents from the document

Example:

false

document_extract_images
boolean

Flag indicating whether to extract images from the document

Example:

false

document_extract_pages
boolean

Flag indicating whether to extract pages from the document

Example:

false

document_pages
number[]

Array of page numbers to extract from the document

Maximum array length: 1024
Example:
document_max_pages
number

Maximum number of pages to extract from the document

Required range: x >= 1
Example:

10

storage
enum<string>
default:PERSISTENT

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

Available options:
PERSISTENT,
TEMPORARY
Example:

"PERSISTENT"

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"

bucket
string

Storage bucket for the file

Example:

"cortex-eu"

region
string

Region on R2/cloudflare

Example:

"cortex-eu"

Response

200 - application/json

Detailed information about a file

id
string
required

Unique identifier for the file

file_id
string
required

File identifier used in the storage system

file_filename
string
required

Name of the file

Example:

"document.pdf"

file_size
number
required

Size of the file in bytes

Example:

1024

file_mimetype
string
required

MIME type of the file

Example:

"application/pdf"

file_url
string
required

URL to access the file

created_at
string<date> | null
required

Timestamp when the file was created

file_format
enum<string>

Format of the file

Available options:
DOCUMENT
Example:

"DOCUMENT"

file_status
enum<string>

Current status of the file

Available options:
PROCESSING,
PROCESSED,
FAILED
Example:

"PROCESSED"

file_status_message
string

Status message providing additional information about the file status

document
object

Document data associated with the file

document_extract_contents
boolean

Flag indicating whether to extract contents from the document

document_extract_images
boolean

Flag indicating whether to extract images from the document

document_extract_pages
boolean

Flag indicating whether to extract pages from the document

document_pages
number[]

Array of page numbers to extract from the document

Maximum array length: 1024
Example:
document_progress
number

Progress of the document extraction process

storage
enum<string>
default:PERSISTENT

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

Available options:
PERSISTENT,
TEMPORARY
Example:

"PERSISTENT"