Skip to main content
POST
/
upload
/
signed-url
Get Upload Signed URL
curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/upload/signed-url \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "original_filename": "video.mp4"
}
'
{
  "code": 200,
  "msg": "success",
  "data": {
    "asset_id": "re_660736410386149376",
    "signed_url": "https://storage.googleapis.com/...",
    "expires_in": 93600
  },
  "success": true,
  "failed": false
}
This endpoint generates a pre-signed URL that allows you to upload files directly to cloud storage.
Pricing:
  • API calls are free
  • Storage fee: $0.001/1GB per day

Code Examples

const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2";
const API_KEY = "sk-mai-this_a_test_string_please_use_your_generated_key_during_testing";

const response = await fetch(`${BASE_URL}/upload/signed-url`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': API_KEY
  },
  body: JSON.stringify({
    original_filename: 'video.mp4'
  })
});

const data = await response.json();
console.log(data);

// Then upload the file using the signed URL
const formData = new FormData();
formData.append('file', file);

await fetch(data.data.signed_url, {
  method: 'POST',
  body: formData
});

Request Body

FieldTypeRequiredDescription
original_filenamestringYesThe original filename with extension (e.g., “video.mp4”)

Response

Returns a signed URL and associated metadata for file upload.
{
  "code": 200,
  "msg": "success",
  "data": {
    "asset_id": "re_660736410386149376",
    "signed_url": "https://storage.googleapis.com/...",
    "expires_in": 93600
  },
  "success": true,
  "failed": false
}

Response Parameters

ParameterTypeDescription
codestringResponse code indicating the result status
msgstringResponse message describing the operation result
dataobjectResponse data object containing the signed URL and asset information
data.asset_idstringUnique identifier of the asset that will be created after upload
data.signed_urlstringPre-signed URL for direct file upload to cloud storage
data.expires_inintegerValidity period of the signed URL in seconds
successbooleanIndicates whether the operation was successful
failedbooleanIndicates whether the operation failed

Notes

  • The signed URL expires after the time specified in expires_in (in seconds)
  • Upload the file before the URL expires to avoid upload failures
  • The expires_in value indicates how long the signed URL remains valid from the time it was generated

Authorizations

Authorization
string
header
required

Body

application/json
original_filename
string
required

The original filename with extension

Example:

"video.mp4"

Response

200 - application/json

Signed URL generated successfully

code
string

Response code indicating the result status

Example:

200

msg
string

Response message describing the operation result

Example:

"success"

data
object

Response data object containing the signed URL and asset information

success
boolean

Indicates whether the operation was successful

Example:

true

failed
boolean

Indicates whether the operation failed

Example:

false