Skip to main content
Use these ten abilities to prepare reusable content for a client site and manage its saved deployment. They run on your MainWP Dashboard in the mainwp-boilerplate category. Publishing a template still uses the Boilerplate workflow.

Access and setup

Activate Boilerplate 5.1 or later on a MainWP Dashboard with WordPress 6.9 or later and Abilities API support. The input_json examples require MainWP Dashboard 6.2 or later. The Dashboard must provide the MainWP ability permission utilities. Confirm the update is installed by listing the abilities:
Use an Application Password or another authentication method supported by the Abilities API. Keep passwords out of saved scripts and shared logs. Every ability requires authenticated REST access and permission to use the Boilerplate extension. Global abilities also require MainWP administrator authority. Site abilities require permission for the exact site_id, including MainWP and Team Control site restrictions. Missing permissions or permission utilities refuse the call. Read abilities use GET. Changes use POST, and destructive abilities use DELETE. The route is /wp-json/wp-abilities/v1/abilities/ABILITY_NAME/run. The examples below show the JSON input and response fields for each ability. For GET, send the JSON through input_json:
For POST or DELETE, send a JSON body with an input object. Use a JSON boolean for confirm and an integer for counts:
IDs accept positive integers or canonical decimal strings such as 17 or "17". Zero, leading zeros, fractions, trailing whitespace and overflowing IDs are refused. Pagination defaults to page 1 with 25 items and allows at most 100 items per page. Query-string pagination also accepts canonical decimal strings. All input objects reject extra properties. Token text limits are measured in bytes at runtime, so multibyte text may reach a limit before the schema’s character count.

List token definitions

Ability: mainwp/list-boilerplate-tokens-v1
Method: GET
Who may use it: Global authority described above.
Read token names, descriptions and counts of stored site values. Private token values are omitted.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
Repeat freely. This reads Dashboard data and changes nothing.

Read one site’s token values

Ability: mainwp/get-site-boilerplate-token-values-v1
Method: GET
Who may use it: Authority for this exact site, as described above.
Read the substitutions used for one site. Treat the returned values as private client data.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
Repeat freely. The source is dashboard_stored for a saved override, built_in_site for the site name or URL default, or empty when no value is available.

Set one site’s token values

Ability: mainwp/set-site-boilerplate-token-values-v1
Method: POST
Who may use it: Authority for this exact site, as described above.
Change only the supplied token values. Tokens omitted from the request keep their existing values.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
Repeating the same successful patch leaves the same values; the IDs then appear in unchanged_token_ids. Use each token ID once. Unchanged empty or built-in defaults remain defaults; they do not create saved overrides.

Ensure a custom token exists

Ability: mainwp/ensure-boilerplate-token-v1
Method: POST
Who may use it: Global authority described above.
Create a custom token, or return the matching definition if it already exists. A differing definition is refused; it is not overwritten.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
Repeat with the same name and description to get the same token with created:false. Built-in definitions are not converted to custom tokens.

Delete a custom token

Ability: mainwp/delete-boilerplate-token-v1
Method: DELETE
Who may use it: Global authority described above.
Remove one custom token definition and its stored site values. First list token definitions and use its current site_value_count as expected_site_value_count.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
A repeat after confirmed deletion returns already_absent:true. A changed value count causes a conflict rather than deleting unexpected values. Built-in tokens cannot be deleted.

List saved Boilerplates

Ability: mainwp/list-boilerplates-v1
Method: GET
Who may use it: Global authority described above.
Browse saved Dashboard templates by kind and status. This list omits content and site mappings.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
Repeat freely. Page numbers start at 1. Increase page to read the next page until the returned items cover total.

Read a saved Boilerplate

Ability: mainwp/get-boilerplate-v1
Method: GET
Who may use it: Global authority described above.
Read one Dashboard template before replacing its tokens. The response excludes internal metadata and site token values.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
Repeat freely. Content reads remain bounded: title 1,000 bytes, content 100,000 bytes and excerpt 10,000 bytes. Larger content returns mainwp_boilerplate_content_too_large. These read limits do not prevent deletion of an existing mapped Child post.

Preview a template for one site

Ability: mainwp/preview-boilerplate-for-site-v1
Method: GET
Who may use it: Authority for this exact site, as described above.
Replace Boilerplate and Client tokens for one authorized site without publishing content or contacting the Child.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
Repeat freely. deployment_mode is create when no mapping exists, or update when one exists. unresolved_tokens lists placeholders that remain. Avoid nested token values that contain other placeholders: their replacement order can differ from the posting workflow. A preview does not publish anything.

Read a deployment mapping

Ability: mainwp/get-boilerplate-deployment-v1
Method: GET
Who may use it: Authority for this exact site, as described above.
Read the Dashboard’s stored relationship between a template and one Child post. This does not ask the Child whether the post still exists.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
Repeat freely. state is mapped, not_deployed or corrupt. remote_post_id is a positive integer only for a valid mapping; otherwise it is null. Private mapping links are not returned.

Delete a mapped Child post

Ability: mainwp/delete-boilerplate-site-post-v1
Method: DELETE
Who may use it: Authority for this exact site, as described above.
Permanently remove the exact Child post recorded in the Dashboard mapping. This also removes that mapping after the Child confirms success. It does not delete the Dashboard template.

Inputs

Outputs

All listed output fields are present.

Example

Input:
Response:
After the mapping is removed, repeating the call returns deleted:false, already_absent:true and mapping_removed:false without contacting the Child. A confirmed Child response proves the post is absent; the wire response does not distinguish deletion now from prior absence. If the outcome is unknown, inspect the Child and current mapping before deciding whether to repeat the operation.

Confirmed deletion and errors

mainwp/delete-boilerplate-site-post-v1 requires MainWP Child 6.2 or later on the target site. Older Child releases could report success without confirming deletion. The ability refuses an older reported version before sending a delete request. Sync the site after updating Child so the Dashboard has its current version. Only an exact Child SUCCESS response permits mapping removal. A failed or uncertain deletion keeps the mapping. A database conflict or failed mapping cleanup after remote success can also leave the result unknown. Check the Child directly and read the current Dashboard mapping before deciding what to do next; a mapping read alone does not prove the remote post exists. Invalid input, missing objects, denied permissions and unavailable storage also return errors. Fix the reported cause rather than treating a failed call as an empty result. The legacy “Yes, Proceed!” action uses the same confirmed deletion rule and retains its existing success/failure response format.