DocumentationCreate Upload (Local File Upload)
Create Upload (Local File Upload)
Initialize a multipart file upload. Provide the file size to receive presigned URLs for uploading parts.
Endpoints
POST/api/videos/uploads
Create a new upload job for Local File Upload.
Example 1: Without Encoding
Provide the file size to initialize multipart upload without encoding.
Request
curl -X POST "https://theamplium.com/api/videos/uploads" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"name": "Demo AIV No Encode",
"layout": "AIV",
"file": { "sizeBytes": 250000000 },
"isEncode": false,
"isDrm": false
}'Response
{
"status": "ok",
"jobId": "0f6c1e5d-5f6a-4ef5-90b2-7a3b2e1e1111",
"uploadId": "a4d7985f-7a8d-4f9c-9d34-3b6264f02222",
"uploadStrategy": "multipart",
"partSizeBytes": 104857600,
"totalParts": 3,
"upload_status": {
"percent": 0,
"status": "Processing",
"message": null
},
"name": "Demo AIV No Encode",
"layout": "AIV",
"isEncode": false,
"isDrm": false
}Example 2: With Encoding
Provide the file size to initialize multipart upload with encoding enabled.
Request
curl -X POST "https://theamplium.com/api/videos/uploads" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"name": "Demo AIV",
"layout": "AIV",
"file": { "sizeBytes": 250000000 },
"isEncode": true,
"isDrm": false
}'Response
{
"status": "ok",
"jobId": "0f6c1e5d-5f6a-4ef5-90b2-7a3b2e1e1111",
"uploadId": "a4d7985f-7a8d-4f9c-9d34-3b6264f02222",
"uploadStrategy": "multipart",
"partSizeBytes": 104857600,
"totalParts": 3,
"upload_status": {
"percent": 0,
"status": "Processing",
"message": null
},
"name": "Demo AIV",
"layout": "AIV",
"isEncode": true,
"isDrm": false
}Error Response
When an error occurs, the API returns a JSON response with this structure:
{
"error": "BadRequest",
"message": "isEncode must be true or false."
}HTTP Error Codes
| Code | Error Type |
|---|---|
| 400 | BadRequest |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | NotFound |
| 413 | PayloadTooLarge |
| 415 | UnsupportedMediaType |
| 500 | InternalServerError |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Required | The video title. |
| layout | string | Required | Currently only AIV is supported. |
| videoUrl | string | Optional | URL mode: http or https URL to video. |
| file | object | Optional | Direct mode: { sizeBytes: number }. |
| isEncode | boolean | Optional | Default: false. |
| isDrm | boolean | Optional | Default: false. |
Encoding Rules
AIV
- isEncode false: packages the source directly; source must be 4320x4320.
- isEncode true: re-encodes sources above 75 Mbps with software x265.
Direct Upload Constants
- Part size: 104857600 bytes (100 MiB)
- Max parts: 10000
- Max file size: 1048576000000 bytes
- Upload session expiry: 7 days
- Presigned URL expiry: 7 days