Skip to content

Apply document body (optimistic base_hash)

PATCH
/wp-json/wp2/studio-sync/v1/sync/posts/{post_id}
curl --request PATCH \
--url https://example.com/wp-json/wp2/studio-sync/v1/sync/posts/1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "base_hash": "example", "content": "example" }'

Writes content with optimistic locking: base_hash (the hash the client last saw) and content are required. On hash mismatch returns 409 and does not change WordPress. WP EDITABLE also accepts PUT/POST.

post_id
required
integer

WordPress post ID.

Media typeapplication/json
object
base_hash
required

Document hash the client last saw (optimistic lock).

string
content
required

Document body (Gutenberg HTML, Studio, validate).

string
Example
{
"base_hash": "example",
"content": "example"
}

OK

Media typeapplication/json
object
success

Success flag (often Studio/License envelope).

boolean
hash

Document content hash.

string
Examplegenerated
{
"success": true,
"hash": "example"
}

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 / studio_sync_connection_revoked

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": {}
}

Conflict

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": {}
}

Validation errors

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": {}
}