Reference
REST API routes
Reference, generated from the plugin source
Every REST route GCB registers, read from its register_rest_route() calls. Methods come from the methods key (WP_REST_Server::READABLE is GET, CREATABLE is POST, DELETABLE is DELETE); access comes from each route's permission_callback.
| Method | Route | Access | Source |
|---|---|---|---|
| GET | /wp-json/gcblite/v1/icons | Needs edit_posts | Icons/IconSources.php:123 |
| POST | /wp-json/gcblite/v1/icons | Needs manage_options | Icons/SiteIcons.php:252 |
| GET | /wp-json/gcblite/v1/options/{slug} | Public | Options/Registrar.php:288 |
| GET | /wp-json/gcblite/v1/blocks | Public | RestAPI/BlocksAPI.php:36 |
| GET | /wp-json/gcblite/v1/builder/blocks | Needs edit_posts | RestAPI/BuilderAPI.php:59 |
| POST | /wp-json/gcblite/v1/builder/blocks | Needs edit_themes | RestAPI/BuilderAPI.php:59 |
| DELETE | /wp-json/gcblite/v1/builder/blocks/{slug} | Needs edit_themes | RestAPI/BuilderAPI.php:74 |
| GET | /wp-json/gcblite/v1/builder/control-docs/{type} | Needs edit_posts | RestAPI/BuilderAPI.php:86 |
| GET | /wp-json/gcblite/v1/builder/blocks/{slug}/fields | Needs edit_posts | RestAPI/BuilderAPI.php:95 |
| POST | /wp-json/gcblite/v1/builder/blocks/{slug}/fields | Needs edit_themes | RestAPI/BuilderAPI.php:95 |
| GET | /wp-json/gcblite/v1/builder/structured-fields | Needs edit_posts | RestAPI/BuilderAPI.php:118 |
| GET | /wp-json/gcblite/v1/builder/structured-fields/{kind}[/{id}] | Needs edit_posts | RestAPI/BuilderAPI.php:124 |
| POST | /wp-json/gcblite/v1/builder/structured-fields/{kind}[/{id}] | Needs edit_themes | RestAPI/BuilderAPI.php:124 |
| GET | /wp-json/gcblite/v1/builder/tokens | Needs edit_posts | RestAPI/BuilderAPI.php:143 |
| POST | /wp-json/gcblite/v1/builder/tokens/custom | Needs edit_themes | RestAPI/BuilderAPI.php:149 |
| GET | /wp-json/gcblite/v1/builder/post-types | Needs edit_posts | RestAPI/BuilderAPI.php:162 |
| POST | /wp-json/gcblite/v1/builder/post-types | Needs edit_themes | RestAPI/BuilderAPI.php:162 |
| POST | /wp-json/gcblite/v1/preview | Needs edit_posts | RestAPI/PreviewAPI.php:26 |
| GET | /wp-json/gcblite/v1/query | Public | RestAPI/QueryLoopAPI.php:34 |
| POST | /wp-json/gcblite/v1/render | Public | RestAPI/RenderAPI.php:66 |
| POST | /wp-json/gcblite/v1/render-batch | Public | RestAPI/RenderAPI.php:72 |
| POST | /wp-json/gcblite/v1/validation-state | Needs edit_posts | RestAPI/ValidationAPI.php:58 |
| GET | /wp-json/gcblite/v1/terms/{taxonomy}/{term_id}/fields | Public | Taxonomy/Registrar.php:201 |
| GET | /wp-json/gcblite/v1/users/{user_id}/fields | Public | User/Registrar.php:308 |
Source paths are under the plugin's includes/ folder.
Notes from the code
GET, POST /wp-json/gcblite/v1/icons
GET gcblite/v1/icons?search=arrow&limit=120 or ?names[]=tabler/bolt — for anyone who can edit.
Registered by more than one file (includes/Icons/IconSources.php, includes/Icons/SiteIcons.php); the later registration wins for the same method.
GET /wp-json/gcblite/v1/options/{slug}
GET /wp-json/gcblite/v1/options/{slug}
GET /wp-json/gcblite/v1/blocks
GET, POST /wp-json/gcblite/v1/builder/blocks
DELETE /wp-json/gcblite/v1/builder/blocks/{slug}
DELETE /builder/blocks/{slug} — remove a block (its whole dir) from the active theme. Theme blocks only; plugin-example blocks are never deletable.
Arguments: slug.
GET /wp-json/gcblite/v1/builder/control-docs/{type}
Per-control docs — read from the same schemas/controls/{type}.md files the docs site reads. Drives the right-pane help panel in the Edit Fields view.
Arguments: type.
GET, POST /wp-json/gcblite/v1/builder/blocks/{slug}/fields
Arguments: slug.
GET /wp-json/gcblite/v1/builder/structured-fields
Structured fields — JSON schemas autoloaded by StructuredFields\Autoloader. List endpoint enumerates all four kinds; per-item read/write endpoints mirror the block-fields shape so the React side can reuse the EditFields view.
GET, POST /wp-json/gcblite/v1/builder/structured-fields/{kind}[/{id}]
GET /wp-json/gcblite/v1/builder/tokens
Design tokens — read the live theme.json token tree for the field token-picker, and (write) append a custom token to the theme.
POST /wp-json/gcblite/v1/builder/tokens/custom
Arguments: category, slug, value, name.
GET, POST /wp-json/gcblite/v1/builder/post-types
Custom post types — config-driven (PostTypes\PostTypeRegistrar).
Arguments: config.
POST /wp-json/gcblite/v1/preview
Arguments: blockName, attributes, default.
GET /wp-json/gcblite/v1/query
Arguments: blockName, page.
POST /wp-json/gcblite/v1/render
Both routes are public-readable by design. They only render gcb/* blocks already registered on the site — content the site has chosen to publish. The render output is the same HTML a visitor would see embedded in a public page, so gating these would just force the headless front-end to ship a service- account password. SSRF mitigation (matters to plugin reviewers): these endpoints can proxy to a configurable frontend URL via wp_remote_get(), but the URL is ONLY settable via: - GCBLITE_COMPONENT_SERVER_URL defined in wp-config.php, OR - the gcblite_frontend_url PHP filter It is NOT stored in any WordPress option or settable via REST. An attacker therefore cannot retarget the proxy without filesystem access. The destination's response is also extracted through a strict <wp-block-wrapper> regex (HtmlExtractor) that drops any non-component markup — there is no arbitrary HTML pass-through.
POST /wp-json/gcblite/v1/render-batch
POST /wp-json/gcblite/v1/validation-state
Arguments: post_id, has_errors, errors.
GET /wp-json/gcblite/v1/terms/{taxonomy}/{term_id}/fields
GET /wp-json/gcblite/v1/terms/{taxonomy}/{term_id}/fields
GET /wp-json/gcblite/v1/users/{user_id}/fields
GET /wp-json/gcblite/v1/users/{user_id}/fields
Fields added to WordPress's own routes
blocks_raw
Exposes a post's raw block markup (the source with block comments) as a public REST field on pages and posts.
Added with register_rest_field() to the post-type routes under /wp-json/wp/v2/. Source: includes/RestAPI/RawBlocksField.php.