Skip to main content
POST
Upload File

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceId
string
required

Workspace id

Body

multipart/form-data
file
file
required

Accepts both binary data or dataURI (i.e data:...,base64:...)

expiresAfter
string

File expiration time in seconds. This is currently a best effort expiration as it will be deleted only upon the next restart after expiration

public
string

Set to true to make uploaded file publicly available

shareToken
string

If enabled, return a share token that will allow anybody access the file

id
string

Optional custom file ID(s). Can be a single string (applied to first file) or an array (one per uploaded file). Files without a custom ID get a random one.

path
string

Optional storage subpath(s), scoped under the workspace prefix. A single string applies to the first file, an array maps one per uploaded file. Yields a clean object key <workspaceId>/<path> (sanitized, no traversal) instead of the default opaque id-based key — e.g. to publish prerendered pages at CDN-served URLs.

metadata
object

Arbitrary JSON metadata attached to the uploaded file(s). Send as a JSON object (application/json) or a JSON string (multipart). Applies to every uploaded file. Per-key metadata.<key> form fields override/extend these values and may be repeated to map one value per file. Filterable on list via GET /files?metadata.<key>=<value>.

Response

Success Response

name
string
required
url
string
required
mimetype
string
required
size
number
required
workspaceId
string
required
path
string
required
id
string
expiresAt
string | null
expiresAfter
number | null

Number of seconds after which the file will be automatically removed. This is currently a best effort expiration as it will be deleted only upon the next restart after expiration date.

metadata
object
public
boolean

Reflects whether the file has public-read ACL at storage provider. True by default

shareToken
string | null

A share token to append as a ?token query parameter to grant read access with given url

orgSlug
string | null

Organization slug set at creation time