Skip to content

List static builds

GET
/wp-json/wp2lms/static-builder/v1/builds
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.

blog_id
integer
>= 1

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
1

Summaries. Body: blog_id and builds (id, course_name, api_type, status, terminal, date, modified).

Media typeapplication/json
object
blog_id

Site the build list was read from.

integer
builds

Build summaries, newest first. Not full serialize.

Array<object>
object
id

CPT wp2lms_static_build post ID.

integer
course_name

ACF courseName. Empty string if unset.

string
api_type

ACF apiType; if empty PHP substitutes local.

string
status

Current BuildStatus->value: new, pending, building, completed, error, stopped, rebuild, build, stopping.

string
terminal

True when status is completed, error, or stopped.

boolean
is_primary

Favourite build for the course (meta ssb_is_primary).

boolean
date

Post created-at in ISO 8601 GMT (get_post_time('c', true)). null if WP returned no time.

string
nullable
modified

Post modified-at in ISO 8601 GMT (get_post_modified_time('c', true)). null if WP returned no time.

string
nullable
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.

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 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 manage_network (multisite) or edit_pages (single site); 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
}
}

Wp2lms_static_builder_blog_not_found — site does not exist or belongs to another network.

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
}
}