Skip to main content
POST
/
v1
/
workspaces
/
{workspace_id}
/
files
/
upload-url
Request signed upload URL (recommended)
curl --request POST \
  --url https://api.app.layer.ai/api/v1/workspaces/{workspace_id}/files/upload-url \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content_type": "<string>",
  "file_size_bytes": 123,
  "file_name": "<string>"
}
'
{
  "file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "upload_url": "<string>",
  "content_type": "<string>"
}

Authorizations

Authorization
string
header
required

Personal Access Token or OAuth2 JWT. Create a PAT at app.layer.ai → Settings → Personal Access Tokens.

Path Parameters

workspace_id
string<uuid>
required

Body

application/json
content_type
string
required

MIME type of the file to upload.

file_size_bytes
integer
required

Expected file size in bytes. Used to enforce upload limits.

file_name
string | null

Optional file name.

Response

Successful Response

file_id
string<uuid>
required

Unique identifier for the file. Use as input to generation endpoints after upload completes.

upload_url
string
required

Signed upload URL. POST to this URL to initiate a resumable upload, then PUT file chunks to the session URI returned in the Location header. Expires in 15 minutes.

content_type
string
required

MIME type to use when uploading.