Check out the Uploads guide for step-by-step instructions on how to upload files to Cosmos for storage.
Parameters
The extension query is used to set a file extension for your uploaded file.
Make sure the extension matches the extension of your file. Supported extensions for video are mp4
, mov
, webm
, and ogg
. Supported extensions for images are jpeg
, png
, webp
, and gif
.
Response
Indicates the type of document returned in the response.
The attributes of the Upload document response. Show Upload Document Attributes
A signed URL that can be used to upload a file to Cosmos.
The key used to identify the uploaded file in Cosmos.
curl --location --request GET 'https://api.golivecosmos.com/v1/uploads?extension=mp4' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
{
"type" : "upload" ,
"attributes" : {
"signedUrl" : "https://production-cosmos-assets.s3.us-east-1.amazonaws.com/production/64249607732dd0eb4b42ce02/7866779?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAUHGZCRDQ7C36EENS%2F20230606%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230606T182458Z&X-Amz-Expires=300&X-Amz-Signature=8ae1e1fdc3fa17a679bbeefef6bf03b6093add9f4efc158bbe32a37bf2c9a9b3&X-Amz-SignedHeaders=host&x-id=PutObject" ,
"key" : "production/64249607732dd0eb4b42ce02/7866779"
}
}