Skip to content

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/.

  1. Open Post Runtime → Connector.
  2. Tick Allow Claude Cowork to call this site. The connector is off on a new site.
  3. 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.
  4. 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.

TaskTools
Check and look uppostruntime_preflight, postruntime_list_icons (the 53 built-in icons and Iconify codes), postruntime_list_variants (grouping layouts), postruntime_list_positions (grouping positions)
Record typespostruntime_list_cpts, postruntime_get_cpt, postruntime_register_cpt, postruntime_update_cpt, postruntime_delete_cpt
Post fieldspostruntime_list_post_fields, postruntime_get_post_field, postruntime_define_post_field, postruntime_update_post_field, postruntime_reorder_post_fields, postruntime_delete_post_field
Groupingspostruntime_list_groupings, postruntime_get_grouping, postruntime_define_grouping, postruntime_update_grouping, postruntime_delete_grouping
Recordspostruntime_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 valuespostruntime_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.

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_cpts capability, 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.

Each tool has a limit per user per minute. A request over the limit gets HTTP 429 with retry_after, the seconds to wait.

ToolsRequests per minute
Reading and listing60
Record writes, field definitions and reordering, and upserts30
Record-type and grouping definitions10
Every delete5

A developer can change a limit with the pcptpages_connector_rate_limit filter.

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.

  • A record goes to the trash by default, where it can be restored in the admin. force: true deletes it permanently. A record already in the trash stays there unless force is sent. The response’s permanent says 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_cpt keeps 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: true also 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_posts with include_orphans: true lists them, and postruntime_delete_post removes one with allow_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.