Skip to main content
Version: v1.2

Upload Video from URL

Use this API to upload your file from a direct downloadable url. Example:

http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4

Prerequisites

  • You’re familiar with the concepts described on the Platform overview page.
  • You have created a memories.ai API key.
  • The videos from url must meet the following requirements to ensure a successful encoding process:
    • Video and audio formats: The video files must be encoded in h264, h265, vp9, or hevc.
    • Audio track: If you intend to use the audio transcription feature, the video you are uploading must contain an audio track.
  • The url must be a direct download link to the video file. This URL can be accessed via a GET request to download or stream the video content. No authentication is required (unless otherwise noted).

Host URL

  • https://api.memories.ai

Endpoint

POST /serve/api/v1/upload_url


Request Example

import requests  
headers = {"Authorization": "<API_KEY>"} # API key

# Video file details
data = {
"url": "<URL>",
"callback": "<YOUR_CALLBACK_URI>" # Optional
"unique_id": "<UNIQUE ID>",
}

response = requests.post(
"https://api.memories.ai/serve/api/v1/upload_url",
data=data,
headers=headers
)

print(response.json())

Replace the following placeholders:

  • API_KEY: Your actual memories.ai API key.
  • URL: URL to your video.
  • YOUR_CALLBACK_URI: A publicly accessible URL where memories.ai can send video status updates.
  • UNIQUE_ID: a unique id (integer) for workspace/namespace/user identification

Callback Notification Payload

If you provide a callBackUri, memories.ai will send a POST request to it once the video has been uploaded or parsed.

{
"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

{
"url": "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",
"callback": "test.beeceptor.com",
"unique_id": "default",
}

Request Parameters

NameLocationTypeRequiredDescription
callbackquerystringNoCallback URI to notify on successful parsing
AuthorizationheaderstringYesAuthorization API key
urlbodystringYesURL of the video
unique_idbodystringNodefault by default

Response Example

Status code 200

{
  "code": "0000",
  "msg": "success",
  "data": {
    "videoNo": "mavi_video_568102998803353600",
    "videoName": "mavi_api_video_1be6a69f3c6e49bf986235d68807ab1f",
    "videoStatus": "UNPARSE",
    "uploadTime": "1744905509814"
  }
}

Response Structure

NameTypeRequiredDescription
codestringYesStatus code
msgstringYesMessage
dataobjectYesData object
» videoNostringYesVideo identification number
» videoNamestringYesName of the video
» videoStatusstringYesStatus of the video
» uploadTimestringYesVideo upload timestamp

Note: The callBackUri field will actively notify you of the task status after the video upload is complete and the parsing task is finished.