We need a public API end point integrating with the general MediaWiki API that provides at least the following functionality:
- HTML DOM retrieval per page and revision. Basically the /en/Foo?oldid=<n> end point.
- HTML DOM expansion: POST a DOM (or fragment), return re-expanded DOM
- HTML DOM saving: POST a modified DOM and a summary, and save it as a new revision.
As long as we are using Wikitext as our storage format, saving requires a conversion to HTML and a separate save step. The individual steps should *internally* be exposed to other users including the VisualEditor extension. There is probably no need to expose the HTML2WT conversion. We should instead aim to provide an HTML-only public interface.
The integration should use an URL schema that makes it easy to map some or all of the functionality to a stand-alone (non-PHP) backend to avoid PHP startup costs in the future.