List static builds
const url = 'https://example.com/wp-json/wp2lms/static-builder/v1/builds?blog_id=1';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/static-builder/v1/builds?blog_id=1' \ --header 'X-WP-Nonce: <X-WP-Nonce>'Lists CPT wp2lms_static_build posts on the selected site (publish, draft, private), newest first (orderby=date DESC). PHP: BuildService::listBuilds() returns a short summarize payload, not full serialize: no config, page_ids, logs, or package URLs.
This does not create a build or start generation. A post that throws from the StaticBuild constructor is skipped.
Query blog_id is optional: default current blog. Requires manage_network or edit_pages. Cookie + X-WP-Nonce or Application Password.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Multisite site ID to read/write builds on. Optional: PHP uses get_current_blog_id(). ≤ 0 — 400 invalid_blog. Missing or foreign-network site — 404 blog_not_found. Usually omitted on a single site.
Example
1Responses
Section titled “Responses”Summaries. Body: blog_id and builds (id, course_name, api_type, status, terminal, date, modified).
object
Site the build list was read from.
Build summaries, newest first. Not full serialize.
object
CPT wp2lms_static_build post ID.
ACF courseName. Empty string if unset.
ACF apiType; if empty PHP substitutes local.
Current BuildStatus->value: new, pending, building, completed, error, stopped, rebuild, build, stopping.
True when status is completed, error, or stopped.
Favourite build for the course (meta ssb_is_primary).
Post created-at in ISO 8601 GMT (get_post_time('c', true)). null if WP returned no time.
Post modified-at in ISO 8601 GMT (get_post_modified_time('c', true)). null if WP returned no time.
Example
{ "blog_id": 1, "builds": [ { "id": 128, "course_name": "Information Security Basics", "api_type": "scorm", "status": "completed", "terminal": true, "date": "2026-09-13T10:15:00+00:00", "modified": "2026-09-13T11:02:00+00:00" } ]}Wp2lms_static_builder_invalid_blog — blog_id ≤ 0.
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 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 manage_network (multisite) or edit_pages (single site); 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 }}Wp2lms_static_builder_blog_not_found — site does not exist or belongs to another network.
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 }}