Branches and versions
A branch is a workspace in the API. Drafts and versions share the /versions/:id routes.
| Route | What it does |
|---|---|
GET /documents/:id/workspaces | A document's branches |
POST /documents/:id/workspaces | Branch: { name, fromVersionId, description? } |
GET /workspaces/:id, PATCH /workspaces/:id | Read, rename |
POST /workspaces/:id/archive, /unarchive, DELETE /workspaces/:id | Archive, bring back, delete one without versions of its own |
POST /workspaces/:id/versions | Make a version of the draft: { name?, comment? } |
POST /workspaces/:id/take-over | Bring a version into this draft: { versionId, force? }. 409 lists what would be lost unless force |
POST /workspaces/:id/restore | Put a version back into this draft: { versionId } |
POST /workspaces/:id/checkout, /checkin, /checkout/heartbeat | Reserve, give back, keep reserved |
GET /versions/:id, PATCH /versions/:id | A draft or version; name and comment |
POST /versions/:id/release | Release: { comment? }. Answers with the revision |
GET /documents/:id/revisions, GET /revisions/:id, PATCH /revisions/:id | Revisions and their comment |
POST /revisions/:id/obsolete | Make it obsolete |
DELETE /revisions/:id | Take a release back (administrators) |
GET /documents/:id/version-graph | Everything the history graph draws |
GET /versions/:id/audit, GET /revisions/:id/audit | Their audit log |