Connector Overview
The connector lets an AI assistant such as Claude Desktop do everything in
this plugin that you can do in the admin, and a little more: register record
types, define fields and groupings, create, update, import and remove
records, and preview a record’s page. The assistant uses tools named
postruntime_*, which call the plugin’s REST API at
/wp-json/post-runtime/v1/connector/.
How to turn it on
Section titled “How to turn it on”- Open Post Runtime → Connector.
- Tick Allow Claude Cowork to call this site. The connector is off on a new site.
- Under Step 1: Generate Connection, select Generate Connection. It creates an application password for your user; generating again replaces it, and Revoke Connection removes it.
- Follow Step 2: Run Setup Command and Step 3: Verify Connection.
Application passwords need HTTPS, or a local development site. The full setup, which is the same for every Promptless plugin, is in Connecting an AI Assistant.
Ask the assistant to run postruntime_preflight first in each conversation.
It reports the plugin version, your permissions, the record types on the
site, whether Promptless WP is active, and the authoring rules the assistant
should follow.
The tools
Section titled “The tools”| Task | Tools |
|---|---|
| Check and look up | postruntime_preflight, postruntime_list_icons (the 53 built-in icons and Iconify codes), postruntime_list_variants (grouping layouts), postruntime_list_positions (grouping positions) |
| Record types | postruntime_list_cpts, postruntime_get_cpt, postruntime_register_cpt, postruntime_update_cpt, postruntime_delete_cpt |
| Post fields | postruntime_list_post_fields, postruntime_get_post_field, postruntime_define_post_field, postruntime_update_post_field, postruntime_reorder_post_fields, postruntime_delete_post_field |
| Groupings | postruntime_list_groupings, postruntime_get_grouping, postruntime_define_grouping, postruntime_update_grouping, postruntime_delete_grouping |
| Records | postruntime_list_posts, postruntime_create_post (a draft by default, optionally with groupings), postruntime_update_post, postruntime_upsert_post (import and sync, see Importing and syncing records), postruntime_delete_post, postruntime_preview_post (the record’s page as HTML, never cached) |
| A record’s values | postruntime_get_post_field_values, postruntime_set_post_field_values (only the fields sent change), postruntime_get_post_groupings, postruntime_set_post_groupings (replaces all groupings on the record), postruntime_get_post_field_visibility, postruntime_set_post_field_visibility (per-record hiding and map placement; replaces all overrides) |
postruntime_create_post and postruntime_update_post also take
taxonomies and featured_image_url. Field values are set separately with
postruntime_set_post_field_values.
Permissions
Section titled “Permissions”The assistant acts as the WordPress user who generated the connection.
- Record types, fields, groupings, creating, listing, importing and
deleting records need the
pcptpages_manage_cptscapability, which administrators have. - Reading and changing one record’s values, updating it and previewing it need permission to edit that record.
- Deleting a record also needs permission to delete it.
Rate limits
Section titled “Rate limits”Each tool has a limit per user per minute. A request over the limit gets
HTTP 429 with retry_after, the seconds to wait.
| Tools | Requests per minute |
|---|---|
| Reading and listing | 60 |
| Record writes, field definitions and reordering, and upserts | 30 |
| Record-type and grouping definitions | 10 |
| Every delete | 5 |
A developer can change a limit with the pcptpages_connector_rate_limit
filter.
Changing a definition safely
Section titled “Changing a definition safely”Record types, groupings and post fields carry a connector_version that
goes up on every change. The update tools send the version the assistant
last read; if someone changed the definition in between, the update is
refused with HTTP 409 and the assistant reads it again.
Removing things
Section titled “Removing things”- A record goes to the trash by default, where it can be restored in the
admin.
force: truedeletes it permanently. A record already in the trash stays there unlessforceis sent. The response’spermanentsays what actually happened: a site whose trash is switched off deletes permanently. - Only this plugin’s records. Posts, pages, products and other plugins’ content are always refused.
- A record type removed with
postruntime_delete_cptkeeps its records, field and grouping definitions and values. Registering the same slug again brings everything back, and the response lists what was revived.purge_data: truealso deletes the definitions and every record’s field values, groupings and hiding settings; the records themselves stay. - Records of a removed type do not appear in the admin, because it only
shows registered types.
postruntime_list_postswithinclude_orphans: truelists them, andpostruntime_delete_postremoves one withallow_unregistered: true. This covers types removed through the connector, not through the admin’s Remove link. - A grouping or post field definition removed through the connector leaves the values on records, which return if you define the same key again.