All paths are relative to $BASE, the v2 base URL — on the staging network https://stagepress.bond/api/v2, see Quickstart . Every call except GET /health needs Authorization: Bearer $OP_TOKEN, see Authentication . The site is chosen by blog_id in the body or query, the X-OnPress-Blog-Id header or domain; without any of them it is the main site of the network. Errors share one shape, see Errors .
{ref} of a page is an id, a slug or a path with ~ instead of /; {ref} of a frame is its id or slug; {ref} of a menu is its id, slug, name or @location.
Health
Method Path What it does Details GET /healththe service is up and reaches the database: {"ok": true, "db": true}, 503 without the database; no token needed Quickstart
Pages
Method Path What it does Details POST /pages/markdowncreate or update a page from markdown with frontmatter Pages and markdown POST /pages/languagegive pages their Polylang language: listed ones or every page without one Pages and markdown
Translations
Method Path What it does Details GET /pages/{ref}/translationsthe page’s translation group Translations PUT /pages/{ref}/translationswrite the whole group Translations POST /pages/{ref}/translations/{lang}add one translation to the group Translations DELETE /pages/{ref}/translationstake the page out of its group Translations
Method Path What it does Details GET /docs/sidebarthe whole documentation tree Docs sidebar PUT /docs/sidebarput a ready tree in one call Docs sidebar POST /docs/sidebar/reorderorder within one branch Docs sidebar PATCH /docs/sidebar/items/{ref}one item: label, status, parent, position Docs sidebar POST /docs/sidebar/items/{ref}/hidetake the item out of the menu Docs sidebar POST /docs/sidebar/items/{ref}/showput it back Docs sidebar
Frames
Method Path What it does Details GET /framesthe site’s frames without markup; ?block=, ?q=, ?include_html=1 Frames POST /framesupload a new frame; dry_run checks without writing Frames GET /frames/{ref}one frame with its markup Frames PUT /frames/{ref}replace the markup Frames PATCH /frames/{ref}change fields without the markup; a new slug rewrites every op/frame reference Frames DELETE /frames/{ref}delete the frame and every binding to it Frames POST /frames/{ref}/assignprint a page in this frame Frames POST /frames/rebakebake again the copies that depend on a named change How it works any /frames/defaults, /frames/{ref}/defaultremoved: 410 gone; frames link with op/frame Frames
A frame has no address: url in the body of POST, PUT or PATCH /frames is 400 frame_url_not_supported. Addresses belong to pages, and a landing is a page with a shell frame — see Frames .
Data
Method Path What it does Details GET /datathe site’s datasets Data GET /data/sourcessystem sources, read-only Data GET /data/{name}read a source or a dataset Data PUT /data/{name}write a dataset whole Data PATCH /data/{name}item operations on a dataset Data DELETE /data/{name}delete a dataset Data POST /data/resolveresolve a source exactly as the printer will Data
Site CSS
Method Path What it does Details GET /site/cssthe site’s custom CSS and its record Styles PUT /site/cssreplace the CSS whole Styles POST /site/cssthe same as PUT Styles DELETE /site/cssremove the CSS, back to the theme Styles
Design tokens
Method Path What it does Details GET /site/designevery token with its value, default and source Styles PATCH /site/designset individual tokens Styles DELETE /site/designback to the theme defaults Styles
Method Path What it does Details GET /menusmenus and where they are assigned Menus POST /menuscreate a menu, optionally assign and fill it Menus PATCH /menus/{ref}rename, change the slug Menus DELETE /menus/{ref}delete the menu and free its locations Menus PUT /menus/{ref}/locationput the menu into a theme location, optionally per language Menus PUT /menus/{ref}/itemsreplace the whole item tree Menus POST /menus/{ref}/itemsadd one item Menus PATCH /menus/{ref}/items/{id}change one item Menus DELETE /menus/{ref}/items/{id}delete an item with its branch Menus POST /menus/{ref}/reorderrenumber one level Menus
Menu contents are read through the menu.* data sources, not here.
Sites and settings
Method Path What it does Details POST /sitesa new site cloned from a donor, optionally emptied; network super admin Sites and settings GET /sites/{id}a site card: domain, visibility, theme, front page, languages, counts Sites and settings GET /site/settingstitle, tagline, indexing, icon, analytics Sites and settings PATCH /site/settingschange those settings; site administrator Sites and settings PUT /site/front-pageset the static front page Sites and settings POST /site/cache/flushdrop transients, page cache, object cache, Polylang caches Sites and settings
Method Path What it does Details POST /mediaupload an image by URL or as base64; idempotent Media GET /mediafind an upload by ?source_url= or ?sha256= Media GET /media/{id}describe an attachment Media
Not in v2
v2 does not read pages: listing pages and exporting one as markdown are v1, /wp-json/onpress/v1/, which accepts the same op_ token. Apps, analytics reports and mail are v1 as well.