Guide

Revisions REST API

Custom routes under prc-revisions/v1. Source: includes/class-rest-api.php.

Base path: /wp-json/prc-revisions/v1/

Auth summary

AccessRoutes
PublicGET /public-revisions/{post_id}
edit_postToggle, fork create, fork-info
edit_post + delete_post on forkDiscard fork (DELETE)

Route index

MethodPathDescription
GET/public-revisions/{post_id}Public versions (letter, date, author, URL, orphaned)
POST/toggle/{post_id}/{revision_id}Toggle public; { action, version, url }
POST/fork/{post_id}Create fork draft; 409 if active fork exists
DELETE/fork/{post_id}Trash pending fork (parent or fork ID)
GET/fork-info/{post_id}Role parent / fork / none and related IDs
Request POST /wp-json/prc-revisions/v1/toggle/42/789
HeadersKey: value
X-WP-Nonce {nonce}Content-Type application/json
Response 200 OK
BodyJSON
{
  "action": "added",
  "version": "a",
  "url": "https://example.org/my-post/version/a"
}

Was this helpful?