Skip to content

Get a Turbo static entity by ID

GET
/wp-json/wp2lms/turbo/v1/static/{id}
curl --request GET \
--url https://example.com/wp-json/wp2lms/turbo/v1/static/42 \
--header 'X-WP-Nonce: <X-WP-Nonce>'

Editor preview of Turbo HTML for any existing WordPress post: StaticPageRenderer::render after primeFromPost. Path {id} is the post ID (get_post), not a Static Builder build id. This is not the public course front and not a Static Builder package. Missing post — 404 not_found (message «Post not found»). Requires edit_posts. Cookie + X-WP-Nonce or Application Password.

id
required
integer
>= 1

WordPress post ID (WP_Post->ID) that Turbo renders (page, modal, and so on).

Example
42

Document html, assets (styles/scripts/headScripts), and meta (skin, alpine_enabled, warnings, post_id).

Media typeapplication/json
object
html

Full Twig document HTML (static.twig or static-modal.twig).

string
assets

Collected static assets (styles/scripts/headScripts and richer collector fields).

object
key
additional properties
any
meta
object
skin

Active Turbo skin slug (skins()->getActive()->slug), often skin.

string
nullable
alpine_enabled

Function_exists(‘wp2lms’) at render time.

boolean
warnings

StaticAssetCollector warnings (external URLs, and so on).

Array<string>
post_id

Rendered post ID.

integer
Example
{
"html": "<!DOCTYPE html><html lang=\"en\"><body class=\"wp2turbo-static\">…</body></html>",
"assets": {
"styles": [
{
"href": "https://pulse.example.com/wp-content/plugins/wp2lms-turbo-blocks-pulse/assets/build/skin.css",
"path": null,
"type": "style"
}
],
"scripts": [],
"headScripts": []
},
"meta": {
"skin": "skin",
"alpine_enabled": true,
"warnings": [],
"post_id": 42
}
}

Not authenticated. DualRest: rest_forbidden (status 401) when there is no cookie session. Cookie + X-WP-Nonce or Application Password.

Media typeapplication/json
object
code

Machine-readable WP_Error code (for example wp2lms_static_builder_busy, rest_forbidden, invalid_nonce).

string
message

Human-readable error message from PHP / WordPress REST.

string
data

Usually { status: <HTTP code> }. If status is missing, core REST often returns 500.

object
key
additional properties
any
Example
{
"code": "wp2lms_static_builder_busy",
"message": "Build is currently building and cannot be updated.",
"data": {
"status": 409
}
}

Missing edit_posts; invalid REST nonce rest_cookie_invalid_nonce.

Media typeapplication/json
object
code

Machine-readable WP_Error code (for example wp2lms_static_builder_busy, rest_forbidden, invalid_nonce).

string
message

Human-readable error message from PHP / WordPress REST.

string
data

Usually { status: <HTTP code> }. If status is missing, core REST often returns 500.

object
key
additional properties
any
Example
{
"code": "wp2lms_static_builder_busy",
"message": "Build is currently building and cannot be updated.",
"data": {
"status": 409
}
}

Not_found — get_post did not return a WP_Post.

Media typeapplication/json
object
code

Machine-readable WP_Error code (for example wp2lms_static_builder_busy, rest_forbidden, invalid_nonce).

string
message

Human-readable error message from PHP / WordPress REST.

string
data

Usually { status: <HTTP code> }. If status is missing, core REST often returns 500.

object
key
additional properties
any
Example
{
"code": "wp2lms_static_builder_busy",
"message": "Build is currently building and cannot be updated.",
"data": {
"status": 409
}
}