Skip to main content
POST
/
upload
Upload File
curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/upload \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file'
{
  "code": 200,
  "msg": "success",
  "data": {
    "asset_id": "re_660727003963174912"
  },
  "success": true,
  "failed": false
}
This endpoint allows you to upload a file to the server. After a successful upload, you will receive an asset_id that can be used to reference this asset in all subsequent API calls.
Pricing:
  • API calls are free
  • Storage fee: $0.001/1GB per day

Supported File Formats

CategoryFormats
VideoMP4, MOV, AVI, WebM, MKV, FLV, WMV, MPEG
AudioMP3, WAV, AAC, FLAC, OGG, M4A
ImageJPEG, PNG, GIF, WebP, BMP, TIFF

Code Example

curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/upload \
  --header 'Authorization: sk-mai-this_a_test_string_please_use_your_generated_key_during_testing' \
  --form 'file=@video.mp4'

Request Body

ParameterTypeRequiredDescription
filefileYesThe file to upload (multipart/form-data). See supported formats above.

Response

Return the resource information after the upload is successful.
{
  "code": 200,
  "msg": "success",
  "data": {
    "asset_id": "re_660727003963174912"
  },
  "success": true,
  "failed": false
}

Response Parameters

ParameterTypeDescription
codestringResponse code indicating the result status
msgstringResponse message describing the operation result
dataobjectResponse data object containing the uploaded asset information
data.asset_idstringUnique identifier of the uploaded asset. Use this ID in all subsequent API calls.
successbooleanIndicates whether the operation was successful
failedbooleanIndicates whether the operation failed

Upload Status

After uploading, the asset goes through the following states. Only assets with SUCCESS status can be used in subsequent API calls.
StatusDescription
WAITINGUpload request received, waiting to process
UPLOADINGFile is being uploaded and processed
SUCCESSUpload completed successfully — asset is ready for use
FAILEDUpload failed — retry the upload
Use the Get Metadata endpoint to check the current upload_status of an asset.

File Size Limit

The maximum file size for direct upload is 500 MB. For files larger than 500 MB, use the Signed URL Upload method, which supports files up to 5 GB and provides more reliable uploads for large files.

Notes

  • The returned asset_id is required for all subsequent operations (transcription, editing, embedding, etc.)
  • Only assets with upload_status: "SUCCESS" can be used in subsequent API calls
  • Use Get Metadata to verify the asset is ready before calling other endpoints

Authorizations

Authorization
string
header
required

Body

multipart/form-data
file
file
required

The file to upload

Response

200 - application/json

File uploaded 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 uploaded asset information

success
boolean

Indicates whether the operation was successful

Example:

true

failed
boolean

Indicates whether the operation failed

Example:

false