All guides
No guide matches your search.
REST API
Build, debug or review WordPress REST routes, including their arguments, authentication, object permissions, responses and pagination.
On this page
When to use it
Use this skill for REST problems such as 401, 403 or 400 responses, nonce or Application Password trouble, a route with no permission_callback, and collections or caching that behave oddly.
It does not cover admin screens. The skill owns the request boundary: routes, authentication, validation, responses and cache behavior.
What it hands off
- Plugin bootstrap, hooks and storage go to
wp-devkit-plugin-development. - The admin screens that call the API go to
wp-devkit-admin-ui-development. - WPGraphQL and decoupled front ends go to
wp-devkit-headless-and-wpgraphql. - Broad exploit analysis goes to
wp-devkit-security-review.
Run a review in Claude
With the plugin loaded, start a read-only review of one bounded target:
/wp-devkit:rest-review <target-path>The shorter /wp-devkit:rest asks for a quick scan instead.
Run a review in Codex, ChatGPT or Antigravity
Name the installed skill and keep the request small. Replace the target with your own files or journey.
$wp-devkit-rest-api-development
Review the target without editing files.
Read the project instructions and the skill's engineering contract first.
Separate confirmed findings from candidates and state the evidence and checks you could not run.The engineering contract is the set of rules every DevKit skill follows. It covers how findings are rated and what counts as evidence.
How a review works
- The agent finds where routes are registered:
register_rest_route, a controller'sregister_routes,register_rest_field, andregister_metawithshow_in_rest. It then follows a request in the order WordPress handles it: authentication, route match, required andvalidate_callbackchecks, sanitization,permission_callback, the handler and the response. This order is confirmed inWP_REST_Server::dispatch()andrespond_to_request(). - It writes down the expected method, object scope, inputs, response shape and error behavior, taken from the existing contract. It does not add a new endpoint to get around a failing one.
- It checks object-level authorization for reads and writes, including every identifier in the payload. A public submission can be valid by design, so for those routes the agent looks at data exposure, side effects and abuse controls instead of asking for a login.
- It checks validation where it really happens. A custom
sanitize_callbackreplaces the automatic schema validation, parameters resolve body first, and the permission callback and the handler must read the same identifier. - It checks responses: which fields are returned, the right
context, aWP_Errorwith astatus, pagination limits and headers, and cache headers for private data. - It describes checks for an anonymous caller, an authorized caller, the wrong owner and malformed input. It sends no requests that change data during a review.
- It rates each concern under the engineering contract. Search matches stay candidates, and the result is
insufficient evidencewhen the authentication model, WordPress version or CDN rules are unknown.
Reference files
The agent starts with the workbook and loads the others only when the task needs them:
rest-api-development-workbook.mdis read first. It helps sort symptoms, shows worked decisions, lists harmless code that looks like a bug, and gives verification recipes.route-registration-and-schema.mdcovers registration rules, controllers, how core validates arguments, schema keywords and type coercion, fields and meta, and versioning.authentication-and-permissions.mdcovers cookie nonces, Application Passwords, the difference between 401 and 403, object checks, public routes, CORS and abuse controls.responses-collections-and-caching.mdcovers errors and status codes, pagination,_fieldsand_embed, caching and CDNs, idempotency and retries.
What you get back
A review opens with the result and the scope it covered. Each confirmed finding gives the file and line, who triggers it, the reachable path, the impact, the confidence, the severity, a minimal fix and a regression check. Candidates and missing evidence come in a separate list.
An implementation lists the contract, the boundaries it changed, each command with its exit status, the checks it could not run and the risk that remains.
Note
Reviews are read-only. A clean review covers the inspected scope and is not a certification. Ask for implementation as a separate, bounded task with a regression check.
Where to go next
Use review to fix for a bounded implementation and Doctor and reports for environment and evidence tooling.
Was this page helpful?