---
title: "get_rest_route_schema — AI Ability"
description: "Read a REST route's argument contract on this site — every argument with its type and whether it is required."
url: "https://wpwebhooks.org/docs/ability-get-rest-route-schema/"
---

[WP Webhooks](https://wpwebhooks.org/) / [Docs](https://wpwebhooks.org/docs/) / get\_rest\_route\_schema

AI Ability since v2.2.0

# get\_rest\_route\_schema

Read a REST route's argument contract on this site — every argument with its type and whether it is required.

Describe a REST API route on THIS site (core or any plugin) from its self-declared schema: every argument with its type, description and whether it is REQUIRED. Build with AI runs this before building an internal automation — a webhook whose endpoint points at your own `wp-json` — so required fields (e.g. `POST /wp/v2/users` needs username, email AND password, which field mapping alone cannot always supply) are satisfied with a Code Glue snippet, or called out honestly, instead of guessed. Internal routes only — it cannot describe external APIs. Registered as the WordPress Ability `flowsystems-webhook-actions/get_rest_route_schema`, so external AI tools (Claude Code, Cursor) can call it over MCP or REST with a scoped API token.

/ Plan step shape

```
{ "ability": "get_rest_route_schema", "input": { "route": …, "method": … } }
```

/ Scope & confirmation

Minimum API-token scope for external (MCP/REST) callers: `read`. Read-only — the agent runs it freely while planning.

/ Input fields

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| route | param | string | yes | Route path relative to /wp-json, e.g. "/wp/v2/users". A full URL to this site's REST API is also accepted. |
| method | param | string | — | HTTP method you plan to use — GET, POST (default), PUT, PATCH or DELETE. |

/ Examples

Plan step as Build with AI proposes it

```
{
  "id": "step_1",
  "ability": "get_rest_route_schema",
  "summary": "…",
  "input": {
    "route": "/wp/v2/users",
    "method": "POST"
  }
}
```

/ Related

[get\_trigger\_schema](https://wpwebhooks.org/docs/ability-get-trigger-schema/)[create\_snippet](https://wpwebhooks.org/docs/ability-create-snippet/)[Build with AI](https://wpwebhooks.org/docs/build-with-ai/)[REST API reference](https://wpwebhooks.org/webhook-wordpress-plugin-api/)

/Ready

## Your next automation is  
one sentence away.

[Install Plugin→](https://wordpress.org/plugins/flowsystems-webhook-actions/) [See the Plugin →](https://wpwebhooks.org/wordpress-webhook-plugin/)

$ wp plugin install flowsystems-webhook-actions --activate

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"get_rest_route_schema — AI Ability — Webhook Actions Docs","description":"Read a REST route's argument contract on this site — every argument with its type and whether it is required.","url":"https://wpwebhooks.org/docs/ability-get-rest-route-schema/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
