Upload Video
Use this API to upload your video to MAVI! Once the video is uploaded, it enters the MAVI video processing pipeline, and you can query the status of video processing at any time. Additionally, by providing a callback URI in the request body, MAVI can automatically notify you about the status, saving you hassle of waiting in front your screen!
Host URL
Endpoint
POST /api/serve/video/upload
Request Example
import requests
headers = {"Authorization":"Bearer <YOUR_ACCESS_TOKEN>" } # #YOUR_ACCESS_TOKEN
data = {"file": ("<MY_VIDEO_NAME>", open("<VIDEO_FILE_PATCH>", "rb"), "video/mp4")}
params={"callBackUri":"<YOUR_CALLBACK_URI>"}
response = requests.post(
"https://mavi-backend.memories.ai/api/serve/video/upload",
files=data,
params=params,
headers=headers
)
print(response.json())
Replace YOUR_ACCESS_TOKEN in the code above with your actual access token, MY_VIDEO_NAME with your video's name (including the file extension, e.g., .mp4), VIDEO_FILE_PATH with the path to your video file, and YOUR_CALLBACK_URI with your public callback URL. Ensure that the callback URL is publicly accessible, as the resolution results will be sent to this address via a POST request with the following request body:
{
"videoNo": "mavi_video_554046065381212160",
"clientId": "d7a7427b502df6c8e31de003675b7b77",
"status": "PARSE"
}
The callback request body includes the following fields:
- videoNo: The unique video number.
- clientId: Identifies the client that is being used to upload the video.
- status: The processing status of the video.
The status field can have one of the following values:
"PARSE"
– The video is being processed."UNPARSE"
– The video has not been processed."FAIL"
– The video processing failed.
Request Body
file: ""
Request Parameters
Name | Location | Type | Required | Description |
---|---|---|---|---|
callBackUri | query | string | Yes | Callback URI to notify on successful parsing |
Authorization | header | string | Yes | Authorization token (if required) |
body | body | object | Yes | Request payload |
» file | body | string (binary) | Yes | Video file to upload |
Response Example
Status code 200
{
"code": "string",
"msg": "string",
"data": {
"videoNo": "string",
"videoName": "string",
"videoStatus": "string",
"uploadTime": "string",
"duration": "string"
}
}
Response Structure
Name | Type | Required | Description |
---|---|---|---|
code | string | Yes | Status code |
msg | string | Yes | Message |
data | object | Yes | Data object |
» videoNo | string | Yes | Video identification number |
» videoName | string | Yes | Name of the video |
» videoStatus | string | Yes | Status of the video |
» uploadTime | string | Yes | Video upload timestamp |
» duration | string | Yes | Duration of the video |
Note: The callBackUri field will actively notify you of the task status after the video upload is complete and the parsing task is finished.