Sites visible through connection
GET
/wp-json/wp2/studio-sync/v1/sites
const url = 'https://example.com/wp-json/wp2/studio-sync/v1/sites';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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/studio-sync/v1/sites \ --header 'Authorization: Bearer <token>'Sites this Studio Sync connection is allowed to see (network or single site, depending on token mode).
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”OK
Media typeapplication/json
object
success
Success flag (often Studio/License envelope).
boolean
connection_id
Studio Sync connection id.
string
mode
Mode (connection, replace, or pack).
string
sites
List of sites.
array
count
Count.
integer
Examplegenerated
{ "success": true, "connection_id": "example", "mode": "example", "sites": [ "example" ], "count": 1}Studio_sync_missing_auth / studio_sync_invalid_token
Media typeapplication/json
object
code
Machine-readable error or event code.
string
message
Message text (log, PIN, or password reset).
string
data
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Studio_sync_insufficient_permissions
Media typeapplication/json
object
code
Machine-readable error or event code.
string
message
Message text (log, PIN, or password reset).
string
data
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}