Kindly EditDocumentationTry the editor

context-help REST endpoint

Request context-aware editor guidance using bounded selection context.

Endpoint#

Request context-aware editor guidance using bounded selection context.

/wp-json/cantata-edit/v1/context-help

Named regular-expression groups in this registered route are path parameters. Replace them with an actual matching value when constructing a request.

POST#

This operation uses a server permission callback. Browser clients need an authenticated WordPress session and REST nonce. The server checks the relevant caller capability and feature gates.

Permission expression in this release:

'permission_callback' => static fn( $req ) => current_user_can( 'edit_post', (int) $req['post_id'] ),

Registered argument schema#

{
  "post_id": {
    "type": "integer",
    "required": true
  },
  "question": {
    "type": "string",
    "required": true,
    "minLength": 1,
    "maxLength": 2000
  },
  "elements": {
    "type": "array",
    "default": [],
    "maxItems": 5,
    "items": {
      "type": "object"
    }
  },
  "image": {
    "type": [
      "string",
      "null"
    ],
    "default": null,
    "maxLength": 1400000
  },
  "context": {
    "type": "object",
    "default": []
  },
  "history": {
    "type": "array",
    "default": [],
    "maxItems": 6,
    "items": {
      "type": "object"
    }
  },
  "mode": {
    "type": "string",
    "enum": [
      "simple",
      "developer"
    ],
    "default": "simple"
  },
  "act": {
    "type": "boolean",
    "default": false
  }
}

WordPress applies these registered field rules before the callback. Feature-specific validation can add further constraints.

Callback input keys#

act, actions, answer, context, elements, history, image, mode, post_id, question, source. This literal-key inventory supplements the registered schema; nested objects and downstream validators can define additional structure.

Implementation#

Client handling#

Use HTTPS on production sites. Treat authentication failures, validation errors, missing records, and stale-revision conflicts as different outcomes. Read the returned WordPress error code and message. Before retrying a timed-out mutation, determine whether the first request succeeded. Prefer the documented higher-level editor or Ability workflow when an endpoint coordinates several metadata owners.

About this page

Documents Kindly Edit 0.9.16. Source: includes/context-help.php:21, includes/context-help.php:7. Theme choices and account permissions can change which controls appear.

Type a word or phrase to search the full documentation.