Create a presigned upload
POST
/api/v1/uploads
const url = 'http://localhost:3000/api/v1/uploads';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"filename":"example","mime":"example","size":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 http://localhost:3000/api/v1/uploads \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "filename": "example", "mime": "example", "size": 1 }'PUT the bytes to uploadUrl, then promote with POST /api/v1/assets.
Scope: propose.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
filename
required
string
mime
required
string
size
required
integer
Examplegenerated
{ "filename": "example", "mime": "example", "size": 1}Responses
Section titled “Responses”An upload ticket
Media typeapplication/json
object
token
required
string format: uuid
uploadUrl
required
PUT the bytes here, with the same Content-Type
string format: uri
expiresIn
required
integer
Examplegenerated
{ "token": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "uploadUrl": "https://example.com", "expiresIn": 1}default
Section titled “default”An error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
detail
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}