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}
VoD file ID
Unique VoD identifier
Display name of the VoD file
Associated stream ID (for recorded streams)
Relative path to the file
Duration in milliseconds
File size in bytes
Creation timestamp
VoD type:
userVod, streamVodList VoD Files
Get paginated list of VoD files with optional filtering and sorting.GET /v2/vods/list/{offset}/{size}
Pagination offset (starting point)
Number of items to fetch (max: 50)
Sort field:
name or dateSort order:
asc (ascending) or desc (descending)Filter by associated stream ID
Search string to filter VoD files
Get VoD Count
Get total number of VoD files.GET /v2/vods/count
Total number of VoD files in database
Get VoD Count (Filtered)
Get number of VoD files matching search criteria.GET /v2/vods/count/{search}
Search string to filter VoD files
Number of VoD files matching search criteria
Upload VoD File
Upload an external VoD file to Ant Media Server.POST /v2/vods/create
Display name for the VoD file
mp4, webm, mov, avi, mp3, wmv
Whether upload was successful
Generated VoD ID
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}
VoD ID to delete
Whether deletion was successful
Result message
Delete Multiple VoD Files
Delete multiple VoD files in bulk.DELETE
Comma-separated VoD IDs to delete
Whether all deletions were successful
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
Full path of the directory containing VoD files to import
Whether import was successful
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
Full path of the directory to unlink VoD files from
Whether unlink was successful
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
Whether import was successful
Error message if failed
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.