REST API Reference
Programmatic access to MP4E video processing and metadata management
Overview#
The MP4E REST API allows you to programmatically upload videos, manage metadata, trigger AI processing, and integrate MP4E into your own applications.
https://api.mp4e.comJSONAuthentication#
All API requests require authentication using an API key passed in the request header.
curl -X GET "https://api.mp4e.com/api/videos" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"You can generate API keys in the Studio Settings.
| Header | Value |
|---|---|
Authorization | Bearer YOUR_API_KEY |
Content-Type | application/json |
Videos#
Endpoints for managing video files and projects.
/api/videosList all videos in your account
{
"videos": [
{
"id": "video_abc123",
"name": "Product Demo",
"status": "processed",
"duration": 120.5,
"thumbnail": "https://cdn.mp4e.com/thumbs/video_abc123.jpg",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T12:45:00Z"
}
],
"total": 42,
"page": 1,
"pageSize": 20
}/api/videos/:idGet details for a specific video
id(path)- Video ID{
"id": "video_abc123",
"name": "Product Demo",
"status": "processed",
"duration": 120.5,
"width": 1920,
"height": 1080,
"fps": 30,
"fileSize": 52428800,
"streamUrl": "https://cdn.mp4e.com/stream/video_abc123.mp4",
"thumbnail": "https://cdn.mp4e.com/thumbs/video_abc123.jpg",
"metadata": { ... },
"createdAt": "2024-01-15T10:30:00Z"
}/api/videos/uploadUpload a new video file
file(form)- Video file (MP4, MOV, WebM)name(form)- Display name (optional)autoProcess(form)- Auto-start AI processing (default: false)curl -X POST "https://api.mp4e.com/api/videos/upload" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@product_demo.mp4" \
-F "name=Product Demo" \
-F "autoProcess=true"{
"id": "video_abc123",
"name": "Product Demo",
"status": "uploading",
"uploadProgress": 0
}/api/videos/:idDelete a video and all associated data
id(path)- Video ID{ "success": true }Metadata#
Endpoints for reading and writing video metadata.
/api/videos/:id/metadataGet the full metadata for a video
id(path)- Video IDversion(query)- Specific version number (optional){
"schemaVersion": "2.0",
"videoDetails": {
"totalFrames": 3615,
"fps": 30,
"width": 1920,
"height": 1080
},
"objects": { ... },
"layers": [
{ "id": "layer_main", "name": "Main", "overlays": [ ... ] }
],
"variables": [ ... ],
"rules": [ ... ]
}/api/videos/:id/metadataUpdate video metadata (partial update)
id(path)- Video ID{
"layers": [
{
"id": "layer_main",
"name": "Main",
"overlays": [
{
"id": "overlay_new",
"name": "New CTA Button",
"position": { "x": 0.9, "y": 0.1 },
"plugin": { "type": "core:button", "config": { "text": "Shop Now" } }
}
]
}
]
}{
"success": true,
"version": 15,
"updatedAt": "2024-01-15T14:30:00Z"
}/api/videos/:id/exportExport video with embedded metadata
id(path)- Video IDformat(query)- Export format: mp4e (default), json{
"downloadUrl": "https://cdn.mp4e.com/exports/video_abc123_mp4e.mp4",
"expiresAt": "2024-01-16T14:30:00Z",
"fileSize": 54321000
}/api/videos/:id/versionsGet metadata version history
id(path)- Video ID{
"versions": [
{ "version": 15, "createdAt": "2024-01-15T14:30:00Z", "description": "Added CTA overlay" },
{ "version": 14, "createdAt": "2024-01-15T12:00:00Z", "description": "Updated variables" },
{ "version": 13, "createdAt": "2024-01-15T10:30:00Z", "description": "Initial processing" }
],
"currentVersion": 15
}Objects#
Endpoints for managing tracked objects within videos.
/api/videos/:id/objectsList all tracked objects in a video
id(path)- Video ID{
"objects": [
{
"id": "obj_001",
"label": "person",
"userLabel": "Host",
"confidence": 0.95,
"firstFrame": 0,
"lastFrame": 450,
"frameCount": 451
},
{
"id": "obj_002",
"label": "laptop",
"userLabel": null,
"confidence": 0.89,
"firstFrame": 120,
"lastFrame": 380,
"frameCount": 261
}
]
}/api/videos/:id/objects/:objectIdUpdate object properties
id(path)- Video IDobjectId(path)- Object ID{
"userLabel": "MacBook Pro M3",
"customData": {
"price": 1999,
"sku": "MBP-M3-14",
"category": "electronics"
}it
}{
"success": true,
"object": {
"id": "obj_002",
"label": "laptop",
"userLabel": "MacBook Pro M3",
"customData": { ... }
}
}/api/videos/:id/objects/:objectIdRemove an object from tracking
id(path)- Video IDobjectId(path)- Object ID{ "success": true }/api/videos/:id/objects/surfaceCreate a planar surface tracking object (for billboards, screens, etc.)
{
"name": "TV Screen",
"frame": 100,
"corners": [
{ "x": 0.2, "y": 0.3 },
{ "x": 0.8, "y": 0.3 },
{ "x": 0.8, "y": 0.7 },
{ "x": 0.2, "y": 0.7 }
]
}{
"success": true,
"objectId": "surface_001",
"trackedFrames": 250
}Processing#
Endpoints for AI-powered video analysis and object detection.
/api/videos/:id/processStart AI object detection and tracking
id(path)- Video ID{
"fps": 5,
"confidence": 0.25,
"labels": ["person", "product", "car"],
"enableClip": true
}{
"jobId": "job_xyz789",
"status": "queued",
"estimatedTime": 120
}/api/videos/:id/process/statusCheck processing job status
id(path)- Video ID{
"status": "processing",
"progress": 65,
"currentFrame": 1950,
"totalFrames": 3000,
"objectsDetected": 12,
"eta": 45
}/api/videos/:id/process/cancelCancel an in-progress processing job
id(path)- Video ID{
"success": true,
"status": "cancelled"
}Error Handling#
The API uses standard HTTP status codes and returns detailed error information.
| Status | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource doesn't exist |
409 | Conflict - Version mismatch |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
{
"error": {
"code": "INVALID_PARAMETER",
"message": "The 'fps' parameter must be between 1 and 30",
"field": "fps",
"details": {
"min": 1,
"max": 30,
"provided": 60
}
}
}X-RateLimit-Limit- Requests allowed per windowX-RateLimit-Remaining- Requests remainingX-RateLimit-Reset- Unix timestamp when limit resets