Video Uploads API
The Uploads API provides a way to directly upload video files and monitor their processing status.
All uploads are processed asynchronously. You will receive an immediate 202 Accepted
response, and the video will be processed in the background. You should use the status endpoints to monitor progress.
Upload a Video
This endpoint accepts a multipart/form-data
request to upload a new video file.
POST /uploads
Request Body (multipart/form-data
)
Field | Type | Required | Description |
---|---|---|---|
video | file | Yes | The video file to be uploaded. |
folder | string | Yes | The collection path where the video should be placed (e.g., root/my-folder ). |
Example Request (.http
)
POST /api/client/v1/uploads
Authorization: Bearer sk-your-api-key-here
Content-Type: multipart/form-data; boundary=...
... (form data with file and folder) ...
Response: 202 Accepted
The API acknowledges the upload and returns the initial status. You should store the id
to check the status later.
{
"message": "Upload accepted and is now being processed.",
"data": {
"id": "9c1fa5c4-a8f1-4b2e-9d6e-1c8a0b9e2d7f",
"status": 1,
"status_text": "pending"
}
}
Get Uploads Status
Retrieves the status of the 50 most recent uploads. You can poll this endpoint to update your UI.
GET /uploads
Example Request
GET /api/client/v1/uploads
Authorization: Bearer sk-your-api-key-here
Response: 200 OK
{
"data": [
{
"id": "9c1fa5c4-a8f1-4b2e-9d6e-1c8a0b9e2d7f",
"filename": "my_new_video.mp4",
"status": 3,
"status_text": "processing",
"created_at": "2024-08-11T10:00:00Z",
"updated_at": "2024-08-11T10:01:00Z"
},
{
"id": "9c1fa5c3-b9f2-5c3f-8e7f-2d9b1c4e1f8e",
"filename": "my_previous_video.mp4",
"status": 6,
"status_text": "completed",
"created_at": "2024-08-10T15:00:00Z",
"updated_at": "2024-08-10T15:05:00Z"
}
]
}
Get Single Upload Status
Retrieves the status of one specific video by its ID.
GET /uploads/{videoId}
Example Request
GET /api/client/v1/uploads/9c1fa5c4-a8f1-4b2e-9d6e-1c8a0b9e2d7f
Response: 200 OK
{
"data": {
"id": "9c1fa5c4-a8f1-4b2e-9d6e-1c8a0b9e2d7f",
"filename": "my_new_video.mp4",
"status": 6,
"status_text": "completed"
}
}
Status Reference
Status Code | Status Text | Description |
---|---|---|
1 | pending | The upload is queued and waiting to be processed. |
3 | processing | The video is currently being transcoded. |
5 | uploading | The transcoded files are being uploaded to final storage. |
6 | completed | The video is fully processed and ready for playback. |
7 | failed | An error occurred during processing. |