Upload File
Upload one file for the authenticated user as multipart/form-data with a single file part named file.
No other form fields are required; additional text fields are not used. The file may be at most 10 MiB (10,485,760 bytes); a larger file returns 413.
A part with another field name returns 400.
The stored media type is the Content-Type sent with the file part (not detected from content), and the stored name is its filename.
HEIC/HEIF images, detected from their content, are converted to JPEG and renamed .jpg; an undecodable HEIC/HEIF file returns 500 and stores nothing.
Retain id: it is the file ID used elsewhere (for example selfieFileId) and by Get File.
curl -X POST "$CEREBRUM_BASE_URL/v1/file" \ -H "apikey: $CEREBRUM_API_KEY" \ -F "file=@selfie.jpg;type=image/jpeg"Related: Get File
apiKeyapikey<token>multipart/form-data- body
file*fileThe file to store (maximum 10,485,760 bytes). Send its media type as the part Content-Type.
binaryFile stored.
application/json- response
id*stringThe ID of the uploaded file
uuidkey*stringStorage key of the uploaded file. Informational; use id to refer to the file.
curl -X POST 'https://api.cerebrum.com/v1/file' \ -H 'apikey: CEREBRUM_API_KEY' \ -F 'file=@path/to/file'{ "id": "1d3f5b7a-9c2e-4b6d-8a1f-3e5c7a9b1d42", "key": "cortex/uploads/1d3f5b7a-9c2e-4b6d-8a1f-3e5c7a9b1d42_selfie.jpg"}