WP Routes (Out of the Box)

This section contains a reference for the REST API in WordPress - these are the basic routes that WordPress supports out of the box. Here you can find information about the endpoints available through the API, their parameters, response format, etc.

List of Basic WP 7.1 Routes

Resource Route (URL)
Posts (posts) /wp-json/wp/v2/posts
Pages (pages) /wp-json/wp/v2/pages
Media (media) /wp-json/wp/v2/media
Post Types (types) /wp-json/wp/v2/types
Custom Post Type /wp-json/wp/v2/{post_type}
Autosaves /wp-json/wp/v2/{type}/{parent}/autosaves
Revisions /wp-json/wp/v2/{type}/{parent}/revisions
Post Statuses /wp-json/wp/v2/statuses
Comments /wp-json/wp/v2/comments
Taxonomies /wp-json/wp/v2/taxonomies
Categories /wp-json/wp/v2/categories
Tags /wp-json/wp/v2/tags
Custom Term /wp-json/wp/v2/{taxonomy}
Users /wp-json/wp/v2/users
Application Passwords /wp-json/wp/v2/users/{user_id}/application-passwords
Settings /wp-json/wp/v2/settings
Themes /wp-json/wp/v2/themes
Plugins /wp-json/wp/v2/plugins
Search /wp-json/wp/v2/search
Blocks /wp-json/wp/v2/blocks
Block Renderer /wp-json/wp/v2/block-renderer/{name}
Block Types /wp-json/wp/v2/block-types
Block Patterns /wp-json/wp/v2/block-patterns/patterns
Block Pattern Categories /wp-json/wp/v2/block-patterns/categories
Pattern Directory Items /wp-json/wp/v2/pattern-directory/patterns
Block Directory Items /wp-json/wp/v2/block-directory/search
Global Styles /wp-json/wp/v2/global-styles
Templates /wp-json/wp/v2/templates
Template Parts /wp-json/wp/v2/template-parts
Fonts /wp-json/wp/v2/font-families
Icons /wp-json/wp/v2/icons
View Configuration /wp-json/wp/v2/view-config
Navigation /wp-json/wp/v2/navigation
Menus /wp-json/wp/v2/menus
Menu Items /wp-json/wp/v2/menu-items
Menu Locations /wp-json/wp/v2/menu-locations
Navigation Fallback /wp-json/wp-block-editor/v1/navigation-fallback
Widgets /wp-json/wp/v2/widgets
Widget Types /wp-json/wp/v2/widget-types
Sidebars /wp-json/wp/v2/sidebars
Abilities API /wp-json/wp-abilities/v1/abilities
Site Health /wp-json/wp-site-health/v1
URL Details /wp-json/wp-block-editor/v1/url-details
Site Editor Export /wp-json/wp-block-editor/v1/export
Batch /wp-json/batch/v1

All WP 7.1 Routes

