site_url (the WordPress
address, https://example.com or https://example.com/blog, with or
without /wp-json), the username of the user the password belongs to,
and an application password as the key. Create one at Users → Profile →
Application Passwords (WordPress 5.6+; the site must be served over HTTPS
unless it runs with WP_ENVIRONMENT_TYPE set to local). Calls are sent as
HTTP Basic auth, so what works depends on that user’s role: an
Administrator can manage plugins, users and settings, an Author only their
own posts. The site needs pretty permalinks (any setting other than Plain)
so /wp-json/ routes resolve. SDK users can pass siteUrl and username
in the plugin options; with a stored password the site must match the
stored one (the password is never sent to another host), else pass key
too.
- Lists page with
pageandper_page(WordPress allows up to 100). Paged lists return{ items, next_page }:next_pageis set while a page comes back full; steppageuntil it is null. - Content fields such as
title,contentandexcerpttake a plain string when writing and come back as{ rendered }(plusrawwithcontext: "edit"). - Media.
media.createuploads a file (a public URL, or base64 with a file name) as the request body, with the other fields in the query string, or sideloads an external image fromurl. - Custom post types and plugin routes. Routes this plugin doesn’t name,
such as a
bookpost type (wp/v2/book) or another plugin’s namespace (yoast/v1,acf/v3), go throughrest.get(reads) andrest.send(writes, marked destructive).site.indexlists every route the site serves. - Risk. Every delete is
destructive(posts go to the trash unlessforce: true; users, terms and comments needforce), as are installing, activating and deactivating plugins, creating application passwords, batch requests and running abilities. - WooCommerce stores use the separate
woocommerceplugin.
- 209 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the WordPress API key before the first call: More: API Key
pnpm corsair setup --plugin=wordpress --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List the latest postsWhat’s next
API reference
Every
wordpress.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.