Entity Records (gated read/write)
Read and write MAPI entity records from a page, under the visitor or member identity of the current session. Only works on entities that carry an access policy (policy_json) — the policy decides which rows the caller sees, which fields are returned, and who may create, update or delete. The owner column is set server-side from the session; fields listed in fields.<tier>.hide or fields.<tier>.readonly cannot be written. Use this for member areas, own requests, notes, messages and other per-user or per-tenant data that must not be public.
Try it with your AI assistant
Once WebsitePublisher is connected to your AI assistant, paste one of these into the chat. Replace the parts in [brackets] with your own details.
@WebsitePublisher let signed-in members add their own notes on my site and only ever see their own@WebsitePublisher build a members page where each member can view and update only their own [requests]@WebsitePublisher let members delete their own [entries], but not once an admin has marked them as handledWith WebsitePublisher, let signed-in members add their own notes on my site and only ever see their ownWith WebsitePublisher, build a members page where each member can view and update only their own [requests]With WebsitePublisher, let members delete their own [entries], but not once an admin has marked them as handledWith WebsitePublisher, let signed-in members add their own notes on my site and only ever see their ownWith WebsitePublisher, build a members page where each member can view and update only their own [requests]With WebsitePublisher, let members delete their own [entries], but not once an admin has marked them as handledEndpoints (5)
List records of a governed entity, scoped to the caller by the entity policy. Returns { entity, data, pagination }; every row carries a _version_hash token for optimistic concurrency on update. Requires a verified SAPI session (visitor magic link/code, or a tenant_auth wst_ Bearer). Entities without a policy_json return 404.
| Field | Type | Required | Description |
|---|---|---|---|
entity |
string | ✓ Yes | Entity name, e.g. iteration_log. |
filter |
object | No | Equality filters, e.g. {"published":1}. Cannot widen scope — the policy filter is applied on top. Fields hidden by the policy cannot be filtered on. |
sort_by |
string | No | Column to sort on (default id). Fields hidden by the policy cannot be sorted on. |
sort_order |
string | No | ASC or DESC (default ASC). |
per_page |
integer | No | Page size (default 50, max 200). |
offset |
integer | No | Pagination offset (default 0). |
Read one record of a governed entity by id. Returns { entity, data }, where data carries a _version_hash token to send back as if_match on update. A record the caller does not own returns 403; an unknown record, an unknown entity, or an entity without a policy returns 404.
| Field | Type | Required | Description |
|---|---|---|---|
entity |
string | ✓ Yes | Entity name, e.g. iteration_log. |
id |
integer | ✓ Yes | Record id. |
Create a record in a governed entity as the signed-in visitor or tenant member, or from an admin page (wsa_). The policy must allow create for that caller (rules.create, e.g. {"verified":"self"}). For a visitor or member the owner column is set from the session; id, the owner column, hidden and readonly fields are refused (422). Send an idempotency_key to make a retry safe: the same key with the same data creates nothing and returns the first id with replayed: true; the same key with other data is refused with 409. Returns { entity, id }. Requires a verified SAPI session or an admin session.
| Field | Type | Required | Description |
|---|---|---|---|
entity |
string | ✓ Yes | Entity name, e.g. withdrawal_request. |
data |
object | ✓ Yes | Field => value (scalars, max 50 fields). |
idempotency_key |
string | No | Optional, 8 to 100 characters (letters, digits, . _ : -), one per intended record. A repeat with the same key and data returns the first id with replayed: true instead of creating again. Keys are kept for 7 days per caller and entity. |
Update fields of a record the caller may change (rules.update, e.g. {"verified":"own"}). Ownership and state guards are checked on the existing row; the owner column cannot be changed; hidden and readonly fields are refused (422). Optionally send if_match with the _version_hash from your last read: if the row changed in the meantime the update is refused with 409 and the current state comes back in context.current instead of overwriting someone. Returns { entity, id, _version_hash }.
| Field | Type | Required | Description |
|---|---|---|---|
entity |
string | ✓ Yes | Entity name. |
id |
integer | ✓ Yes | Record id. |
data |
object | ✓ Yes | Only the fields that change (scalars, max 50 fields). |
if_match |
string | No | The _version_hash from your last read of this record. Omit for last-write-wins; send it to have a concurrent change refused with 409 instead of overwritten. Saves with if_match on one record are serialized, so of two saves made from the same version exactly one succeeds. |
Delete a record the caller may delete (rules.delete). Hard delete; a state guard in the policy (guards.delete) can block it with 409. Returns { entity, id }.
| Field | Type | Required | Description |
|---|---|---|---|
entity |
string | ✓ Yes | Entity name. |
id |
integer | ✓ Yes | Record id. |
MCP Tool Names
When using this integration through an AI assistant (Claude, ChatGPT, Cursor, etc.), the endpoints are available as MCP tools:
| Endpoint | MCP Tool Name |
|---|---|
| list | records_list |
| get | records_get |
| create | records_create |
| update | records_update |
| delete | records_delete |
Website