/
/batch/v1
/oembed/1.0
/oembed/1.0/embed
/oembed/1.0/proxy
/wp/v2
/wp/v2/posts
/wp/v2/posts/(?P<id>[\\d]+)
/wp/v2/posts/(?P<parent>[\\d]+)/revisions
/wp/v2/posts/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)
/wp/v2/posts/(?P<id>[\\d]+)/autosaves
/wp/v2/posts/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)
/wp/v2/pages
/wp/v2/pages/(?P<id>[\\d]+)
/wp/v2/pages/(?P<parent>[\\d]+)/revisions
/wp/v2/pages/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)
/wp/v2/pages/(?P<id>[\\d]+)/autosaves
/wp/v2/pages/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)
/wp/v2/media
/wp/v2/media/(?P<id>[\\d]+)
/wp/v2/media/(?P<id>[\\d]+)/post-process
/wp/v2/media/(?P<id>[\\d]+)/edit
/wp/v2/menu-items
/wp/v2/menu-items/(?P<id>[\\d]+)
/wp/v2/menu-items/(?P<id>[\\d]+)/autosaves
/wp/v2/menu-items/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)
/wp/v2/blocks
/wp/v2/blocks/(?P<id>[\\d]+)
/wp/v2/blocks/(?P<parent>[\\d]+)/revisions
/wp/v2/blocks/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)
/wp/v2/blocks/(?P<id>[\\d]+)/autosaves
/wp/v2/blocks/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)
/wp/v2/templates
/wp/v2/templates/(?P<id>([^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)[\\/\\w-]+)
/wp/v2/templates/(?P<parent>[\\d]+)/revisions
/wp/v2/templates/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)
/wp/v2/templates/(?P<id>[\\d]+)/autosaves
/wp/v2/templates/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)
/wp/v2/template-parts
/wp/v2/template-parts/(?P<id>([^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)[\\/\\w-]+)
/wp/v2/template-parts/(?P<parent>[\\d]+)/revisions
/wp/v2/template-parts/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)
/wp/v2/template-parts/(?P<id>[\\d]+)/autosaves
/wp/v2/template-parts/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)
/wp/v2/navigation
/wp/v2/navigation/(?P<id>[\\d]+)
/wp/v2/navigation/(?P<parent>[\\d]+)/revisions
/wp/v2/navigation/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)
/wp/v2/navigation/(?P<id>[\\d]+)/autosaves
/wp/v2/navigation/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)
/wp/v2/types
/wp/v2/types/(?P<type>[\\w-]+)
/wp/v2/statuses
/wp/v2/statuses/(?P<status>[\\w-]+)
/wp/v2/taxonomies
/wp/v2/taxonomies/(?P<taxonomy>[\\w-]+)
/wp/v2/categories
/wp/v2/categories/(?P<id>[\\d]+)
/wp/v2/tags
/wp/v2/tags/(?P<id>[\\d]+)
/wp/v2/menus
/wp/v2/menus/(?P<id>[\\d]+)
/wp/v2/users
/wp/v2/users/(?P<id>[\\d]+)
/wp/v2/users/me
/wp/v2/users/(?P<user_id>(?:[\\d]+|me))/application-passwords
/wp/v2/users/(?P<user_id>(?:[\\d]+|me))/application-passwords/introspect
/wp/v2/users/(?P<user_id>(?:[\\d]+|me))/application-passwords/(?P<uuid>[\\w\\-]+)
/wp/v2/comments
/wp/v2/comments/(?P<id>[\\d]+)
/wp/v2/search
/wp/v2/block-renderer/(?P<name>[a-z0-9-]+/[a-z0-9-]+)
/wp/v2/block-types
/wp/v2/block-types/(?P<namespace>[a-zA-Z0-9_-]+)
/wp/v2/block-types/(?P<namespace>[a-zA-Z0-9_-]+)/(?P<name>[a-zA-Z0-9_-]+)
/wp/v2/global-styles/themes/(?P<stylesheet>[^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)
/wp/v2/global-styles/(?P<id>[\\/\\w-]+)
/wp/v2/settings
/wp/v2/themes
/wp/v2/themes/(?P<stylesheet>[^\\/:<>\\*\\?\"\\|]+(?:\\/[^\\/:<>\\*\\?\"\\|]+)?)
/wp/v2/plugins
/wp/v2/plugins/(?P<plugin>[^.\\/]+(?:\\/[^.\\/]+)?)
/wp/v2/sidebars
/wp/v2/sidebars/(?P<id>[\\w-]+)
/wp/v2/widget-types
/wp/v2/widget-types/(?P<id>[a-zA-Z0-9_-]+)
/wp/v2/widget-types/(?P<id>[a-zA-Z0-9_-]+)/encode
/wp/v2/widget-types/(?P<id>[a-zA-Z0-9_-]+)/render
/wp/v2/widgets
/wp/v2/widgets/(?P<id>[\\w\\-]+)
/wp/v2/block-directory/search
/wp/v2/pattern-directory/patterns
/wp-site-health/v1
/wp-site-health/v1/tests/background-updates
/wp-site-health/v1/tests/loopback-requests
/wp-site-health/v1/tests/https-status
/wp-site-health/v1/tests/dotorg-communication
/wp-site-health/v1/tests/authorization-header
/wp-site-health/v1/directory-sizes
/wp-block-editor/v1
/wp-block-editor/v1/url-details
/wp/v2/menu-locations
/wp/v2/menu-locations/(?P<location>[\\w-]+)
/wp-block-editor/v1/export
/wp/v2/block-patterns/patterns
/wp/v2/block-patterns/categories
/wp/v2/templates/lookup
/wp/v2/global-styles/(?P<parent>[\\d]+)/revisions
/wp/v2/global-styles/(?P<parent>[\\d]+)/revisions/(?P<id>[\\d]+)
/wp-block-editor/v1/navigation-fallback
/wp/v2/font-families
/wp/v2/font-families/(?P<id>[\\d]+)
/wp/v2/font-families/(?P<font_family_id>[\\d]+)/font-faces
/wp/v2/font-families/(?P<font_family_id>[\\d]+)/font-faces/(?P<id>[\\d]+)
/wp/v2/font-collections
/wp/v2/font-collections/(?P<slug>[\\/\\w-]+)
/wp-abilities/v1/abilities
/wp-abilities/v1/abilities/(?P<name>[a-z0-9][a-z0-9_\\/-]+)
/wp-abilities/v1/abilities/(?P<name>[a-z0-9][a-z0-9_\\/-]+)/run
/wp-abilities/v1/categories
/wp-abilities/v1/categories/(?P<slug>[a-z0-9][a-z0-9_-]+)
/wp/v2/icons
/wp/v2/icons/(?P<collection>[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)
/wp/v2/icons/(?P<name>[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?/[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)
/wp/v2/icon-collections
/wp/v2/icon-collections/(?P<slug>[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)
/wp/v2/view-config

Documentation for REST API

The WordPress REST API provides documentation for itself. It allows you to see the capabilities of a route: the route schema, what endpoints it has, and what parameters each endpoint can accept.

General documentation for the entire REST API can be obtained via a GET request to the main (root) route /wp-json/. Documentation for a specific route can be obtained by sending an OPTIONS request to it.

Example

For example, let's go to the site apirequest.io and send an OPTIONS request to the route (URL) http://demo.wp-api.org/wp-json/wp/v2/categories/1. In response, we will receive documentation for this route:

GitHub
{
    "namespace": "wp/v2",
    "methods": [
        "GET",
        "POST",
        "PUT",
        "PATCH",
        "DELETE"
    ],
    "endpoints": [
        {
            "methods": [
                "GET"
            ],
            "args": {
                "id": {
                    "required": false,
                    "description": "Уникальный идентификатор элемента.",
                    "type": "integer"
                },
                "context": {
                    "required": false,
                    "default": "view",
                    "enum": [
                        "view",
                        "embed",
                        "edit"
                    ],
                    "description": "Рамки в которых сделан запрос, определяют поля в ответе.",
                    "type": "string"
                }
            }
        },
        {
            "methods": [
                "POST",
                "PUT",
                "PATCH"
            ],
            "args": {
                "id": {
                    "required": false,
                    "description": "Уникальный идентификатор элемента.",
                    "type": "integer"
                },
                "description": {
                    "required": false,
                    "description": "HTML описание элемента.",
                    "type": "string"
                },
                "name": {
                    "required": false,
                    "description": "HTML название элемента.",
                    "type": "string"
                },
                "slug": {
                    "required": false,
                    "description": "Буквенно-цифровой идентификатор элемента уникальный для его типа.",
                    "type": "string"
                },
                "parent": {
                    "required": false,
                    "description": "ID элемента родителя.",
                    "type": "integer"
                },
                "meta": {
                    "required": false,
                    "description": "Мета поля.",
                    "type": "object"
                }
            }
        },
        {
            "methods": [
                "DELETE"
            ],
            "args": {
                "id": {
                    "required": false,
                    "description": "Уникальный идентификатор элемента.",
                    "type": "integer"
                },
                "force": {
                    "required": false,
                    "default": false,
                    "description": "Должно быть истинно, так как элементы не поддерживают перемещение в корзину.",
                    "type": "boolean"
                }
            }
        }
    ],
    "schema": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "category",
        "type": "object",
        "properties": {
            "id": {
                "description": "Уникальный идентификатор элемента.",
                "type": "integer",
                "context": [
                    "view",
                    "embed",
                    "edit"
                ],
                "readonly": true
            },
            "count": {
                "description": "Число опубликованных записей элемента.",
                "type": "integer",
                "context": [
                    "view",
                    "edit"
                ],
                "readonly": true
            },
            "description": {
                "description": "HTML описание элемента.",
                "type": "string",
                "context": [
                    "view",
                    "edit"
                ]
            },
            "link": {
                "description": "URL элемента.",
                "type": "string",
                "format": "uri",
                "context": [
                    "view",
                    "embed",
                    "edit"
                ],
                "readonly": true
            },
            "name": {
                "description": "HTML название элемента.",
                "type": "string",
                "context": [
                    "view",
                    "embed",
                    "edit"
                ],
                "required": true
            },
            "slug": {
                "description": "Буквенно-цифровой идентификатор элемента уникальный для его типа.",
                "type": "string",
                "context": [
                    "view",
                    "embed",
                    "edit"
                ]
            },
            "taxonomy": {
                "description": "Тип атрибуции элемента.",
                "type": "string",
                "enum": [
                    "category",
                    "post_tag",
                    "nav_menu",
                    "link_category",
                    "post_format"
                ],
                "context": [
                    "view",
                    "embed",
                    "edit"
                ],
                "readonly": true
            },
            "parent": {
                "description": "ID элемента родителя.",
                "type": "integer",
                "context": [
                    "view",
                    "edit"
                ]
            },
            "meta": {
                "description": "Мета поля.",
                "type": "object",
                "context": [
                    "view",
                    "edit"
                ],
                "properties": []
            }
        }
    }
}