MessageActionPolicyBody
Request body for setting a workspace's message-action policy (admin only, full replace). **EVERY POLICY FIELD IS REQUIRED, AND THAT IS THE WHOLE DESIGN OF THIS CLASS.** It carries no defaults for any field it can STORE, which is what makes it impossible for this body and :class:`MessageActionPolicy` to declare two different defaults for the same field. (The two GET echoes below do default to ``None`` — they are accepted so a GET response round-trips, excluded from every dump, and never stored, so neither is a second declaration of a policy value that could drift.) There is exactly one set of field defaults for the policy in this module — the policy's own — and it answers exactly one question: what a workspace that has NEVER been configured gets. The read path's :data:`_ABSENT_KEY_FALLBACKS` is not a second set: it narrows a STORED block that omits a key, where absence is missing information with nobody left to ask. Absence in a REQUEST is different — the caller is present to be told — so "what if they left it out" is not a defaults question at all; it is a malformed request. It was not always so, and the failure that changed it is worth keeping. Every field used to carry its own default, which meant the same field was declared twice with two independent values, and they drifted: ``proactive_reactions_enabled`` was ``True`` on the policy (shipped 2026-08-03) and ``False`` here, so a ``PUT`` that omitted it silently disabled the capability that had just shipped, answered 200, and published ``default: false`` in the OpenAPI contract as if that were correct. The console had already diagnosed this from the outside and worked around it client-side (``useMessageActionPolicy.ts``'s ``Required<…>`` guard, whose comment called a partial body "silent data loss" until the hole closed); the hole itself was server-side and stayed open. Syncing the two sets of defaults was the obvious repair and is the wrong one: it only changes WHICH silent thing an omission does. With them synced, omitting ``proactive_replies_enabled`` would GRANT unprompted replies — text that cannot be taken back — to a workspace that had turned them off. The same argument, about the allowlist, was already written in this file before this change: defaulting it to empty "would make the same partial body silently disable every reaction instead, trading one surprise for a worse one." So the second set of defaults is deleted rather than corrected. An omitted field is now a 422 naming it, which is what the endpoint description and the owner checklist have always told callers to expect ("send every field"), and what the console already enforces at compile time. Loud beats either flavour of silent.
MarketingAgency ToolsClient ReportingIntegration
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://artifacts.apis.io/patricia-app/json-schema/patricia-app-message-action-policy-body-schema.json",
"title": "MessageActionPolicyBody",
"description": "Request body for setting a workspace's message-action policy (admin only, full replace).\n\n**EVERY POLICY FIELD IS REQUIRED, AND THAT IS THE WHOLE DESIGN OF THIS CLASS.** It carries no\ndefaults for any field it can STORE, which is what makes it impossible for this body and\n:class:`MessageActionPolicy` to declare two different defaults for the same field. (The two\nGET echoes below do default to ``None`` — they are accepted so a GET response round-trips,\nexcluded from every dump, and never stored, so neither is a second declaration of a policy\nvalue that could drift.) There is exactly one set of field defaults for the policy in this\nmodule — the policy's own — and it answers exactly one question: what a workspace that has\nNEVER been configured gets. The read path's :data:`_ABSENT_KEY_FALLBACKS` is not a second set:\nit narrows a STORED block that omits a key, where absence is missing information with nobody\nleft to ask. Absence in a REQUEST is different — the caller is present to be told — so \"what\nif they left it out\" is not a defaults question at all; it is a malformed request.\n\nIt was not always so, and the failure that changed it is worth keeping. Every field used to\ncarry its own default, which meant the same field was declared twice with two independent\nvalues, and they drifted: ``proactive_reactions_enabled`` was ``True`` on the policy (shipped\n2026-08-03) and ``False`` here, so a ``PUT`` that omitted it silently disabled the capability\nthat had just shipped, answered 200, and published ``default: false`` in the OpenAPI contract as\nif that were correct. The console had already diagnosed this from the outside and worked around\nit client-side (``useMessageActionPolicy.ts``'s ``Required<…>`` guard, whose comment called a\npartial body \"silent data loss\" until the hole closed); the hole itself was server-side and\nstayed open.\n\nSyncing the two sets of defaults was the obvious repair and is the wrong one: it only changes\nWHICH silent thing an omission does. With them synced, omitting ``proactive_replies_enabled``\nwould GRANT unprompted replies — text that cannot be taken back — to a workspace that had turned\nthem off. The same argument, about the allowlist, was already written in this file before this\nchange: defaulting it to empty \"would make the same partial body silently disable every reaction\ninstead, trading one surprise for a worse one.\"\n\nSo the second set of defaults is deleted rather than corrected. An omitted field is now a 422\nnaming it, which is what the endpoint description and the owner checklist have always told\ncallers to expect (\"send every field\"), and what the console already enforces at compile time.\nLoud beats either flavour of silent.",
"x-generated": "2026-11-20",
"x-method": "derived",
"x-generator": "derive-json-schema.py",
"x-source": "openapi/patricia-app-openapi.json#/components/schemas/MessageActionPolicyBody",
"properties": {
"stored_policy_unreadable": {
"anyOf": [
{
"type": "boolean",
"const": false
},
{
"type": "null"
}
],
"title": "Stored Policy Unreadable"
},
"dropped_allowlist_entries": {
"anyOf": [
{
"type": "integer",
"minimum": 0.0
},
{
"type": "null"
}
],
"title": "Dropped Allowlist Entries"
},
"enabled": {
"type": "boolean",
"title": "Enabled",
"description": "Allow message actions in the workspace."
},
"reaction_mode": {
"type": "string",
"enum": [
"all",
"custom"
],
"title": "Reaction Mode",
"description": "Choose all to allow any reaction supported by Patricia's chat connection, or custom to allow only the names in reaction_allowlist."
},
"reaction_allowlist": {
"items": {
"type": "string"
},
"type": "array",
"title": "Reaction Allowlist",
"description": "The emoji names Patricia may use for reactions when reaction_mode is custom. The list stays saved when reaction_mode is all."
},
"proactive_reactions_enabled": {
"type": "boolean",
"title": "Proactive Reactions Enabled",
"description": "Allow unprompted message reactions."
},
"proactive_replies_enabled": {
"type": "boolean",
"title": "Proactive Replies Enabled",
"description": "Allow unprompted replies in message threads."
},
"proactive_top_level_posts_enabled": {
"type": "boolean",
"title": "Proactive Top Level Posts Enabled",
"description": "Allow unprompted top-level channel messages."
},
"max_reactions_per_channel_per_hour": {
"type": "integer",
"maximum": 1000.0,
"minimum": 0.0,
"title": "Max Reactions Per Channel Per Hour",
"description": "The hourly reaction limit in each channel."
},
"max_replies_per_channel_per_hour": {
"type": "integer",
"maximum": 1000.0,
"minimum": 0.0,
"title": "Max Replies Per Channel Per Hour",
"description": "The hourly reply limit in each channel."
},
"max_top_level_posts_per_channel_per_hour": {
"type": "integer",
"maximum": 1000.0,
"minimum": 0.0,
"title": "Max Top Level Posts Per Channel Per Hour",
"description": "The hourly limit on top-level messages in each channel."
}
},
"additionalProperties": false,
"type": "object",
"required": [
"enabled",
"reaction_mode",
"reaction_allowlist",
"proactive_reactions_enabled",
"proactive_replies_enabled",
"proactive_top_level_posts_enabled",
"max_reactions_per_channel_per_hour",
"max_replies_per_channel_per_hour",
"max_top_level_posts_per_channel_per_hour"
]
}
Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.