Skip to main content
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.
The Abilities-enabled Post Plus release registers two read-only abilities in the 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_json examples below
  • A Post Plus build that registers these abilities, active on MainWP Dashboard
  • An authenticated user with manage_options and access to the Post Plus Add-on
Use an Application Password or the authentication methods in the Abilities API overview. The examples use an Application Password. Team Control restrictions apply to target sites. A response names only the sites you can access. Other selected sites are counted in hidden_site_count.

Available Abilities

Discover the abilities and their schemas:
Both abilities are marked readonly: true, destructive: false, and idempotent: true. They reject extra input properties.

List Saved Drafts

Ability: mainwp/list-post-plus-drafts-v1
Method: GET
All parameters are optional. Omit the input to get the first 20 drafts of both types.
Example response:
Drafts are sorted by last modified time, newest first. total is the number of saved drafts that match the type filter.

Get One Saved Draft

Ability: mainwp/get-post-plus-draft-v1
Method: GET
The only input is the required id: the draft’s positive integer ID in MainWP Dashboard. Use an id from the list response.
The response contains the same fields as a list item, plus slug and excerpt:
The ability reads only drafts saved with Post Plus. Published posts, unsaved drafts, and other Dashboard content return 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=value or key: value credentials
  • Bearer followed by a token
  • Basic followed by a value that decodes to user:password credentials
Ordinary text such as “Basic Principles of Gardening” stays readable. A few phrases can still be masked because they look like credentials, such as “Basic Overview” or text that follows a word like 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.