List Local Sync projects (uploads)
const url = 'https://example.com/wp-json/wp2/local-sync/v1/projects';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/wp2/local-sync/v1/projects \ --header 'X-WP-Nonce: <X-WP-Nonce>'Sites available for Local Sync: uploads path, HTML page and knowledge file counts, section folders. On multisite this covers the network. Requires manage_network (MS) or edit_pages.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Projects
object
Local Sync project list.
object
Network site ID. Optional on a single site.
Human-readable name.
URL.
Field “sync_path” as returned or accepted by PHP.
Field “is_main” as returned or accepted by PHP.
Field “pages_files” as returned or accepted by PHP.
Field “knowledge_files” as returned or accepted by PHP.
Course Manager items.
object
Title.
Numeric entity id.
Slug (site, post, or section).
Examplegenerated
{ "projects": [ { "blog_id": 1, "name": "example", "url": "example", "sync_path": "example", "is_main": true, "pages_files": 1, "knowledge_files": 1, "sections": [ { "title": "example", "id": 1, "slug": "example" } ] } ]}Not authenticated. WordPress REST: rest_not_logged_in / rest_forbidden. Use cookie + X-WP-Nonce or Application Password.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
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.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}