Skip to content

Generate thumbnails / poster frames

POST
/wp-json/wp2/media-converter/v1/attachments/{id}/thumbnails
curl --request POST \
--url https://example.com/wp-json/wp2/media-converter/v1/attachments/1/thumbnails \
--header 'Content-Type: application/json' \
--header 'X-WP-Nonce: <X-WP-Nonce>' \
--data '{ "action": "generate", "number": 4, "timecode": "example", "set_featured": true }'

Generates thumbnails or poster frames from the video.

id
required
integer

Numeric entity id.

Media typeapplication/json
object
action

Command (site bulk, or queue play/pause).

string
Allowed values: generate
number

Ordinal number.

integer
default: 4
timecode

Timecode / chapter mark.

string
set_featured

Set the uploaded file as the post thumbnail.

boolean
Example
{
"action": "generate",
"number": 4,
"timecode": "example",
"set_featured": true
}
Media typeapplication/json
object
attachment_id

Media library attachment ID.

integer
poster

Current attachment poster.

object
attachment_id

Poster attachment ID, or null.

integer
nullable
url

Poster URL, or null.

string
nullable
featured_id

Field “featured_id” as returned or accepted by PHP.

integer
nullable
thumbnails

Generated child thumbnails.

Array<object>
object
attachment_id

Thumbnail attachment ID.

integer
url

Thumbnail URL.

string
Examplegenerated
{
"attachment_id": 1,
"poster": {
"attachment_id": 1,
"url": "example"
},
"featured_id": 1,
"thumbnails": [
{
"attachment_id": 1,
"url": "example"
}
]
}

Not authenticated. WordPress REST: rest_not_logged_in / rest_forbidden. Use cookie + X-WP-Nonce or Application Password.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}

Insufficient capability or invalid REST nonce. WordPress REST: rest_forbidden / rest_cookie_invalid_nonce.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}