Upload a file
Upload a file into a space and return the canonical file resource.
Authentication
AuthorizationBearer
Use Bearer <api-key>.
Headers
BCTRL-Subaccount-Id
Optional effective subaccount context for organization API keys. Subaccount API keys are already scoped and cannot use this header to act as another subaccount.
Query parameters
spaceId
Filter by a prefixed space ID, or pass default to use the caller default space.
Request
This endpoint expects a multipart form containing a file.
file
File bytes to upload.
metadata
Optional JSON object string with caller-owned file metadata.
name
Optional display filename.
path
Optional relative destination path. Must not be absolute or contain . or .. path segments.
Response
Created
contentType
createdAt
RFC 3339 timestamp with a UTC offset.
downloadUrl
id
Unique file identifier generated by BCTRL.
name
Customer-facing resource name. 1–200 characters.
path
sizeBytes
Non-negative number of bytes.
source
spaceId
Unique space identifier generated by BCTRL.
expiresAt
RFC 3339 timestamp with a UTC offset.
metadata
runId
Unique run identifier generated by BCTRL.
runtimeId
Unique runtime identifier generated by BCTRL.
type
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error

