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

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required

Display name for the file.

Minimum string length: 1
mime_type
string

MIME type of the file.

size_bytes
number

File size in bytes.

url
string

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

description
string

Description for the file.

Response

The created resource, including an upload_url.

data
object
required

Response payload.