{
  "components": {
    "schemas": {
      "authoring.Binding": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "channel": {
            "enum": [
              "email",
              "sms",
              "push"
            ],
            "type": "string"
          },
          "country_code": {
            "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "deleted_at": {
            "format": "date-time",
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "purpose_code": {
            "type": "string"
          },
          "revision": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "template": {
            "$ref": "#/components/schemas/authoring.TemplateReference"
          },
          "topic_code": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "country_code",
          "topic_code",
          "channel",
          "template",
          "active",
          "revision",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "authoring.BindingPage": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/authoring.Binding"
            },
            "type": "array"
          },
          "next_after_id": {
            "type": "string"
          }
        },
        "required": [
          "items",
          "next_after_id"
        ],
        "type": "object"
      },
      "authoring.BlockStyle": {
        "additionalProperties": false,
        "properties": {
          "alignment": {
            "enum": [
              "start",
              "center",
              "end"
            ],
            "type": "string"
          },
          "spacing": {
            "enum": [
              "compact",
              "normal",
              "relaxed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "authoring.Capabilities": {
        "additionalProperties": false,
        "properties": {
          "channels": {
            "items": {
              "enum": [
                "email",
                "sms",
                "push"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "country_codes": {
            "items": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            },
            "type": "array"
          },
          "languages": {
            "items": {
              "enum": [
                "en",
                "zh-TW",
                "zh-CN"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "manual_channels": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "manual_recipient_limit": {
            "type": "integer"
          },
          "manual_send_enabled": {
            "type": "boolean"
          },
          "permissions": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "recipient_scope": {
            "additionalProperties": false,
            "description": "Independent paths from the verified geographic_scope JWT. Never form a Cartesian product. Recipient lookup retains the original workforce JWT for Orders authority.",
            "properties": {
              "global": {
                "type": "boolean"
              },
              "targets": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "country_code": {
                      "pattern": "^[A-Z]{2}$",
                      "type": "string"
                    },
                    "depot_code": {
                      "description": "Requires market_code and state_code.",
                      "type": "string"
                    },
                    "market_code": {
                      "type": "string"
                    },
                    "state_code": {
                      "description": "Official state path; requires market_code.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "country_code"
                  ],
                  "type": "object"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "required": [
              "global",
              "targets"
            ],
            "type": "object"
          },
          "schema_version": {
            "enum": [
              1
            ],
            "type": "integer"
          },
          "source_character_limit": {
            "type": "integer"
          },
          "supported_placeholders": {
            "items": {
              "$ref": "#/components/schemas/authoring.RuntimePlaceholder"
            },
            "type": "array"
          },
          "text_format": {
            "enum": [
              "plain_text"
            ],
            "type": "string"
          },
          "topics": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "purposes": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "purpose_code": {
                        "type": "string"
                      },
                      "required_email_sections": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "runtime_binding_available": {
                        "description": "Active bindings require a verified delivery-country source. Currently true only for order lifecycle topics without a purpose.",
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "purpose_code",
                      "required_email_sections",
                      "runtime_binding_available"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "topic_code": {
                  "type": "string"
                }
              },
              "required": [
                "topic_code",
                "purposes"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "translation_available": {
            "type": "boolean"
          }
        },
        "required": [
          "country_codes",
          "languages",
          "channels",
          "schema_version",
          "permissions",
          "topics",
          "translation_available",
          "source_character_limit",
          "manual_recipient_limit",
          "recipient_scope",
          "supported_placeholders",
          "text_format"
        ],
        "type": "object"
      },
      "authoring.Content": {
        "additionalProperties": false,
        "description": "Shared Contract v53.8.0 NotificationContent. Translation accepts the source variant; completed review/save requires exactly en, zh-TW and zh-CN. Source fingerprint/origin are calculated by the service. Email theme is email-only and receives explicit defaults. Source text limit is 5000 Unicode code points across ordered leaves. Scalar placeholder occurrences and nontext structure must match across locales. Translation never receives recipient values.",
        "properties": {
          "channel": {
            "enum": [
              "email",
              "sms",
              "push"
            ],
            "type": "string"
          },
          "email_theme": {
            "$ref": "#/components/schemas/authoring.EmailTheme"
          },
          "placeholders": {
            "items": {
              "$ref": "#/components/schemas/authoring.Placeholder"
            },
            "maxItems": 32,
            "type": "array"
          },
          "schema_version": {
            "enum": [
              1
            ],
            "type": "integer"
          },
          "source_fingerprint": {
            "type": "string"
          },
          "source_language": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/authoring.Variant"
            },
            "maxItems": 3,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "schema_version",
          "channel",
          "source_language",
          "placeholders",
          "variants"
        ],
        "type": "object"
      },
      "authoring.ContentRequest": {
        "additionalProperties": false,
        "description": "Template translate/review includes localized name; omit resource_code before server-assigned POST creation. Message requests require resource_code and prohibit name. Preview accepts name but does not render it.",
        "properties": {
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "country_code": {
            "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "name": {
            "items": {
              "$ref": "#/components/schemas/authoring.LocalizedName"
            },
            "maxItems": 3,
            "minItems": 1,
            "type": "array"
          },
          "resource_code": {
            "description": "Omit only before template creation. Required for existing template operations and all message operations.",
            "pattern": "^[a-z][a-z0-9_-]{2,63}$",
            "type": "string"
          },
          "resource_type": {
            "enum": [
              "template",
              "message"
            ],
            "type": "string"
          }
        },
        "required": [
          "country_code",
          "resource_type",
          "content"
        ],
        "type": "object"
      },
      "authoring.CreateTemplate": {
        "additionalProperties": false,
        "description": "Creation-only body; code/id are not accepted. Uses a precreation name-and-content review plus Idempotency-Key.",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "name": {
            "items": {
              "$ref": "#/components/schemas/authoring.LocalizedName"
            },
            "maxItems": 3,
            "minItems": 3,
            "type": "array"
          },
          "review_token": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "active",
          "content",
          "review_token"
        ],
        "type": "object"
      },
      "authoring.EmailBlock": {
        "additionalProperties": false,
        "description": "Kind-specific fields are enforced: heading=text+level; paragraph=text; button=text+HTTPS/URL-placeholder action_url; image=resolved media+explicit alt_text; divider=no payload; system_section=section_code only, no style. IDs/order/nontext fields must match every locale.",
        "properties": {
          "action_url": {
            "maxLength": 2048,
            "type": "string"
          },
          "alt_text": {
            "maxLength": 300,
            "type": "string"
          },
          "id": {
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$",
            "type": "string"
          },
          "kind": {
            "enum": [
              "heading",
              "paragraph",
              "button",
              "image",
              "divider",
              "system_section"
            ],
            "type": "string"
          },
          "level": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer"
          },
          "media": {
            "$ref": "#/components/schemas/authoring.Media"
          },
          "section_code": {
            "enum": [
              "order_summary",
              "auth_credentials",
              "gift_claim",
              "unsubscribe"
            ],
            "type": "string"
          },
          "style": {
            "$ref": "#/components/schemas/authoring.BlockStyle"
          },
          "text": {
            "maxLength": 5000,
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind"
        ],
        "type": "object"
      },
      "authoring.EmailContent": {
        "additionalProperties": false,
        "properties": {
          "blocks": {
            "items": {
              "$ref": "#/components/schemas/authoring.EmailBlock"
            },
            "maxItems": 64,
            "minItems": 1,
            "type": "array"
          },
          "preview_text": {
            "maxLength": 300,
            "type": "string"
          },
          "subject": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "subject",
          "blocks"
        ],
        "type": "object"
      },
      "authoring.EmailTheme": {
        "additionalProperties": false,
        "properties": {
          "accent_color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "background_color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "button_shape": {
            "enum": [
              "square",
              "rounded"
            ],
            "type": "string"
          },
          "content_color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "font_family": {
            "enum": [
              "sans",
              "serif"
            ],
            "type": "string"
          },
          "spacing": {
            "enum": [
              "compact",
              "normal",
              "relaxed"
            ],
            "type": "string"
          },
          "text_color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "text_size": {
            "enum": [
              "small",
              "normal",
              "large"
            ],
            "type": "string"
          }
        },
        "required": [
          "background_color",
          "content_color",
          "text_color",
          "accent_color",
          "font_family",
          "text_size",
          "spacing",
          "button_shape"
        ],
        "type": "object"
      },
      "authoring.EmptyRequest": {
        "additionalProperties": false,
        "properties": {},
        "type": "object"
      },
      "authoring.LocalizedName": {
        "additionalProperties": false,
        "properties": {
          "language": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "language",
          "name"
        ],
        "type": "object"
      },
      "authoring.Media": {
        "additionalProperties": false,
        "description": "Existing media must include its resolved absolute HTTPS URL; this service does not resolve code-only assets.",
        "properties": {
          "code": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "url": {
            "format": "uri",
            "maxLength": 2048,
            "type": "string"
          }
        },
        "required": [
          "code",
          "url"
        ],
        "type": "object"
      },
      "authoring.Message": {
        "additionalProperties": false,
        "properties": {
          "accepted_at": {
            "format": "date-time",
            "type": "string"
          },
          "accepted_by": {
            "type": "string"
          },
          "code": {
            "pattern": "^[a-z][a-z0-9_-]{2,63}$",
            "type": "string"
          },
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "country_code": {
            "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "deleted_at": {
            "format": "date-time",
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "market_codes": {
            "items": {
              "maxLength": 100,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "type": "array",
            "uniqueItems": true
          },
          "retail_customer_numbers": {
            "items": {
              "maxLength": 100,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "revision": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "status": {
            "enum": [
              "draft",
              "accepted"
            ],
            "type": "string"
          },
          "topic_code": {
            "description": "Offers \u0026 news (default, never SMS) or Service notices (operational; SMS only when urgency is critical).",
            "enum": [
              "offers_news",
              "service_notices"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          },
          "urgency": {
            "description": "Service notices only. Critical adds SMS to usable Australian mobiles.",
            "enum": [
              "normal",
              "critical"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "code",
          "country_code",
          "market_codes",
          "retail_customer_numbers",
          "status",
          "revision",
          "content",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "authoring.MessagePage": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/authoring.MessageSummary"
            },
            "type": "array"
          },
          "next_after_code": {
            "type": "string"
          }
        },
        "required": [
          "items",
          "next_after_code"
        ],
        "type": "object"
      },
      "authoring.MessageSummary": {
        "additionalProperties": false,
        "properties": {
          "channel": {
            "enum": [
              "email",
              "sms",
              "push"
            ],
            "type": "string"
          },
          "code": {
            "pattern": "^[a-z][a-z0-9_-]{2,63}$",
            "type": "string"
          },
          "country_code": {
            "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "recipient_count": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "revision": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "status": {
            "enum": [
              "draft",
              "accepted"
            ],
            "type": "string"
          }
        },
        "required": [
          "code",
          "country_code",
          "status",
          "revision",
          "channel",
          "recipient_count"
        ],
        "type": "object"
      },
      "authoring.Placeholder": {
        "additionalProperties": false,
        "properties": {
          "key": {
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$",
            "type": "string"
          },
          "sensitive": {
            "type": "boolean"
          },
          "value_type": {
            "enum": [
              "text",
              "integer",
              "money",
              "timestamp",
              "url"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "value_type",
          "sensitive"
        ],
        "type": "object"
      },
      "authoring.Preview": {
        "additionalProperties": false,
        "properties": {
          "digest": {
            "type": "string"
          },
          "preview_token": {
            "type": "string"
          },
          "synthetic": {
            "type": "boolean"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/authoring.RenderedVariant"
            },
            "maxItems": 3,
            "minItems": 3,
            "type": "array"
          }
        },
        "required": [
          "digest",
          "preview_token",
          "variants",
          "synthetic"
        ],
        "type": "object"
      },
      "authoring.PublishRequest": {
        "additionalProperties": false,
        "properties": {
          "preview_token": {
            "type": "string"
          }
        },
        "required": [
          "preview_token"
        ],
        "type": "object"
      },
      "authoring.PushContent": {
        "additionalProperties": false,
        "properties": {
          "action_url": {
            "maxLength": 2048,
            "type": "string"
          },
          "body": {
            "maxLength": 1000,
            "minLength": 1,
            "type": "string"
          },
          "image": {
            "$ref": "#/components/schemas/authoring.Media"
          },
          "title": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "title",
          "body"
        ],
        "type": "object"
      },
      "authoring.RecipientDisplay": {
        "additionalProperties": false,
        "properties": {
          "display_name": {
            "type": "string"
          },
          "retail_customer_number": {
            "type": "string"
          }
        },
        "required": [
          "retail_customer_number",
          "display_name"
        ],
        "type": "object"
      },
      "authoring.RecipientPage": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/authoring.RecipientDisplay"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "authoring.RenderedVariant": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "type": "string"
              },
              "subject": {
                "type": "string"
              }
            },
            "required": [
              "subject",
              "body"
            ],
            "type": "object"
          },
          "language": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          },
          "push": {
            "$ref": "#/components/schemas/authoring.PushContent"
          },
          "sms": {
            "$ref": "#/components/schemas/authoring.SMSContent"
          },
          "sms_metrics": {
            "$ref": "#/components/schemas/authoring.SMSMetrics"
          }
        },
        "required": [
          "language"
        ],
        "type": "object"
      },
      "authoring.Review": {
        "additionalProperties": false,
        "description": "Server-stamped human confirmation. Client reviewer/timestamp fields never establish review; save verifies a signed review token or preserved stored evidence.",
        "properties": {
          "reviewed_at": {
            "format": "date-time",
            "type": "string"
          },
          "reviewed_by": {
            "type": "string"
          },
          "source_fingerprint": {
            "type": "string"
          },
          "target_fingerprint": {
            "type": "string"
          }
        },
        "required": [
          "source_fingerprint",
          "target_fingerprint",
          "reviewed_at",
          "reviewed_by"
        ],
        "type": "object"
      },
      "authoring.ReviewRequest": {
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "resource_type": {
                  "const": "template"
                }
              }
            },
            "then": {
              "required": [
                "name"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "resource_type": {
                  "const": "message"
                }
              }
            },
            "then": {
              "not": {
                "required": [
                  "name"
                ]
              },
              "required": [
                "resource_code"
              ]
            }
          }
        ],
        "description": "Template translate/review includes localized name; omit resource_code before server-assigned POST creation. Message requests require resource_code and prohibit name. Preview accepts name but does not render it.",
        "properties": {
          "confirmed_languages": {
            "items": {
              "enum": [
                "en",
                "zh-TW",
                "zh-CN"
              ],
              "type": "string"
            },
            "maxItems": 2,
            "minItems": 2,
            "type": "array",
            "uniqueItems": true
          },
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "country_code": {
            "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "name": {
            "items": {
              "$ref": "#/components/schemas/authoring.LocalizedName"
            },
            "maxItems": 3,
            "minItems": 3,
            "type": "array"
          },
          "resource_code": {
            "description": "Omit only before template creation. Required for existing template operations and all message operations.",
            "pattern": "^[a-z][a-z0-9_-]{2,63}$",
            "type": "string"
          },
          "resource_type": {
            "enum": [
              "template",
              "message"
            ],
            "type": "string"
          }
        },
        "required": [
          "country_code",
          "resource_type",
          "content",
          "confirmed_languages"
        ],
        "type": "object"
      },
      "authoring.ReviewResponse": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "name": {
            "items": {
              "$ref": "#/components/schemas/authoring.LocalizedName"
            },
            "maxItems": 3,
            "minItems": 3,
            "type": "array"
          },
          "review_token": {
            "type": "string"
          }
        },
        "required": [
          "content",
          "review_token"
        ],
        "type": "object"
      },
      "authoring.RuntimePlaceholder": {
        "additionalProperties": false,
        "properties": {
          "channels": {
            "items": {
              "enum": [
                "email",
                "sms",
                "push"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "group": {
            "enum": [
              "customer",
              "order"
            ],
            "type": "string"
          },
          "key": {
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$",
            "type": "string"
          },
          "label": {
            "items": {
              "$ref": "#/components/schemas/authoring.LocalizedName"
            },
            "maxItems": 3,
            "minItems": 3,
            "type": "array"
          },
          "resource_types": {
            "items": {
              "enum": [
                "template",
                "message"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "sensitive": {
            "type": "boolean"
          },
          "topic_codes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "usage": {
            "enum": [
              "text",
              "action_url"
            ],
            "type": "string"
          },
          "value_type": {
            "enum": [
              "text",
              "integer",
              "money",
              "timestamp",
              "url"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "value_type",
          "sensitive",
          "label",
          "group",
          "resource_types",
          "topic_codes",
          "channels",
          "usage"
        ],
        "type": "object"
      },
      "authoring.SMSContent": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "maxLength": 1600,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "authoring.SMSMetrics": {
        "additionalProperties": false,
        "properties": {
          "encoding": {
            "enum": [
              "GSM-7",
              "UCS-2"
            ],
            "type": "string"
          },
          "segments": {
            "maximum": 10,
            "minimum": 0,
            "type": "integer"
          },
          "units": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "encoding",
          "units",
          "segments"
        ],
        "type": "object"
      },
      "authoring.SaveBinding": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "channel": {
            "enum": [
              "email",
              "sms",
              "push"
            ],
            "type": "string"
          },
          "purpose_code": {
            "type": "string"
          },
          "template": {
            "$ref": "#/components/schemas/authoring.TemplateReference"
          },
          "topic_code": {
            "type": "string"
          }
        },
        "required": [
          "topic_code",
          "channel",
          "template",
          "active"
        ],
        "type": "object"
      },
      "authoring.SaveMessage": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "market_codes": {
            "items": {
              "maxLength": 100,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "type": "array",
            "uniqueItems": true
          },
          "retail_customer_numbers": {
            "items": {
              "maxLength": 100,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "review_token": {
            "type": "string"
          },
          "topic_code": {
            "description": "Offers \u0026 news (default, never SMS) or Service notices (operational; SMS only when urgency is critical).",
            "enum": [
              "offers_news",
              "service_notices"
            ],
            "type": "string"
          },
          "urgency": {
            "description": "Service notices only. Critical adds SMS to usable Australian mobiles.",
            "enum": [
              "normal",
              "critical"
            ],
            "type": "string"
          }
        },
        "required": [
          "retail_customer_numbers",
          "content"
        ],
        "type": "object"
      },
      "authoring.SaveTemplate": {
        "additionalProperties": false,
        "description": "All three localized labels and complete reviewed content. PUT updates an existing resource with If-Match; only POST assigns a new template code.",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "name": {
            "items": {
              "$ref": "#/components/schemas/authoring.LocalizedName"
            },
            "maxItems": 3,
            "minItems": 3,
            "type": "array"
          },
          "review_token": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "active",
          "content"
        ],
        "type": "object"
      },
      "authoring.SendPreview": {
        "additionalProperties": false,
        "properties": {
          "language_counts": {
            "additionalProperties": {
              "minimum": 0,
              "type": "integer"
            },
            "type": "object"
          },
          "preview": {
            "$ref": "#/components/schemas/authoring.Preview"
          },
          "recipient_count": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "revision": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "send_preview_token": {
            "type": "string"
          }
        },
        "required": [
          "preview",
          "recipient_count",
          "language_counts",
          "send_preview_token",
          "revision"
        ],
        "type": "object"
      },
      "authoring.SendRequest": {
        "additionalProperties": false,
        "properties": {
          "send_preview_token": {
            "type": "string"
          }
        },
        "required": [
          "send_preview_token"
        ],
        "type": "object"
      },
      "authoring.Template": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "code": {
            "pattern": "^[a-z][a-z0-9_-]{2,63}$",
            "type": "string"
          },
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "country_code": {
            "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "deleted_at": {
            "format": "date-time",
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "items": {
              "$ref": "#/components/schemas/authoring.LocalizedName"
            },
            "maxItems": 3,
            "minItems": 1,
            "type": "array"
          },
          "revision": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "country_code",
          "code",
          "name",
          "active",
          "revision",
          "content",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "authoring.TemplatePage": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/authoring.Template"
            },
            "type": "array"
          },
          "next_after_code": {
            "type": "string"
          }
        },
        "required": [
          "items",
          "next_after_code"
        ],
        "type": "object"
      },
      "authoring.TemplateReference": {
        "additionalProperties": false,
        "properties": {
          "country_code": {
            "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "published_version": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "template_code": {
            "pattern": "^[a-z][a-z0-9_-]{2,63}$",
            "type": "string"
          }
        },
        "required": [
          "country_code",
          "template_code",
          "published_version"
        ],
        "type": "object"
      },
      "authoring.TemplateVersion": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "country_code": {
            "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "published_by": {
            "type": "string"
          },
          "published_version": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "source_revision": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "template_code": {
            "pattern": "^[a-z][a-z0-9_-]{2,63}$",
            "type": "string"
          }
        },
        "required": [
          "country_code",
          "template_code",
          "published_version",
          "source_revision",
          "content",
          "published_at",
          "published_by"
        ],
        "type": "object"
      },
      "authoring.TranslateRequest": {
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "resource_type": {
                  "const": "template"
                }
              }
            },
            "then": {
              "required": [
                "name"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "resource_type": {
                  "const": "message"
                }
              }
            },
            "then": {
              "not": {
                "required": [
                  "name"
                ]
              },
              "required": [
                "resource_code"
              ]
            }
          }
        ],
        "description": "Template translate/review includes localized name; omit resource_code before server-assigned POST creation. Message requests require resource_code and prohibit name. Preview accepts name but does not render it.",
        "properties": {
          "content": {
            "$ref": "#/components/schemas/authoring.Content"
          },
          "country_code": {
            "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "name": {
            "items": {
              "$ref": "#/components/schemas/authoring.LocalizedName"
            },
            "maxItems": 3,
            "minItems": 1,
            "type": "array"
          },
          "resource_code": {
            "description": "Omit only before template creation. Required for existing template operations and all message operations.",
            "pattern": "^[a-z][a-z0-9_-]{2,63}$",
            "type": "string"
          },
          "resource_type": {
            "enum": [
              "template",
              "message"
            ],
            "type": "string"
          },
          "target_languages": {
            "items": {
              "enum": [
                "en",
                "zh-TW",
                "zh-CN"
              ],
              "type": "string"
            },
            "maxItems": 2,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          }
        },
        "required": [
          "country_code",
          "resource_type",
          "content"
        ],
        "type": "object"
      },
      "authoring.TranslationResponse": {
        "additionalProperties": false,
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/authoring.TranslationResult"
            },
            "maxItems": 2,
            "minItems": 1,
            "type": "array"
          },
          "source_fingerprint": {
            "type": "string"
          }
        },
        "required": [
          "source_fingerprint",
          "results"
        ],
        "type": "object"
      },
      "authoring.TranslationResult": {
        "additionalProperties": false,
        "properties": {
          "error_code": {
            "enum": [
              "TRANSLATION_UNAVAILABLE",
              "TRANSLATION_INVALID"
            ],
            "type": "string"
          },
          "language": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          },
          "name": {
            "description": "Translated template label for this language; present for successful template translation.",
            "maxLength": 100,
            "type": "string"
          },
          "variant": {
            "$ref": "#/components/schemas/authoring.Variant"
          }
        },
        "required": [
          "language"
        ],
        "type": "object"
      },
      "authoring.Variant": {
        "additionalProperties": false,
        "oneOf": [
          {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "sms"
                  ]
                },
                {
                  "required": [
                    "push"
                  ]
                }
              ]
            },
            "required": [
              "email"
            ]
          },
          {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "email"
                  ]
                },
                {
                  "required": [
                    "push"
                  ]
                }
              ]
            },
            "required": [
              "sms"
            ]
          },
          {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "email"
                  ]
                },
                {
                  "required": [
                    "sms"
                  ]
                }
              ]
            },
            "required": [
              "push"
            ]
          }
        ],
        "properties": {
          "email": {
            "$ref": "#/components/schemas/authoring.EmailContent"
          },
          "language": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          },
          "origin": {
            "enum": [
              "authored",
              "translated"
            ],
            "type": "string"
          },
          "push": {
            "$ref": "#/components/schemas/authoring.PushContent"
          },
          "review": {
            "$ref": "#/components/schemas/authoring.Review"
          },
          "sms": {
            "$ref": "#/components/schemas/authoring.SMSContent"
          }
        },
        "required": [
          "language"
        ],
        "type": "object"
      },
      "authoring.VersionPage": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/authoring.TemplateVersion"
            },
            "type": "array"
          },
          "next_before_version": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "items",
          "next_before_version"
        ],
        "type": "object"
      },
      "core.NotificationTopic": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "channels": {
            "items": {
              "$ref": "#/components/schemas/core.NotificationTopicChannel"
            },
            "type": "array"
          },
          "code": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "description": {
            "items": {
              "properties": {
                "description": {
                  "type": "string"
                },
                "language": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "items": {
              "$ref": "#/components/schemas/authoring.LocalizedName"
            },
            "type": "array"
          },
          "revision": {
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "core.NotificationTopicChannel": {
        "properties": {
          "channel": {
            "$ref": "#/components/schemas/notification_enums.NotificationChannel"
          },
          "consent_required": {
            "type": "boolean"
          },
          "default_enabled": {
            "type": "boolean"
          },
          "opt_out_allowed": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "core.PublishedNotification": {
        "properties": {
          "action_url": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "canonical_topic_code": {
            "description": "The customer-facing catalogue topic that governs this notification. Use it for labels, icons and grouping.",
            "enum": [
              "order_updates",
              "delivery_updates",
              "payments_documents",
              "gift_cards",
              "account_security",
              "back_in_stock",
              "wholesale_invite",
              "offers_news",
              "service_notices"
            ],
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "dismissed_at": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "image": {
            "$ref": "#/components/schemas/security.ObjectMedia"
          },
          "read_at": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/notification_enums.InAppNotificationStatus"
          },
          "title": {
            "type": "string"
          },
          "topic_code": {
            "description": "The code the notification was recorded under. Rows created before catalogue v2 keep their event-specific code.",
            "type": "string"
          },
          "topic_group": {
            "description": "Preference-centre group of canonical_topic_code.",
            "enum": [
              "order",
              "payment",
              "account",
              "product_updates",
              "promotions"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "github_com_Potato-Mart_Backend-Notification_internal_platform_apiresponse.Code": {
        "enum": [
          "INTERNAL_ERROR",
          "BAD_REQUEST",
          "VALIDATION_ERROR",
          "NOT_FOUND",
          "CONFLICT",
          "UNAUTHORIZED",
          "FORBIDDEN",
          "TOO_MANY_REQUESTS",
          "REQUEST_BODY_TOO_LARGE",
          "SERVICE_UNAVAILABLE",
          "AUTH_INVALID_CREDENTIALS",
          "AUTH_INVALID_TOKEN",
          "AUTH_EXPIRED_TOKEN",
          "AUTH_WRONG_PORTAL",
          "AUTH_ACCOUNT_DISABLED",
          "AUTH_MFA_REQUIRED",
          "AUTH_REAUTH_REQUIRED",
          "EMAIL_VERIFICATION_REQUIRED",
          "GIFT_DELIVERY_UNAVAILABLE",
          "GIFT_DELIVERY_RATE_LIMITED",
          "SECURITY_POLICY_VIOLATION",
          "IDENTITY_ACCOUNT_TYPE_NOT_ALLOWED",
          "IDENTITY_PORTAL_ACCESS_DENIED",
          "IDENTITY_PORTAL_ACCESS_REVOKED",
          "IDENTITY_ACCOUNT_SUSPENDED",
          "IDENTITY_AUTH_IDENTITY_DISABLED",
          "IDENTITY_MFA_REQUIRED",
          "IDENTITY_WHOLESALE_ORGANISATION_NOT_APPROVED",
          "IDENTITY_ORGANISATION_ACCESS_REQUIRED",
          "MEMBERSHIP_NOT_FOUND",
          "MEMBERSHIP_INACTIVE",
          "MEMBERSHIP_INSUFFICIENT_POINTS",
          "MEMBERSHIP_REWARD_UNAVAILABLE",
          "MEMBERSHIP_POINT_RESERVATION_EXPIRED",
          "USER_EMAIL_TAKEN",
          "SKU_CODE_TAKEN",
          "STORAGE_LOCATION_CODE_TAKEN",
          "PRODUCT_CODE_TAKEN",
          "STORAGE_MISMATCH",
          "INSUFFICIENT_STOCK",
          "ORDER_INVALID_TRANSITION",
          "ORDER_TERMINAL",
          "ORDER_EMPTY",
          "CART_NOT_ACTIVE",
          "DISCOUNT_NOT_FOUND",
          "DISCOUNT_INACTIVE",
          "DISCOUNT_NOT_STARTED",
          "DISCOUNT_EXPIRED",
          "DISCOUNT_EXHAUSTED",
          "DISCOUNT_MIN_NOT_MET",
          "DISCOUNT_CODE_TAKEN",
          "DISCOUNT_INAPPLICABLE",
          "TERMINAL_NOT_CONNECTED",
          "TERMINAL_NOT_REGISTERED",
          "TERMINAL_OUTCOME_UNKNOWN",
          "TERMINAL_SIGNATURE_FAIL",
          "TERMINAL_TIMEOUT",
          "TERMINAL_REQUEST_REJECTED",
          "TERMINAL_BUSY"
        ],
        "type": "string",
        "x-enum-varnames": [
          "CodeInternal",
          "CodeBadRequest",
          "CodeValidation",
          "CodeNotFound",
          "CodeConflict",
          "CodeUnauthorized",
          "CodeForbidden",
          "CodeTooManyRequests",
          "CodeRequestTooLarge",
          "CodeServiceUnavailable",
          "CodeAuthInvalidCredentials",
          "CodeAuthInvalidToken",
          "CodeAuthExpiredToken",
          "CodeAuthWrongPortal",
          "CodeAuthAccountDisabled",
          "CodeAuthMFARequired",
          "CodeAuthReauthRequired",
          "CodeEmailVerificationRequired",
          "CodeSecurityPolicyViolation",
          "CodeIdentityAccountTypeNotAllowed",
          "CodeIdentityPortalAccessDenied",
          "CodeIdentityPortalAccessRevoked",
          "CodeIdentityAccountSuspended",
          "CodeIdentityAuthIdentityDisabled",
          "CodeIdentityMFARequired",
          "CodeIdentityWholesaleOrganisationNotApproved",
          "CodeIdentityOrganisationAccessRequired",
          "CodeMembershipNotFound",
          "CodeMembershipInactive",
          "CodeMembershipInsufficientPoints",
          "CodeMembershipRewardUnavailable",
          "CodeMembershipPointReservationExpired",
          "CodeUserEmailTaken",
          "CodeSKUCodeTaken",
          "CodeStorageLocationCodeTaken",
          "CodeProductCodeTaken",
          "CodeStorageMismatch",
          "CodeInsufficientStock",
          "CodeOrderInvalidTransition",
          "CodeOrderTerminal",
          "CodeOrderEmpty",
          "CodeCartNotActive",
          "CodeDiscountNotFound",
          "CodeDiscountInactive",
          "CodeDiscountNotStarted",
          "CodeDiscountExpired",
          "CodeDiscountExhausted",
          "CodeDiscountMinNotMet",
          "CodeDiscountCodeTaken",
          "CodeDiscountInapplicable",
          "CodeTerminalNotConnected",
          "CodeTerminalNotRegistered",
          "CodeTerminalOutcomeUnknown",
          "CodeTerminalSignatureFail",
          "CodeTerminalTimeout",
          "CodeTerminalRequestRejected",
          "CodeTerminalBusy"
        ]
      },
      "github_com_Potato-Mart_Backend-Notification_internal_platform_apiresponse.Error": {
        "properties": {
          "code": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_apiresponse.Code"
          },
          "details": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse": {
        "properties": {
          "data": {},
          "error": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_apiresponse.Error"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "github_com_Potato-Mart_Backend-Notification_internal_platform_paging.PageResponse": {
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": "string"
          },
          "page": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          },
          "total_items": {
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "internal_modules_notifications.AuthMessageCommand": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "Code XOR Token: code for email_verification and federated_otp, token for\npassword_reset and wholesale_invite.",
            "type": "string"
          },
          "email": {
            "description": "Email is accepted for federated_otp ONLY: the OTP recipient lives on a\nchallenge record with no user. It is forbidden for every other purpose.",
            "maxLength": 320,
            "type": "string"
          },
          "event_id": {
            "description": "EventID is opaque and caller-derived (\"auth:\u003cpurpose\u003e:\u003ccredential-derived\nid\u003e\"), stable per minted credential so a transport retry replays instead\nof duplicating.",
            "maxLength": 200,
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "invite_id": {
            "description": "InviteID belongs to wholesale_invite only.",
            "maxLength": 200,
            "type": "string"
          },
          "locale": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          },
          "phone_e164": {
            "description": "Required only for phone_verification; transient and matched to Identity current phone. Forbidden for other purposes.",
            "pattern": "^\\+[1-9][0-9]{7,14}$",
            "type": "string"
          },
          "portal": {
            "description": "Optional originating portal for password_reset only. Selects an approved configured page; an unconfigured explicit portal returns 503. Omission preserves the generic reset page. storefront_code=events permits only an omitted or wholesale portal and selects the Events page. Caller URLs and credential operations are not accepted.",
            "enum": [
              "control",
              "retail",
              "wholesale"
            ],
            "type": "string"
          },
          "purpose": {
            "$ref": "#/components/schemas/internal_modules_notifications.AuthMessagePurpose"
          },
          "requested_at": {
            "format": "date-time",
            "type": "string"
          },
          "storefront_code": {
            "description": "Optional owned email destination; events is accepted for password_reset only and uses MAIL_EVENTS_RESET_URL_BASE. Empty retains the generic reset page. Caller URLs are not accepted.",
            "enum": [
              "events"
            ],
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "user_id": {
            "description": "UserID is required for email_verification and password_reset and MUST be\nempty for federated_otp and wholesale_invite.",
            "maxLength": 100,
            "type": "string"
          }
        },
        "required": [
          "event_id",
          "expires_at",
          "purpose",
          "requested_at"
        ],
        "type": "object"
      },
      "internal_modules_notifications.AuthMessagePurpose": {
        "enum": [
          "email_verification",
          "password_reset",
          "federated_otp",
          "wholesale_invite",
          "phone_verification"
        ],
        "type": "string",
        "x-enum-varnames": [
          "AuthPurposeEmailVerification",
          "AuthPurposePasswordReset",
          "AuthPurposeFederatedOTP",
          "AuthPurposeWholesaleInvite",
          "AuthPurposePhoneVerification"
        ]
      },
      "internal_modules_notifications.AuthMessageReceipt": {
        "properties": {
          "delivered": {
            "type": "boolean"
          },
          "event_id": {
            "type": "string"
          },
          "purpose": {
            "$ref": "#/components/schemas/internal_modules_notifications.AuthMessagePurpose"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "delivered",
          "event_id",
          "purpose",
          "replayed"
        ],
        "type": "object"
      },
      "internal_modules_notifications.GiftDeliveryResendReceipt": {
        "additionalProperties": false,
        "properties": {
          "recipient_delivery": {
            "$ref": "#/components/schemas/internal_modules_notifications.RecipientDelivery"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "recipient_delivery",
          "replayed"
        ],
        "type": "object"
      },
      "internal_modules_notifications.GiftDeliveryResendRequest": {
        "additionalProperties": false,
        "properties": {
          "idempotency_key": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "idempotency_key"
        ],
        "type": "object"
      },
      "internal_modules_notifications.GiftDeliveryResendResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_notifications.GiftDeliveryResendReceipt"
          },
          "success": {
            "const": true,
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "internal_modules_notifications.GiftDeliveryResponse": {
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_notifications.RecipientDelivery"
          },
          "success": {
            "const": true,
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "internal_modules_notifications.RecipientDelivery": {
        "additionalProperties": false,
        "properties": {
          "can_resend": {
            "type": "boolean"
          },
          "last_requested_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_sent_at": {
            "format": "date-time",
            "type": "string"
          },
          "retry_after_seconds": {
            "minimum": 1,
            "type": "integer"
          },
          "status": {
            "enum": [
              "sent",
              "queued",
              "failed",
              "not_requested",
              "unknown"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "can_resend"
        ],
        "type": "object"
      },
      "internal_modules_notifications.ServiceNoticeCommand": {
        "properties": {
          "action_path": {
            "description": "Optional storefront path starting with \"/\"; the recipient locale is prefixed.",
            "type": "string"
          },
          "body": {
            "items": {
              "$ref": "#/components/schemas/internal_modules_notifications.ServiceNoticeText"
            },
            "type": "array"
          },
          "country_code": {
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "issued_at": {
            "format": "date-time",
            "type": "string"
          },
          "market_codes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "notice_code": {
            "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$",
            "type": "string"
          },
          "title": {
            "items": {
              "$ref": "#/components/schemas/internal_modules_notifications.ServiceNoticeText"
            },
            "type": "array"
          },
          "urgency": {
            "enum": [
              "normal",
              "critical"
            ],
            "type": "string"
          }
        },
        "required": [
          "notice_code",
          "country_code",
          "urgency",
          "title",
          "body",
          "issued_at"
        ],
        "type": "object"
      },
      "internal_modules_notifications.ServiceNoticeReceipt": {
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "notice_code": {
            "type": "string"
          }
        },
        "required": [
          "notice_code",
          "accepted"
        ],
        "type": "object"
      },
      "internal_modules_notifications.ServiceNoticeText": {
        "properties": {
          "language": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "language",
          "text"
        ],
        "type": "object"
      },
      "internal_modules_notifications.authMessageReceiptResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_notifications.AuthMessageReceipt"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_notifications.notificationPageData": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/core.PublishedNotification"
            },
            "type": "array",
            "uniqueItems": false
          },
          "page": {
            "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_paging.PageResponse"
          }
        },
        "type": "object"
      },
      "internal_modules_notifications.notificationPageResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_notifications.notificationPageData"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_notifications.notificationResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/core.PublishedNotification"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_notifications.pushContentResponse": {
        "properties": {
          "data": {
            "properties": {
              "action_url": {
                "type": "string"
              },
              "body": {
                "type": "string"
              },
              "notification_id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "topic_code": {
                "type": "string"
              }
            },
            "required": [
              "notification_id",
              "topic_code",
              "title",
              "body"
            ],
            "type": "object"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "internal_modules_notifications.readCountData": {
        "properties": {
          "read_count": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "internal_modules_notifications.readCountResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_notifications.readCountData"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_notifications.serviceNoticeReceiptResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_notifications.ServiceNoticeReceipt"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "internal_modules_notifications.unreadCountData": {
        "properties": {
          "unread_count": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "internal_modules_notifications.unreadCountResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_notifications.unreadCountData"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_preferences.ConsentCommand": {
        "properties": {
          "channel": {
            "$ref": "#/components/schemas/notification_enums.NotificationChannel"
          },
          "destination_code": {
            "type": "string"
          },
          "granted": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_preferences.DeliveryContact": {
        "properties": {
          "availability": {
            "description": "available means an eligible current contact was resolved; unavailable means a completed lookup found no eligible contact; unknown means the contact could not be safely resolved; not_applicable means this purpose is not supported for the caller's account type. None grants consent or promises delivery.",
            "enum": [
              "available",
              "unavailable",
              "unknown",
              "not_applicable"
            ],
            "type": "string"
          },
          "channel": {
            "enum": [
              "email",
              "sms"
            ],
            "type": "string"
          },
          "masked_destination": {
            "description": "Present only when availability is available. Email exposes at most one local-part character and one domain character; legacy malformed values use an opaque mask. Australian mobile numbers expose only the country code and final four digits. Never contains the full contact.",
            "type": "string"
          },
          "purpose": {
            "enum": [
              "lifecycle",
              "marketing",
              "manual",
              "topic_notifications"
            ],
            "type": "string"
          },
          "source": {
            "description": "Present only when availability is available.",
            "enum": [
              "identity",
              "retail_profile"
            ],
            "type": "string"
          }
        },
        "required": [
          "channel",
          "purpose",
          "availability"
        ],
        "type": "object"
      },
      "internal_modules_preferences.EmailUnsubscribeRequest": {
        "properties": {
          "token": {
            "maxLength": 256,
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "type": "object"
      },
      "internal_modules_preferences.GetResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/preference.NotificationPreferences"
          },
          {
            "properties": {
              "delivery_contacts": {
                "description": "Current masked contact availability in stable order: email/lifecycle, email/marketing, email/manual, sms/topic_notifications. This is a GET-only projection, independent of channel elections, consent, provider configuration and delivery success. It does not identify the recipient of an already queued message. Wholesale supports lifecycle email only; the remaining entries are not_applicable. Peer failures leave independently resolvable entries intact and mark affected entries unknown without failing the preference read.",
                "items": {
                  "$ref": "#/components/schemas/internal_modules_preferences.DeliveryContact"
                },
                "maxItems": 4,
                "minItems": 4,
                "readOnly": true,
                "type": "array"
              }
            },
            "required": [
              "delivery_contacts"
            ],
            "type": "object"
          }
        ]
      },
      "internal_modules_preferences.UpdateRequest": {
        "properties": {
          "channels": {
            "description": "Choices are grouped by deliverable channel. Each channel contains topic\nswitches; omitted pairs use catalogue defaults. No channel master switch.",
            "items": {
              "$ref": "#/components/schemas/preference.NotificationChannelPreference"
            },
            "type": "array",
            "uniqueItems": false
          },
          "consents": {
            "description": "Consents carries decisions only. They are merged onto the stored evidence,\nnever replaced wholesale.",
            "items": {
              "$ref": "#/components/schemas/internal_modules_preferences.ConsentCommand"
            },
            "type": "array",
            "uniqueItems": false
          },
          "revision": {
            "description": "Revision is the revision the client read. The write is refused with 409\nunless it still matches the stored revision.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "internal_modules_preferences.getPreferenceResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/internal_modules_preferences.GetResponse"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "internal_modules_preferences.preferenceResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/preference.NotificationPreferences"
          },
          "success": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "notification_enums.InAppNotificationStatus": {
        "enum": [
          "unread",
          "read",
          "dismissed"
        ],
        "type": "string",
        "x-enum-varnames": [
          "InAppNotificationStatusUnread",
          "InAppNotificationStatusRead",
          "InAppNotificationStatusDismissed"
        ]
      },
      "notification_enums.NotificationChannel": {
        "enum": [
          "email",
          "push",
          "sms",
          "in_app",
          "social_media"
        ],
        "type": "string",
        "x-enum-varnames": [
          "NotificationChannelEmail",
          "NotificationChannelPush",
          "NotificationChannelSMS",
          "NotificationChannelInApp",
          "NotificationChannelSocialMedia"
        ]
      },
      "preference.NotificationChannelConsent": {
        "properties": {
          "actor": {
            "$ref": "#/components/schemas/security.ActorRef"
          },
          "changed_at": {
            "type": "string"
          },
          "channel": {
            "$ref": "#/components/schemas/notification_enums.NotificationChannel"
          },
          "destination_code": {
            "type": "string"
          },
          "granted": {
            "type": "boolean"
          },
          "policy_version": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "preference.NotificationChannelPreference": {
        "properties": {
          "channel": {
            "$ref": "#/components/schemas/notification_enums.NotificationChannel"
          },
          "topics": {
            "items": {
              "$ref": "#/components/schemas/preference.NotificationTopicPreference"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "preference.NotificationPreferences": {
        "properties": {
          "account_id": {
            "type": "string"
          },
          "channels": {
            "items": {
              "$ref": "#/components/schemas/preference.NotificationChannelPreference"
            },
            "type": "array",
            "uniqueItems": false
          },
          "classification": {
            "$ref": "#/components/schemas/security_enums.DataClassification"
          },
          "consents": {
            "items": {
              "$ref": "#/components/schemas/preference.NotificationChannelConsent"
            },
            "type": "array",
            "uniqueItems": false
          },
          "contains_pii": {
            "type": "boolean"
          },
          "contains_sensitive_pii": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "customer_number": {
            "type": "string"
          },
          "data_owner_id": {
            "type": "string"
          },
          "deleted_at": {
            "type": "string"
          },
          "deleted_by": {
            "type": "string"
          },
          "deletion_completed_at": {
            "type": "string"
          },
          "deletion_requested_at": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "protection_basis": {
            "$ref": "#/components/schemas/security_enums.DataProtectionBasis"
          },
          "retention_policy_key": {
            "type": "string"
          },
          "retention_until": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "updated_at": {
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "preference.NotificationTopicPreference": {
        "properties": {
          "destination_codes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "enabled": {
            "type": "boolean"
          },
          "topic_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "preferences.TopicCatalogueResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/preferences.TopicResponse"
            },
            "type": "array"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object"
      },
      "preferences.TopicResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/core.NotificationTopic"
          },
          {
            "properties": {
              "topic_group": {
                "description": "Service-owned presentation group. Every catalogue-v2 topic has a group; per-channel opt_out_allowed decides which choices are customer-controlled. Empty is retained only for compatibility.",
                "enum": [
                  "payment",
                  "order",
                  "receipt",
                  "product_updates",
                  "promotions",
                  "account",
                  ""
                ],
                "type": "string"
              }
            },
            "required": [
              "topic_group"
            ],
            "type": "object"
          }
        ]
      },
      "security.ActorRef": {
        "properties": {
          "actor_domain": {
            "$ref": "#/components/schemas/security_enums.IdentityDomain"
          },
          "actor_email": {
            "type": "string"
          },
          "actor_id": {
            "type": "string"
          },
          "actor_role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "security.ObjectMedia": {
        "properties": {
          "code": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "security_enums.DataClassification": {
        "enum": [
          "public",
          "internal",
          "confidential",
          "restricted"
        ],
        "type": "string",
        "x-enum-varnames": [
          "DataClassificationPublic",
          "DataClassificationInternal",
          "DataClassificationConfidential",
          "DataClassificationRestricted"
        ]
      },
      "security_enums.DataProtectionBasis": {
        "enum": [
          "not_applicable",
          "consent",
          "contract",
          "legal_obligation",
          "legitimate_interest"
        ],
        "type": "string",
        "x-enum-varnames": [
          "DataProtectionBasisNotApplicable",
          "DataProtectionBasisConsent",
          "DataProtectionBasisContract",
          "DataProtectionBasisLegalObligation",
          "DataProtectionBasisLegitimateInterest"
        ]
      },
      "security_enums.IdentityDomain": {
        "enum": [
          "customer",
          "workforce",
          "service"
        ],
        "type": "string",
        "x-enum-varnames": [
          "IdentityDomainCustomer",
          "IdentityDomainWorkforce",
          "IdentityDomainService"
        ]
      },
      "translation.Field": {
        "additionalProperties": false,
        "properties": {
          "format": {
            "default": "plain_text",
            "enum": [
              "plain_text",
              "markdown",
              "html"
            ],
            "type": "string"
          },
          "key": {
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*(?:[.-][A-Za-z0-9_]+|\\[[0-9]+\\])*$",
            "type": "string"
          },
          "label": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "text": {
            "maxLength": 5000,
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "text"
        ],
        "type": "object"
      },
      "translation.Request": {
        "additionalProperties": false,
        "description": "At most 5000 source code points and 256 translatable fragments in total. Omit targets for both other supported languages. Duplicate keys, source-as-target, unsupported markup and unsafe literal content are rejected. Label is UI metadata, not translated.",
        "properties": {
          "fields": {
            "items": {
              "$ref": "#/components/schemas/translation.Field"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array"
          },
          "source_language": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          },
          "target_languages": {
            "items": {
              "enum": [
                "en",
                "zh-TW",
                "zh-CN"
              ],
              "type": "string"
            },
            "maxItems": 2,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          }
        },
        "required": [
          "source_language",
          "fields"
        ],
        "type": "object"
      },
      "translation.Response": {
        "additionalProperties": false,
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/translation.Result"
            },
            "maxItems": 2,
            "minItems": 1,
            "type": "array"
          },
          "source_fingerprint": {
            "type": "string"
          }
        },
        "required": [
          "source_fingerprint",
          "results"
        ],
        "type": "object"
      },
      "translation.Result": {
        "additionalProperties": false,
        "properties": {
          "error_code": {
            "enum": [
              "TRANSLATION_UNAVAILABLE",
              "TRANSLATION_INVALID"
            ],
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/translation.TranslatedField"
            },
            "type": "array"
          },
          "language": {
            "enum": [
              "en",
              "zh-TW",
              "zh-CN"
            ],
            "type": "string"
          }
        },
        "required": [
          "language",
          "fields"
        ],
        "type": "object"
      },
      "translation.TranslatedField": {
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "text"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "description": "Backend-Identity-issued HS256 user JWT whose session_id is introspected with Identity on every protected request. Send as: `Bearer \u003ctoken\u003e`.",
        "in": "header",
        "name": "Authorization",
        "type": "apiKey"
      },
      "BulkControllerOIDCAuth": {
        "bearerFormat": "JWT",
        "description": "Google OIDC token with the exact bulk audience and verified allowlisted controller email.",
        "scheme": "bearer",
        "type": "http"
      },
      "PubSubPushOIDCAuth": {
        "bearerFormat": "JWT",
        "description": "Google-signed OIDC identity token whose audience and service-account email are verified for Pub/Sub push delivery.",
        "scheme": "bearer",
        "type": "http"
      },
      "ServiceBearerAuth": {
        "bearerFormat": "JWT",
        "description": "Service access token issued by Backend-Identity's client-credentials flow (aud=internal, route-specific scope).",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "externalDocs": {
    "description": "",
    "url": ""
  },
  "info": {
    "contact": {
      "name": "Potato Mart Platform Team"
    },
    "description": "Potato Mart Backend-Notification service. Owns the notification\naggregate for the whole platform: the durable customer inbox, the\npreference centre and its consent proofs, and the email, push, SMS,\nand social delivery channels.\nNotifications are DERIVED, never dictated: callers supply stable\nbusiness identifiers only, and this service resolves the recipient,\nthe preference policy, the localized copy, and the destination from\nprotected service-owned data. Domain facts arrive on OIDC-verified\nPub/Sub push receivers; preference changes are published through the\ntransactional outbox by the bounded outbox-relay job.\nProvider transports run exclusively in the fenced\nnotification-delivery maintenance job, so the request-serving\nrevision cannot send a message even if a handler tried to.\nEvery response uses the shared envelope\n`{ \"success\": bool, \"data\": ..., \"error\": ... }`.",
    "license": {
      "name": "Proprietary"
    },
    "title": "Backend-Notification API",
    "version": "53.8.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/audit-logs": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List audit log entries with filters and pagination",
        "tags": [
          "audit"
        ]
      }
    },
    "/content-translations": {
      "post": {
        "description": "Requires a current workforce session and explicit content.translate. Stateless: no business-record read, persistence, publish or send. Five requests/minute per actor per instance. Protected placeholders, URLs, markup and code stay server-side; only ordered text fragments reach the provider. Partial per-language errors preserve existing edits. Generic translation uses the configured authoring provider; unavailable returns503. Owning form APIs retain their independent create/write permissions.",
        "operationId": "postStructuredContentTranslation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/translation.Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/translation.Response"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Translate structured authored fields for human review",
        "tags": [
          "content-translation"
        ]
      }
    },
    "/notification-authoring/capabilities": {
      "get": {
        "description": "Requires a current workforce session and notification_template.read or notification_message.read. Country is independent of locale. Only geographic_scope JWT paths are consumed. Country-wide template mutations require a full country grant or superAdmin; market/state/depot targets do not expand into country grants. ",
        "operationId": "getNotificationAuthoringCapabilities",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.Capabilities"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Read authoring countries, topics and capabilities",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-authoring/preview": {
      "post": {
        "description": "Requires a current workforce session and the resource write permission, or both template read and publish for a template approval preview. Country is independent of locale. Never renders a selected customer or real credential. Returns a 15-minute receipt bound to actor/context and all render-affecting content, including styles and links. SMS counts follow substitution, including GSM extensions and UTF-16 units.",
        "operationId": "postNotificationAuthoringPreview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.ContentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.Preview"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Render all languages with synthetic values",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-authoring/review": {
      "post": {
        "description": "Requires a current workforce session and the resource write permission. Country is independent of locale. Both non-source languages must be explicitly confirmed. Returns server review evidence and a 24-hour signed receipt bound to actor/country/resource/source/final target text. Source/target edits invalidate evidence; visual-only edits preserve it. Template requests include name; review signs all three localized labels together with content. Omit resource_code only before POST template creation.",
        "operationId": "postNotificationAuthoringReview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.ReviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.ReviewResponse"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Confirm both final translations without saving",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-authoring/translate": {
      "post": {
        "description": "Requires a current workforce session and notification_template.translate plus the resource write permission. Country is independent of locale. Only geographic_scope JWT paths are consumed. Country-wide template mutations require a full country grant or superAdmin; market/state/depot targets do not expand into country grants. No save, review or send. At most two target languages; partial per-language failure preserves the editor. Source-only unrendered text is screened for personal details/private links. Five requests per minute per actor per serving instance plus provider quotas. Discard late responses after local source edits. Template requests include name; review signs all three localized labels together with content. Omit resource_code only before POST template creation.",
        "operationId": "postNotificationAuthoringTranslate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.TranslateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.TranslationResponse"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Generate editable translation candidates",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-message-recipients/{country}": {
      "get": {
        "description": "Requires a current workforce session and notification_recipient.read. Country is independent of locale. Orders validates the transient original staff JWT and live session. Only current eligible customer references and display names are returned. No contact details or order payload. A short page can still carry a continuation cursor.",
        "operationId": "getNotificationMessageRecipientsCountry",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Optional comma-separated narrowing filter; marketing defaults to its signed assigned markets.",
            "in": "query",
            "name": "market_codes",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.RecipientPage"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Find retail recipients through authorised orders",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-messages/{country}": {
      "get": {
        "description": "Requires a current workforce session and notification_message.read. Country is independent of locale. Marketing sees only its own messages within its current assigned markets. Country/global staff are bounded by the selected country.",
        "operationId": "getNotificationMessagesCountry",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "after_code",
            "required": false,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.MessagePage"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List selected-customer message summaries",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-messages/{country}/{code}": {
      "delete": {
        "description": "Requires notification_message.write and notification_recipient.read and the same geographic scope as the corresponding write. The record is soft-deleted and its code remains reserved. A published template or accepted message cannot be deleted.",
        "operationId": "deleteNotificationMessagesCountryCode",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          },
          {
            "description": "Exact quoted revision.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "pattern": "^\"[1-9][0-9]*\"$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Record deleted"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid or inactive session"
          },
          "403": {
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "description": "Record not found"
          },
          "409": {
            "description": "Stale revision or record is ineligible for deletion"
          },
          "428": {
            "description": "Required precondition missing"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "503": {
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete a draft customer message",
        "tags": [
          "notification-authoring"
        ]
      },
      "get": {
        "description": "Requires a current workforce session and notification_message.read. Country is independent of locale. Rechecks exact recipient order eligibility. No email, telephone, token or provider destination is returned.",
        "operationId": "getNotificationMessagesCountryCode",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.Message"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted mutable revision.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Read an authorised message",
        "tags": [
          "notification-authoring"
        ]
      },
      "put": {
        "description": "Requires a current workforce session and notification_message.write and notification_recipient.read. Country is independent of locale. Only geographic_scope JWT paths are consumed. Country-wide template mutations require a full country grant or superAdmin; market/state/depot targets do not expand into country grants. Exactly one email/SMS/push channel and 1..100 unique retail references. Uses announcement marketing consent; email requires protected unsubscribe as the last block. Rechecks Orders and current customer identities. Accepted messages are immutable.",
        "operationId": "putNotificationMessagesCountryCode",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          },
          {
            "description": "Exact quoted revision returned in ETag. Missing precondition returns 428; stale revision returns 409.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "pattern": "^\"[1-9][0-9]*\"$",
              "type": "string"
            }
          },
          {
            "description": "Use * to create, mutually exclusive with If-Match.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "enum": [
                "*"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.SaveMessage"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.Message"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted mutable revision.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Save a reviewed selected-customer draft",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-messages/{country}/{code}/preview-send": {
      "post": {
        "description": "Requires a current workforce session and notification_message.send and notification_recipient.read. Country is independent of locale. Only geographic_scope JWT paths are consumed. Country-wide template mutations require a full country grant or superAdmin; market/state/depot targets do not expand into country grants. No send. Receipt includes exact draft revision, markets, recipient identities and their current locales. Send requires a new preview if any of these change.",
        "operationId": "postNotificationMessagesCountryCodePreviewSend",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          },
          {
            "description": "Exact quoted revision returned in ETag. Missing precondition returns 428; stale revision returns 409.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "pattern": "^\"[1-9][0-9]*\"$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.SendPreview"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Review recipient language counts and synthetic content",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-messages/{country}/{code}/send": {
      "post": {
        "description": "Requires a current workforce session and notification_message.send and notification_recipient.read. Country is independent of locale. Only geographic_scope JWT paths are consumed. Country-wide template mutations require a full country grant or superAdmin; market/state/depot targets do not expand into country grants. Requires enabled channel and manual-send capability. Rechecks current exact-set Orders eligibility immediately before transaction. Records immutable content and per-recipient locale with the queue in one transaction. Acceptance is not delivery confirmation. Workers recheck current consent, active identity and destination; no translation occurs during delivery.",
        "operationId": "postNotificationMessagesCountryCodeSend",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          },
          {
            "description": "Exact quoted revision returned in ETag. Missing precondition returns 428; stale revision returns 409.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "pattern": "^\"[1-9][0-9]*\"$",
              "type": "string"
            }
          },
          {
            "description": "Stable key for this acceptance command. Exact replay returns its receipt; another key or revision conflicts.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.SendRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.Message"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted mutable revision.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Accept a message and queue its deliveries atomically",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-preferences": {
      "get": {
        "description": "Returns the authenticated customer's effective preferences. A customer who has never saved preferences receives the resolved catalogue defaults rather than a 404. Includes GET-only masked delivery_contacts for current recipient sources. Contact lookup failures produce unknown availability while the preference read remains successful. Contact availability is independent of consent and choices.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_preferences.getPreferenceResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get the caller's notification preferences",
        "tags": [
          "preferences"
        ]
      },
      "put": {
        "description": "Compare-and-set on revision using channels containing only their deliverable topics. Rejects obsolete topic-first input and channel master switches. Mandatory topic/channel pairs are pinned to catalogue defaults. Consent-required enabled pairs require granted consent, with explicit destination_codes and destination consent for social media. Identity and consent evidence are server-owned. No-op writes preserve revision and emit no event. Read-only delivery_contacts submitted from a GET response are ignored and are not included in the PUT response.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_preferences.UpdateRequest",
                    "description": "Desired preferences and the revision they were read at",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Desired preferences and the revision they were read at",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_preferences.preferenceResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Replace the caller's notification preferences",
        "tags": [
          "preferences"
        ]
      }
    },
    "/notification-template-bindings/{country}": {
      "get": {
        "description": "Requires a current workforce session and notification_template.read. Country is independent of locale. ",
        "operationId": "getNotificationTemplateBindingsCountry",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "after_id",
            "required": false,
            "schema": {
              "pattern": "^[0-9a-f]{24}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.BindingPage"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List exact topic/channel/purpose bindings",
        "tags": [
          "notification-authoring"
        ]
      },
      "put": {
        "description": "Requires a current workforce session and notification_template.bind. Country is independent of locale. Publication country/channel must match. Omitted purpose means ordinary, never wildcard. Required protected sections are validated. Previously accepted delivery snapshots never change.",
        "operationId": "putNotificationTemplateBindingsCountry",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "description": "Exact quoted revision returned in ETag. Missing precondition returns 428; stale revision returns 409.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "pattern": "^\"[1-9][0-9]*\"$",
              "type": "string"
            }
          },
          {
            "description": "Use * to create, mutually exclusive with If-Match.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "enum": [
                "*"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.SaveBinding"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.Binding"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted mutable revision.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create or update a topic binding",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-templates/{country}": {
      "get": {
        "description": "Requires a current workforce session and notification_template.read. Country is independent of locale. ",
        "operationId": "getNotificationTemplatesCountry",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "after_code",
            "required": false,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.TemplatePage"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List country templates",
        "tags": [
          "notification-authoring"
        ]
      },
      "post": {
        "description": "Requires current workforce session and notification_template.write in the country. Send complete localized name/content with a precreation review_token. Idempotency-Key binds actor, country and original payload; exact retry returns the same current resource, conflicting payload returns409. No client code or revision preconditions. Returns ETag and Location.",
        "operationId": "postNotificationTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "description": "Stable retry key; not a resource code.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 16,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.CreateTemplate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.Template"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted mutable revision.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a reviewed template with a server-assigned code",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-templates/{country}/{code}": {
      "delete": {
        "description": "Requires notification_template.write and the same geographic scope as the corresponding write. The record is soft-deleted and its code remains reserved. A published template or accepted message cannot be deleted.",
        "operationId": "deleteNotificationTemplatesCountryCode",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          },
          {
            "description": "Exact quoted revision.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "pattern": "^\"[1-9][0-9]*\"$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Record deleted"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid or inactive session"
          },
          "403": {
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "description": "Record not found"
          },
          "409": {
            "description": "Stale revision or record is ineligible for deletion"
          },
          "428": {
            "description": "Required precondition missing"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "503": {
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete an unpublished template",
        "tags": [
          "notification-authoring"
        ]
      },
      "get": {
        "description": "Requires a current workforce session and notification_template.read. Country is independent of locale. ",
        "operationId": "getNotificationTemplatesCountryCode",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.Template"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted mutable revision.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Read a template definition",
        "tags": [
          "notification-authoring"
        ]
      },
      "put": {
        "description": "Requires notification_template.write in the country. Update only, using If-Match. All three localized names participate in the review receipt. Create through POST /notification-templates/{country}; If-None-Match is rejected.",
        "operationId": "putNotificationTemplatesCountryCode",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          },
          {
            "description": "Exact quoted revision of an existing template. Client-assigned creation is not supported.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "pattern": "^\"[1-9][0-9]*\"$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.SaveTemplate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.Template"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted mutable revision.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update an existing reviewed template",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-templates/{country}/{code}/publish": {
      "post": {
        "description": "Requires a current workforce session and notification_template.publish. Country is independent of locale. Requires a preview of the exact saved content. Repeating publication of the same revision returns the same immutable version. Publication does not activate a topic binding.",
        "operationId": "postNotificationTemplatesCountryCodePublish",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          },
          {
            "description": "Exact quoted revision returned in ETag. Missing precondition returns 428; stale revision returns 409.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "pattern": "^\"[1-9][0-9]*\"$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/authoring.PublishRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.TemplateVersion"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Publish an immutable template version",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-templates/{country}/{code}/versions": {
      "get": {
        "description": "Requires a current workforce session and notification_template.read. Country is independent of locale. ",
        "operationId": "getNotificationTemplatesCountryCodeVersions",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "before_version",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.VersionPage"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List immutable publications",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-templates/{country}/{code}/versions/{version}": {
      "get": {
        "description": "Requires a current workforce session and notification_template.read. Country is independent of locale. ",
        "operationId": "getNotificationTemplatesCountryCodeVersionsVersion",
        "parameters": [
          {
            "in": "path",
            "name": "country",
            "required": true,
            "schema": {
              "description": "Canonical ISO 3166-1 alpha-2 country, independently authorised from locale.",
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[a-z][a-z0-9_-]{2,63}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/authoring.TemplateVersion"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Invalid or inactive session"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Permission or geographic scope denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Record not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Stale review, preview, revision or command"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Request too large"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Required precondition missing"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Dependency or capability unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Read an immutable publication",
        "tags": [
          "notification-authoring"
        ]
      }
    },
    "/notification-topics": {
      "get": {
        "description": "The backend-managed topic catalogue with its per-channel policy, used to render the preference centre. topic_group supplies optional presentation grouping; an empty group identifies a mandatory topic. Channel choices are pinned to their default_enabled value when opt_out_allowed is false.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/preferences.TopicCatalogueResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List the active notification topics",
        "tags": [
          "preferences"
        ]
      }
    },
    "/notifications": {
      "get": {
        "description": "Returns one cursor-paginated page of the authenticated buyer's own inbox: active unread and read rows, until dismissal or retention expiry. Portal-suppressed rows (gift-card emails, for example) never appear.",
        "parameters": [
          {
            "description": "Page number",
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Page size (max 200)",
            "in": "query",
            "name": "page_size",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Opaque keyset continuation token from a previous page",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort direction",
            "in": "query",
            "name": "order",
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "description": "Include total counts (default true)",
            "in": "query",
            "name": "include_total",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_notifications.notificationPageResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List my notifications",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/read-all": {
      "post": {
        "description": "Marks every visible unread row of the authenticated buyer as read and returns how many changed. Repeating the request is idempotent and reports zero.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_notifications.readCountResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Mark all my notifications as read",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/unread-count": {
      "get": {
        "description": "Counts the authenticated buyer's visible unread rows. Used for the inbox badge, so it never loads row content.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_notifications.unreadCountResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Count my unread notifications",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/unsubscribe": {
      "post": {
        "description": "Redeems a one-use opaque email token. Valid, invalid, unknown, expired, and already-redeemed tokens receive the same success response.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "$ref": "#/components/schemas/internal_modules_preferences.EmailUnsubscribeRequest",
                    "description": "Opaque unsubscribe token",
                    "summary": "body"
                  }
                ]
              }
            }
          },
          "description": "Opaque unsubscribe token",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Unsubscribe from one marketing email topic",
        "tags": [
          "preferences"
        ]
      }
    },
    "/notifications/{id}": {
      "delete": {
        "description": "Removes a single owned unread or read row from the inbox. Repeating the request is idempotent and preserves the first dismissal timestamp. A row owned by anybody else is reported as 404.",
        "parameters": [
          {
            "description": "Notification id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_notifications.notificationResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Dismiss one of my notifications",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/{id}/push-content": {
      "get": {
        "description": "Resolves exact-ID display content for the authenticated retail owner. Includes eligible push-only records without adding them to the inbox. Read, dismissed, expired, protected or opted-out notifications return 404. Eligibility outages return 503. Never returns recipients, credentials or provider metadata.",
        "parameters": [
          {
            "description": "Notification id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_notifications.pushContentResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Resolve my push notification content",
        "tags": [
          "notifications"
        ]
      }
    },
    "/notifications/{id}/read": {
      "post": {
        "description": "Marks a single owned row read and returns it. Repeating the request is idempotent and preserves the first read timestamp. A row owned by anybody else is reported as 404, never as 403, so the endpoint cannot be used to probe for other customers' notification ids.",
        "parameters": [
          {
            "description": "Notification id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internal_modules_notifications.notificationResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/github_com_Potato-Mart_Backend-Notification_internal_platform_httpx.APIResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Mark one of my notifications as read",
        "tags": [
          "notifications"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "/v1"
    }
  ]
}
