Call any REST endpoint
rest_apiCall any WordPress REST endpoint directly, including plugin routes like WooCommerce, to access functionality beyond dedicated tools. Use discover_rest_routes first to validate routes and avoid rest_no_route errors.
Instructions
Call any WordPress REST endpoint directly — the escape hatch for anything the dedicated tools do not cover, including routes registered by plugins such as WooCommerce, Yoast or ACF. Use discover_rest_routes first to find valid routes rather than guessing: an invented route returns rest_no_route and tells you nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | JSON request body for write methods. | |
| query | No | Query string parameters. | |
| route | Yes | Route including its namespace, e.g. "/wc/v3/orders" or "/wp/v2/posts/12". | |
| method | No | HTTP method. Anything other than GET counts as a write and needs a writable site. | GET |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. | |
| max_chars | No | Truncate the response at this many characters. |