Request a presigned upload URL
POST
/api/v1/files/upload-url
const url = 'https://app.avera.io/api/v1/files/upload-url';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"fileName":"example","contentType":"example","fileSize":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.avera.io/api/v1/files/upload-url \ --header 'Content-Type: application/json' \ --data '{ "fileName": "example", "contentType": "example", "fileSize": 1 }'First step of the upload flow: validates the file name, size and content type, then returns a presigned URL the client uploads the bytes to directly with PUT. Confirm the upload afterwards to create the file record.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
fileName
required
string
contentType
required
string
fileSize
required
integer format: int64
Example generated
{ "fileName": "example", "contentType": "example", "fileSize": 1}Responses
Section titled “Responses”OK
Media type*/*
object
uploadId
required
string
uploadUrl
required
string
headers
required
object
key
additional properties
string
expiresAt
required
string
contentType
required
string
maxSizeBytes
required
integer format: int64