Contents
On this page
Create Video - Plugixa Video
POST /pvx/v1/videos
Add a video, linked to a file, a stream, YouTube or Vimeo, as a draft or published straight away.
Needs a user (signed in with an Application Password or the login cookie) who has the plugixa_video_create capability and the right to edit videos. In the free plugin only administrators hold it; with Pro, editors and the Video Creator role hold it too.
Note. With Pro’s Creators app and review switched on, a Video Creator who asks for
publishorpvx_unlistedgetspendinginstead, and the site administrator is emailed. Uploading a file is not part of this endpoint: pointurlat a file that is already online.
Request
POST https://your-site.example/wp-json/pvx/v1/videos
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
title |
string |
Yes | Must not be blank. |
description |
string |
No | HTML, filtered like post content. Lines such as 04:10 The Golden Circle become chapters when there are at least two. |
status |
string |
No | Defaults to draft. publish, pvx_unlisted (only people with the link can open it), pending, draft or private. future cannot be sent: it follows from a release_date ahead. |
release_date |
string |
No | Publication date in the site’s time zone, YYYY-MM-DDTHH:MM. A date ahead with status publish schedules the video. |
source |
string |
No | hls, mp4 (the default), youtube or vimeo. |
url |
string |
No | The video file, stream or page, http or https. Required to publish: a publish or pvx_unlisted video without one is refused. |
type |
string |
No | video (the default); with Pro also movie or episode. |
poster_id |
integer |
No | Media library id of the poster. Also set as the featured image. |
duration |
integer |
No | Length in seconds. |
access |
string |
No | free (the default) or members; with Pro also paid. |
price |
number |
No | Kept only when access is paid, rounded to 2 decimals; otherwise stored as 0. |
channel_id |
integer |
No | A channel the caller may edit. |
categories |
integer[] |
No | Category ids. Ids that are not categories are dropped. |
tags |
integer[] |
No | Tag ids. Ids that are not tags are dropped. |
comments |
boolean |
No | Open or close comments. Left out on create, the site’s discussion setting applies. |
series_id |
integer |
For episodes | The series of an episode PRO, one the caller may edit. |
season |
integer |
No | Season of an episode, from 1 (the default) PRO. |
episode |
integer |
No | Episode number in its season, from 1 (the default) PRO. |
year |
integer |
No | Release year, up to 9999 PRO. |
age_rating |
string |
No | Free text, cut to 20 characters PRO. |
cast |
string |
No | Free text over several lines PRO. |
trailer |
string |
No | Trailer URL PRO. |
related |
integer[] |
No | Hand-picked related videos, up to 24 ids PRO. |
captions |
object[] |
No | Subtitle tracks, each {lang, label, url, default}; tracks without a URL are dropped and only the first default counts PRO. |
password |
string |
No | Up to 100 characters. A video with a password is published as unlisted PRO. |
The owner is the caller. Fields you do not send take their defaults; fields the plugin does not know are ignored. views and likes cannot be written.
{
"title": "Iceland: The Ring Road",
"status": "publish",
"source": "mp4",
"url": "https://cdn.your-site.example/videos/ring-road.mp4",
"duration": 1460,
"access": "free",
"channel_id": 692,
"categories": [14],
"tags": [31, 32]
}
Responses
201 Created. data is the new video in the back-office shape.
{
"success": true,
"data": {
"id": 838,
"title": "Iceland: The Ring Road",
"excerpt": "A week around Iceland on Route 1, from Reykjavik to the glacier lagoons of the south coast.",
"source": "mp4",
"type": "video",
"poster": "https://your-site.example/wp-content/uploads/2026/11/ring-road-1024x576.jpg",
"poster_srcset": "https://your-site.example/wp-content/uploads/2026/11/ring-road-1024x576.jpg 1024w, https://your-site.example/wp-content/uploads/2026/11/ring-road-300x169.jpg 300w",
"poster_width": 1024,
"poster_height": 576,
"duration": 1460,
"access": "free",
"price": 0.0,
"channel_id": 692,
"channel": "Far Places",
"views": 0,
"likes": 0,
"categories": [14],
"permalink": "https://your-site.example/video/iceland-the-ring-road/",
"date": "2026-11-12T09:30:00+00:00",
"status": "publish",
"coming_soon": false,
"description": "<p>A week around Iceland on Route 1.</p>\n<p>00:00 Reykjavik<br>04:10 The Golden Circle<br>12:30 Jokulsarlon</p>",
"url": "https://cdn.your-site.example/videos/ring-road.mp4",
"poster_id": 1201,
"tags": [31, 32],
"comments": true,
"release_date": "2026-11-12T10:30",
"author": 1,
"modified": "2026-11-12T09:30:00+00:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The video’s id |
data.status |
string |
WordPress status: publish, pvx_unlisted, future, pending, draft or private |
data.url |
string |
The source URL. Only in this back-office shape |
data.release_date |
string |
Publication date in the site’s time zone, YYYY-MM-DDTHH:MM |
data.author |
integer |
The owner’s WordPress user id |
The full shape is described in Get Video.
Errors
| Status | Code | When |
|---|---|---|
422 |
plugixa_video_invalid |
A field is wrong; data.field names it: title blank, unknown source, access, status or type, no url for a published video, channel_id that is not a channel, or an episode without a valid series_id PRO. |
401 / 403 |
plugixa_video_forbidden |
The caller may not create videos, or may not edit the channel in channel_id. |
403 |
plugixa_video_invalid |
The caller may not add episodes to the series in series_id PRO. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/pvx/v1/videos" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"title":"Iceland: The Ring Road","status":"publish","source":"mp4","url":"https://cdn.your-site.example/videos/ring-road.mp4","duration":1460,"access":"free","channel_id":692,"categories":[14],"tags":[31,32]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/pvx/v1/videos');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Iceland: The Ring Road',
'status' => 'publish',
'source' => 'mp4',
'url' => 'https://cdn.your-site.example/videos/ring-road.mp4',
'duration' => 1460,
'access' => 'free',
'channel_id' => 692,
'categories' => [14],
'tags' => [31, 32],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/pvx/v1/videos', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ title: "Iceland: The Ring Road", status: "publish", source: "mp4", url: "https://cdn.your-site.example/videos/ring-road.mp4", duration: 1460, access: "free", channel_id: 692, categories: [14], tags: [31, 32] }),
});
const { data } = await response.json();
Quick Links
Share