Get a Turbo static entity by ID
const url = 'https://example.com/wp-json/wp2lms/turbo/v1/static/42';const options = {method: 'GET', headers: {'X-WP-Nonce': '<X-WP-Nonce>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”WordPress post ID (WP_Post->ID) that Turbo renders (page, modal, and so on).
Example
42Responses
Section titled “Responses”Document html, assets (styles/scripts/headScripts), and meta (skin, alpine_enabled, warnings, post_id).
object
Full Twig document HTML (static.twig or static-modal.twig).
Collected static assets (styles/scripts/headScripts and richer collector fields).
object
object
Active Turbo skin slug (skins()->getActive()->slug), often skin.
Function_exists(‘wp2lms’) at render time.
StaticAssetCollector warnings (external URLs, and so on).
Rendered post ID.
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.
object
Machine-readable WP_Error code (for example wp2lms_static_builder_busy, rest_forbidden, invalid_nonce).
Human-readable error message from PHP / WordPress REST.
Usually { status: <HTTP code> }. If status is missing, core REST often returns 500.
object
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.
object
Machine-readable WP_Error code (for example wp2lms_static_builder_busy, rest_forbidden, invalid_nonce).
Human-readable error message from PHP / WordPress REST.
Usually { status: <HTTP code> }. If status is missing, core REST often returns 500.
object
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.
object
Machine-readable WP_Error code (for example wp2lms_static_builder_busy, rest_forbidden, invalid_nonce).
Human-readable error message from PHP / WordPress REST.
Usually { status: <HTTP code> }. If status is missing, core REST often returns 500.
object
Example
{ "code": "wp2lms_static_builder_busy", "message": "Build is currently building and cannot be updated.", "data": { "status": 409 }}