These abilities require a Post Plus release that includes Abilities API support. Earlier builds do not register them. Check ability discovery on your Dashboard before using these examples.
mainwp-post-plus category. Both use the mainwp/ namespace on your MainWP Dashboard.
Use them to review drafts saved with the Save as Draft button before you publish them, for example from an AI assistant or a script. They do not create, edit, publish, or delete drafts.
What You’ll Learn
- List saved drafts with pagination and an optional post or page filter
- Read one saved draft with its slug and a short plain-text excerpt
- Interpret target sites, hidden sites, client targets, and masked text
Prerequisites
- WordPress 6.9 or later on the MainWP Dashboard site
- MainWP Dashboard with Abilities API support; use version 6.2 or later for the
input_jsonexamples below - A Post Plus build that registers these abilities, active on MainWP Dashboard
- An authenticated user with
manage_optionsand access to the Post Plus Add-on
hidden_site_count.
Available Abilities
Discover the abilities and their schemas:
readonly: true, destructive: false, and idempotent: true. They reject extra input properties.
List Saved Drafts
Ability:mainwp/list-post-plus-drafts-v1Method: GET All parameters are optional. Omit the input to get the first 20 drafts of both types.
total is the number of saved drafts that match the type filter.
Get One Saved Draft
Ability:mainwp/get-post-plus-draft-v1Method: GET The only input is the required
id: the draft’s positive integer ID in MainWP Dashboard. Use an id from the list response.
slug and excerpt:
mainwp_post_not_found, even when the ID exists.
Response Fields
When
target_by is group, sites and hidden_site_count cover the sites in the selected tags. The IDs and names of hidden sites are not returned.
When target_by is client, Post Plus returns the saved client_ids without expanding them to sites. sites is empty and hidden_site_count is 0. Use the Clients Abilities to look up those clients.
Excerpts and Masked Text
The excerpt is built from the saved draft body. Shortcodes and HTML are removed before the text is shortened to 300 characters. The response never includes the full body, HTML, or raw metadata. Before returning any text field, including site names, Post Plus replaces sensitive-looking values with[redacted]:
- URLs, file paths, and email addresses
- API keys, tokens, private keys, and
key=valueorkey: valuecredentials Bearerfollowed by a tokenBasicfollowed by a value that decodes touser:passwordcredentials
password:. Unregistered shortcodes can remain in the excerpt as literal text. Open the draft in the Drafts page to review its full content.
These abilities read stored data on MainWP Dashboard only. They do not contact Child sites or change posts, metadata, or settings.
Error Handling
Standard authentication, schema, and method errors follow the Abilities API error reference. Post Plus can also return:
Unauthenticated requests return HTTP 401 from MainWP Dashboard before the ability runs.
Related Resources
- Post Plus - Save, edit, publish, and delete drafts
- Abilities API Overview - Authentication, input formats, discovery, and errors
- Sites Abilities - Look up site IDs returned in
sites
