Skip to main content
POST
/
api
/
files
Create File
curl --request POST \
  --url https://dash.empirical.run/api/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": 123,
  "name": "<string>",
  "mime_type": "<string>",
  "size_bytes": 123,
  "url": "<string>",
  "description": "<string>"
}
'
{
  "data": {
    "file": {
      "id": 123,
      "name": "<string>",
      "url": "<string>",
      "description": "<string>",
      "mime_type": "<string>",
      "size_bytes": 123,
      "status": "pending",
      "access_level": "<string>",
      "created_by": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>",
      "upload_url": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

API key from the Empirical dashboard.

Body

application/json

File to create.

project_id
number
required

The project ID to associate the resource with.

name
string
required

Display name for the resource (typically the file name).

mime_type
string

MIME type of the file.

size_bytes
number

File size in bytes.

url
string

External URL (e.g. Google Sheet link). When provided, creates a link-type file with no R2 upload required.

description
string

Description for the resource.

Response

Created file with presigned upload URL.

data
object
required