Overview
The VoD (Video on Demand) API allows you to upload, import, list, and delete video files. All VoD endpoints are prefixed with/v2/vods.
Get VoD File
Retrieve a VoD file record from the database.GET /v2/vods/{id}
string
required
VoD file ID
string
Unique VoD identifier
string
Display name of the VoD file
string
Associated stream ID (for recorded streams)
string
Relative path to the file
integer
Duration in milliseconds
integer
File size in bytes
integer
Creation timestamp
string
VoD type:
userVod, streamVodList VoD Files
Get paginated list of VoD files with optional filtering and sorting.GET /v2/vods/list/{offset}/{size}
integer
required
Pagination offset (starting point)
integer
required
Number of items to fetch (max: 50)
string
Sort field:
name or datestring
Sort order:
asc (ascending) or desc (descending)string
Filter by associated stream ID
string
Search string to filter VoD files
Get VoD Count
Get total number of VoD files.GET /v2/vods/count
integer
Total number of VoD files in database
Get VoD Count (Filtered)
Get number of VoD files matching search criteria.GET /v2/vods/count/{search}
string
required
Search string to filter VoD files
integer
Number of VoD files matching search criteria
Upload VoD File
Upload an external VoD file to Ant Media Server.POST /v2/vods/create
string
required
Display name for the VoD file
mp4, webm, mov, avi, mp3, wmv
boolean
Whether upload was successful
string
Generated VoD ID
string
Error message or VoD ID
If
vodUploadFinishScript is configured in AppSettings, the uploaded file will be queued for processing. The VoD status will be:inqueue- Waiting for processingprocessing- Currently being processedfinished- Processing completed successfullyfailed- Processing failed
Delete VoD File
Delete a specific VoD file from database and storage.DELETE /v2/vods/{id}
string
required
VoD ID to delete
boolean
Whether deletion was successful
string
Result message
Delete Multiple VoD Files
Delete multiple VoD files in bulk.DELETE
string
required
Comma-separated VoD IDs to delete
boolean
Whether all deletions were successful
string
Result message (includes failed ID if operation stopped)
Import VoD Files from Directory
Import VoD files from a directory and make them streamable.POST /v2/vods/directory
string
required
Full path of the directory containing VoD files to import
boolean
Whether import was successful
string
Result message
This operation:
- Scans the specified directory for video files
- Creates database records for each file
- Creates symbolic links to make files accessible via HTTP
- Does NOT copy or move the original files
Unlink VoD Files from Directory
Delete database records for VoD files without deleting the actual files.DELETE /v2/vods/directory
string
required
Full path of the directory to unlink VoD files from
boolean
Whether unlink was successful
string
Result message
This operation:
- Removes database records for VoD files in the directory
- Removes symbolic links
- Does NOT delete the actual video files
Import VoDs to Stalker Portal
Import VoD files to Stalker middleware portal.POST /v2/vods/import-to-stalker
boolean
Whether import was successful
string
Error message if failed
integer
Error code:
404- Stalker DB info missing500- No VoD folder specified
Requires Stalker portal database configuration in AppSettings:
stalkerDBServerstalkerDBUsernamestalkerDBPasswordvodFolder
VoD Upload Processing
When a VoD file is uploaded, you can configure a post-processing script via thevodUploadFinishScript setting in AppSettings.
Process Status Values
null- No processing configuredinqueue- Queued for processingprocessing- Currently being processedfinished- Processing completed successfullyfailed- Processing failed
Example Processing Script
VoD File Streaming
Once imported or uploaded, VoD files can be streamed via: HLS:filePath in the VoD object contains the relative path needed for streaming.