{
  "openapi": "3.1.0",
  "info": {
    "title": "Mementom Marketing API",
    "version": "1.0.0",
    "description": "Server API for integrating marketing automation and MCP tools with authorized company apps. External clients and the marketing console share one validation/persistence path. Scoped Bearer credentials are bound to a company, active staff membership and one application. Aster is a replaceable teaching example, not a required application or API dependency. Resolve real company/application IDs, insight definitions and versions from the selected workspace and provide company-specific content and landing URLs. Draft planning, permission-aware aggregate counts and reports are available. The separately documented Marketing MCP server uses these operations. Every tool adapter must preserve current membership, scope, revision and privacy checks."
  },
  "servers": [
    {
      "url": "https://mementom.app/api/v1/marketing",
      "description": "Public application service. Do not send marketing credentials to the separately served authorization origin."
    }
  ],
  "tags": [
    {
      "name": "Credentials"
    },
    {
      "name": "Workspace"
    },
    {
      "name": "Drafts"
    },
    {
      "name": "Campaign email"
    },
    {
      "name": "Measurement"
    },
    {
      "name": "Diagnostics"
    }
  ],
  "security": [
    {
      "marketingBearer": []
    }
  ],
  "paths": {
    "/api-tokens": {
      "get": {
        "tags": [
          "Credentials"
        ],
        "operationId": "listMarketingCredentials",
        "summary": "List API credentials visible to this staff account",
        "description": "Console session only. Owners/admins see company credentials; marketers see their own. Secrets are never returned.",
        "security": [
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        }
      },
      "post": {
        "tags": [
          "Credentials"
        ],
        "operationId": "issueMarketingCredential",
        "summary": "Issue a scoped, expiring server credential",
        "description": "Console session plus same-origin write protection. Secret returned once, no-store. It is bound to the current company, application and issuing staff account. A Bearer credential cannot mint another credential.",
        "security": [
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialIssued"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialIssue"
              },
              "example": {
                "applicationId": "app_your_company",
                "label": "Marketing automation",
                "scopes": [
                  "marketing:read",
                  "marketing:audiences:write",
                  "marketing:content:write",
                  "marketing:campaigns:write"
                ],
                "expiresInDays": 30
              }
            }
          }
        }
      }
    },
    "/api-tokens/{tokenId}": {
      "parameters": [
        {
          "name": "tokenId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^mkt_[a-f0-9]{32}$"
          }
        }
      ],
      "delete": {
        "tags": [
          "Credentials"
        ],
        "operationId": "revokeMarketingCredential",
        "summary": "Revoke a credential",
        "description": "Console session and same-origin write. Idempotent for an already-revoked visible credential. Owner/admin can revoke company credentials; marketers can revoke their own.",
        "security": [
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        }
      }
    },
    "/applications": {
      "get": {
        "tags": [
          "Workspace"
        ],
        "operationId": "listMarketingApplications",
        "summary": "List accessible applications",
        "description": "Bearer result contains only its one active bound application. Console session result contains the active applications accessible in that company.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:read"
      }
    },
    "/applications/{applicationId}/workspace": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "get": {
        "tags": [
          "Workspace"
        ],
        "operationId": "getMarketingWorkspace",
        "summary": "Read marketing workspace and current revision",
        "description": "Read current IDs, definition versions, saved drafts, capabilities and provenance. This is the same workspace used by the marketing console.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:read"
      }
    },
    "/applications/{applicationId}/workspace/audiences": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "saveMarketingAudience",
        "summary": "Create or replace an audience",
        "description": "Omit audienceId to create; supply it to edit. Simple and structured criteria share the console validator. Every accepted mutation returns the complete current marketing workspace. Replace illustrative IDs and expectedRevision with values read from that application. Aster values in examples teach the message flow only. Replace their definition IDs/values, record names, content and landing URL with registered values for your own company.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:audiences:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudienceMutation"
              },
              "example": {
                "expectedRevision": 0,
                "payload": {
                  "name": "Visitors who authorized entry",
                  "mode": "all",
                  "rules": [
                    {
                      "definitionId": "aster_activity_definition_id",
                      "version": 1,
                      "operator": "equals",
                      "value": "entry_authorized"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/content": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "saveMarketingContent",
        "summary": "Create, revise or duplicate saved content",
        "description": "Content revisions are separate from the workspace revision. Copy the complete author-controlled fields when selecting a saved edition in a campaign. Every accepted mutation returns the complete current marketing workspace. Replace illustrative IDs and expectedRevision with values read from that application. Aster values in examples teach the message flow only. Replace their definition IDs/values, record names, content and landing URL with registered values for your own company.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:content:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentMutation"
              },
              "example": {
                "expectedRevision": 0,
                "payload": {
                  "name": "Next service invitation",
                  "type": "offer",
                  "content": {
                    "headline": "Ready for the next step?",
                    "body": "Explore the next service option for your home.",
                    "cta": "See options",
                    "landingUrl": "https://mementom.app/aster/",
                    "image": ""
                  },
                  "questions": [],
                  "requestedInsightIds": []
                }
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/campaigns": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "createMarketingCampaign",
        "summary": "Create or update a campaign draft",
        "description": "Creates a draft, or edits an existing draft using campaignId and expectedCampaignRevision. Published creative is immutable; duplicate it to make changes. Publishing uses its separate operation and permission. Returns the current workspace.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignMutation"
              },
              "example": {
                "expectedRevision": 0,
                "payload": {
                  "schemaVersion": 2,
                  "name": "Next service follow-up",
                  "objective": "return_visitors",
                  "startAt": null,
                  "endAt": null,
                  "budgetMinor": 10000,
                  "dailyCapMinor": 1000,
                  "responseWindowHours": 72,
                  "engagements": [
                    {
                      "name": "Next service invitation",
                      "type": "offer",
                      "content": {
                        "headline": "Ready for the next step?",
                        "body": "Explore the next service option for your home.",
                        "cta": "See options",
                        "landingUrl": "https://mementom.app/aster/",
                        "image": ""
                      },
                      "questions": [],
                      "requestedInsightIds": [],
                      "audienceIds": [
                        "saved_audience_id"
                      ],
                      "excludedAudienceIds": [],
                      "refinements": [],
                      "engagementMinor": 100,
                      "purchaseMinor": 0,
                      "contentId": "saved_content_id",
                      "contentRevision": 1
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/pricing": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "saveMarketingPricing",
        "summary": "Set planning assumptions",
        "description": "Policy or one outside insight profile per write. Recomputes audience planning prices and marks existing campaign drafts pricingChanged. Every accepted mutation returns the complete current marketing workspace. Replace illustrative IDs and expectedRevision with values read from that application. Aster values in examples teach the message flow only. Replace their definition IDs/values, record names, content and landing URL with registered values for your own company.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:pricing:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PricingMutation"
              },
              "example": {
                "expectedRevision": 0,
                "payload": {
                  "policy": {
                    "schemaVersion": 1,
                    "brandTier": "pro",
                    "marketTier": "retail",
                    "baseCPA": 5
                  }
                }
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/proposals": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "proposeMarketingInsight",
        "summary": "Propose a non-identifying insight",
        "description": "Creates a pending_review definition. It cannot be used for matching until reviewed. Standard template registration, approval and ingestion remain developer operations. Every accepted mutation returns the complete current marketing workspace. Replace illustrative IDs and expectedRevision with values read from that application. Aster values in examples teach the message flow only. Replace their definition IDs/values, record names, content and landing URL with registered values for your own company.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:insights:propose",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProposalMutation"
              },
              "example": {
                "expectedRevision": 0,
                "payload": {
                  "key": "service.followup_interest",
                  "label": "Follow-up interest",
                  "description": "Whether someone is interested in another service visit.",
                  "type": "boolean",
                  "windowDays": 30,
                  "ttlDays": 30
                }
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/objective": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "saveMarketingObjective",
        "summary": "Set the workspace objective",
        "description": "Changes workspace suggestions; campaign objectives are selected separately. Every accepted mutation returns the complete current marketing workspace. Replace illustrative IDs and expectedRevision with values read from that application. Aster values in examples teach the message flow only. Replace their definition IDs/values, record names, content and landing URL with registered values for your own company.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:objective:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ObjectiveMutation"
              },
              "example": {
                "expectedRevision": 0,
                "payload": {
                  "objective": "return_visitors"
                }
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/count": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Measurement"
        ],
        "operationId": "countMarketingAudience",
        "summary": "Count currently eligible matching holders",
        "description": "Read-only current permitted matching. Accept a single audience or an inclusion/exclusion set. Returns exact logical count, individual condition counts and allocated per-action spend; source/result cohort controls apply to similarity. Campaign snapshots and current consent are preserved. Never exports individual identities.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CountRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CountSetRequest"
                  }
                ]
              },
              "example": {
                "expectedRevision": 0,
                "audience": {
                  "name": "Visitors who authorized entry",
                  "mode": "all",
                  "rules": [
                    {
                      "definitionId": "aster_activity_definition_id",
                      "version": 1,
                      "operator": "equals",
                      "value": "entry_authorized"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/report": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "get": {
        "tags": [
          "Measurement"
        ],
        "operationId": "getMarketingReport",
        "summary": "Read aggregate campaign results",
        "description": "Choose live or explicitly synthetic test data. No mutation is performed. A draft has no live delivery; modeled spend is never settled payment. Keep report mode and limitations visible.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:read",
        "parameters": [
          {
            "name": "campaignId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "test"
              ],
              "default": "live"
            }
          },
          {
            "name": "landingLimit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "landingCursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Continue from landingPage.nextCursor using the same application and campaign."
          }
        ]
      }
    },
    "/applications/{applicationId}/workspace/activity": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "get": {
        "tags": [
          "Diagnostics"
        ],
        "operationId": "getMarketingActivity",
        "summary": "Read safe marketing request traces",
        "description": "Application/company-scoped operational trace. Use x-mementom-activity-id from the response to correlate a request. No secrets, raw content or consumer records are returned.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:read",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "maximum": 10000
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "activityId",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^mact_[A-Za-z0-9_-]+$"
            }
          }
        ]
      }
    },
    "/applications/{applicationId}/workspace/campaignpublish": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "publishMarketingCampaign",
        "summary": "Publish or resume a validated campaign",
        "description": "Publish or resume a validated campaign. Requires current workspace and campaign revisions. Never automatically replay an uncertain write.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:publish",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignIdentityMutation"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/campaignstate": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "setMarketingCampaignState",
        "summary": "Pause or stop a published campaign",
        "description": "Pause or stop a published campaign. Requires current workspace and campaign revisions. Never automatically replay an uncertain write.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignStateMutation"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/campaigndelete": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "deleteMarketingCampaign",
        "summary": "Delete a campaign while retaining history",
        "description": "Delete a campaign while retaining history. Requires current workspace and campaign revisions. Never automatically replay an uncertain write.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignIdentityMutation"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/campaignduplicate": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "duplicateMarketingCampaign",
        "summary": "Create an independent editable draft copy",
        "description": "Create an independent editable draft copy. Requires current workspace and campaign revisions. Never automatically replay an uncertain write.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignDuplicateMutation"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/campaignaudiences": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "setMarketingCampaignAudiences",
        "summary": "Set the included and excluded campaign audiences",
        "description": "Set the included and excluded campaign audiences. Requires current workspace and campaign revisions. Never automatically replay an uncertain write.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignAudiencesMutation"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/campaignsettings": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "updateMarketingCampaignSettings",
        "summary": "Update a setting on a launched campaign",
        "description": "Update a setting on a launched campaign. Requires current workspace, campaign, and targeting revisions. Set the campaign minimum CVB rating, or amend offer copy or the response window for an eligible single-offer campaign. A paused campaign remains paused. Existing deliveries retain their published copy and response window.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignSettingsMutation"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/emailaliases": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Campaign email"
        ],
        "operationId": "listMarketingCampaignEmailAddresses",
        "summary": "List campaign relay addresses",
        "description": "Request the current opaque recipient relay addresses only when explicitly requested. Matching and current application authority are checked before addresses are returned. This request sends no email.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignRelayAddresses"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRelayRequest"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/emailbroadcast": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Campaign email"
        ],
        "operationId": "getMarketingCampaignEmailBroadcastAddress",
        "summary": "Get one campaign broadcast relay address",
        "description": "Request one opaque campaign relay address for the company to use in its own email provider. Current company access and recipient eligibility apply. This request sends no email.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignRelayBroadcast"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRelayRequest"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/emailchecklist": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Campaign email"
        ],
        "operationId": "getMarketingCampaignEmailChecklist",
        "summary": "Read the campaign relay checklist",
        "description": "Read current opaque relay addresses and their manual handling markers. A checkmark is bookkeeping and is never proof of delivery.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignRelayChecklist"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRelayRequest"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/emailrecipienthandled": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Campaign email"
        ],
        "operationId": "setMarketingCampaignEmailRecipientHandled",
        "summary": "Set a manual relay checklist marker",
        "description": "Set or clear the manual marker for one current relay address in the specified campaign. A stale or out-of-scope relay cannot be marked. This action sends no email and records no delivery.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignRelayRecipientHandled"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRelayRecipientHandledRequest"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/campaignaudience": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "editMarketingCampaignAudience",
        "summary": "Edit an attached published campaign audience",
        "description": "Edit an attached published campaign audience. Requires current workspace and campaign revisions. Never automatically replay an uncertain write.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignAudienceMutation"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/reportcomparison": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "get": {
        "tags": [
          "Measurement"
        ],
        "operationId": "getMarketingCampaignComparison",
        "summary": "Compare campaign performance",
        "description": "Compare campaign participations, which may include the same person in more than one campaign. Omit campaignIds to select current nondeleted campaigns; explicit same-application deleted IDs remain reportable. Rates use summed numerators and denominators, with separate mature windows. Costs are modeled and revenue may be unknown. Unknown, empty or duplicate IDs and repeated or unknown query keys are rejected.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignComparison"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:read",
        "parameters": [
          {
            "name": "campaignIds",
            "in": "query",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1,
              "uniqueItems": true
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "test"
              ],
              "default": "live"
            }
          }
        ]
      }
    },
    "/applications/{applicationId}/workspace/products": {
      "get": {
        "summary": "List or search authoritative company products",
        "operationId": "marketing_products",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApplicationId"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sku",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "color",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived"
              ]
            }
          },
          {
            "name": "available",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        },
        "x-required-scope": "marketing:read"
      }
    },
    "/applications/{applicationId}/workspace/product": {
      "get": {
        "summary": "Resolve canonical product or registered alias",
        "operationId": "marketing_product",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApplicationId"
            }
          },
          {
            "name": "productId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "variantId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        },
        "x-required-scope": "marketing:read"
      }
    },
    "/applications/{applicationId}/workspace/financialterms": {
      "get": {
        "summary": "Inspect financial event semantics",
        "operationId": "marketing_financialterms",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApplicationId"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialTerms"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        },
        "x-required-scope": "marketing:read"
      }
    },
    "/applications/{applicationId}/workspace/paymentagreement": {
      "get": {
        "summary": "Inspect payment agreement or explicit unavailability",
        "operationId": "marketing_paymentagreement",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApplicationId"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agreementId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "description": "Read exact terms for an available agreement ID, or test its coverage of campaignId."
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentAgreement"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        },
        "x-required-scope": "marketing:read"
      }
    },
    "/applications/{applicationId}/workspace/campaignvalidate": {
      "post": {
        "summary": "Read-only campaign preflight",
        "operationId": "marketing_campaignvalidate",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApplicationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignPreflight"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignPreflightRequest"
              }
            }
          }
        },
        "x-required-scope": "marketing:read"
      }
    },
    "/applications/{applicationId}/workspace/productoffer": {
      "post": {
        "summary": "Save offer from verified current product",
        "operationId": "marketing_productoffer",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApplicationId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductOfferMutation"
              }
            }
          }
        },
        "x-required-scope": "marketing:content:write"
      }
    },
    "/applications/{applicationId}/workspace/mutationreceipt": {
      "get": {
        "summary": "Read a retained mutation receipt without repeating a write",
        "operationId": "marketing_mutationreceipt",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ApplicationId"
            }
          },
          {
            "name": "operation",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "audiences",
                "content",
                "productoffer",
                "campaigns",
                "campaignPublish",
                "campaignDuplicate",
                "campaignState",
                "campaignDelete",
                "campaignAudience",
                "campaignAudiences",
                "campaignSettings",
                "pricing",
                "objective",
                "definitions"
              ]
            }
          },
          {
            "name": "idempotencyKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
              "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original committed receipt and current record identity/status; actor/application/operation scoped",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "applicationId": {
                      "$ref": "#/components/schemas/ApplicationId"
                    },
                    "receipt": {
                      "type": "object"
                    },
                    "current": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "applicationId",
                    "receipt",
                    "current"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        },
        "x-required-scope": "marketing:read"
      }
    },
    "/applications/{applicationId}/workspace/agreementcreate": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "paymentAgreementCreate",
        "summary": "Create a payment agreement",
        "description": "Owner/admin operation with explicit agreements scope, exact reviewable terms, revision protection and auditable idempotent receipt. Does not authorize or settle a payment.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:publish",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentAgreementCreateMutation"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/agreementaccept": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "paymentAgreementAccept",
        "summary": "Accept a payment agreement",
        "description": "Owner/admin operation with explicit agreements scope, exact reviewable terms, revision protection and auditable idempotent receipt. Does not authorize or settle a payment.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:publish",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentAgreementAcceptMutation"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/inboxbroadcast": {
      "post": {
        "operationId": "queueCampaignInboxBroadcast",
        "summary": "Queue a campaign reminder in matching keyrings’ Inbox",
        "description": "One bounded fanout over existing qualified offer assignments. Accepted reminders are deduplicated by recipient and engagement stage across manual and automatic reminders. The response contains aggregate delivery counts. Use kind=availability to enable an on-demand count in the same private offer message. Only one manual broadcast can run per campaign and starts must be at least one hour apart. An identical idempotent retry returns its existing receipt.",
        "x-required-scope": "marketing:campaigns:inbox:write",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "campaignId",
                  "expectedCampaignRevision",
                  "idempotencyKey"
                ],
                "properties": {
                  "campaignId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "expectedCampaignRevision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{8,120}$"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "reminder",
                      "availability"
                    ],
                    "default": "reminder"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replay of the original request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignInboxBroadcast"
                }
              }
            }
          },
          "202": {
            "description": "Inbox broadcast queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignInboxBroadcast"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "429": {
            "description": "This campaign has a running broadcast or another one started less than one hour ago."
          }
        }
      },
      "get": {
        "operationId": "getCampaignInboxBroadcast",
        "summary": "Read current campaign availability or a broadcast receipt",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "broadcastId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current availability or the requested broadcast receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CampaignOfferAvailability"
                    },
                    {
                      "$ref": "#/components/schemas/CampaignInboxBroadcast"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        },
        "description": "Use exactly one query parameter. campaignId requires marketing:read and returns the eligible assigned shopper count and additional funded capacity. broadcastId requires marketing:campaigns:inbox:write and returns delivery status. Both reads leave campaign and delivery state unchanged.",
        "x-scope-by-query": {
          "campaignId": "marketing:read",
          "broadcastId": "marketing:campaigns:inbox:write"
        }
      }
    },
    "/apps/{applicationId}/purchase-receipts": {
      "post": {
        "operationId": "recordSessionPurchase",
        "summary": "Report a verified item purchase or reversal in a connected shopping session",
        "description": "A retailer can confirm a purchase in any later connected session for its application. Matching an earlier click has no time limit. The response contains no recipient or matching information. This endpoint reconciles CVB and outstanding reminders only. Use the campaign-bound endpoint for reward attribution.",
        "security": [
          {
            "marketingBearer": []
          }
        ],
        "x-required-scope": "marketing:purchase:write",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionPurchaseReceipt"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Receipt received.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "const": true
                    }
                  },
                  "required": [
                    "received"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          }
        }
      }
    },
    "/apps/{applicationId}/campaigns/{campaignId}/purchase-receipts": {
      "post": {
        "operationId": "recordVerifiedPurchase",
        "summary": "Company-server verified purchase or reversal",
        "description": "Requires dedicated server API token with marketing:purchase:write; no MCP/OAuth/console acceptance. Bind prior verified landing, delivery, canonical product and transaction. Full reversals match original amount and currency; transaction deduplication is application-wide. This records measured outcomes, not settled payments. A verified purchase after the original reward deadline can clear the CVB effect of the earlier click on that item. Campaign payouts remain subject to the original terms.",
        "parameters": [
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseReceipt"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified receipt accepted or duplicate reported."
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/audiencepreview": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Measurement"
        ],
        "operationId": "previewMarketingAudience",
        "summary": "Review an audience without saving",
        "description": "Read-only preview using the current workspace revision, explicit permitted features and existing pricing/authorization. No draft save, automatic campaign update or launch.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudiencePreviewResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudiencePreviewRequest"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/lookalikepreview": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Measurement"
        ],
        "operationId": "previewMarketingLookalike",
        "summary": "Review a real service-side similarity audience",
        "description": "Read-only preview using the current workspace revision, explicit permitted features and existing pricing/authorization. No draft save, automatic campaign update or launch.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudiencePreviewResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookalikePreviewRequest"
              }
            }
          }
        }
      }
    },
    "/applications/{applicationId}/workspace/responses": {
      "get": {
        "tags": [
          "Measurement"
        ],
        "operationId": "getCampaignResponses",
        "summary": "Read company campaign responses",
        "description": "Read the answers expressly submitted to this originating company campaign, independently of optional website return. No keyring or cross-campaign holder identity is returned.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Completed submitted responses",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignResponses"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:reports:read",
        "parameters": [
          {
            "name": "campaignId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ]
      }
    },
    "/applications/{applicationId}/workspace/followupgroups": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "get": {
        "tags": [
          "Measurement"
        ],
        "operationId": "getMarketingFollowupGroups",
        "summary": "Read current live response groups",
        "description": "Count real deliveries, accepted responses and opt-outs for one source campaign. Excludes opted-out keyrings from both response groups. Opens and starts alone do not count as accepted responses. People who were never delivered the source campaign are not counted. Current permissions, audience selections and budget are checked separately before each follow-up delivery.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FollowupGroups"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:read",
        "parameters": [
          {
            "name": "campaignId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ]
      }
    },
    "/applications/{applicationId}/workspace/followups": {
      "parameters": [
        {
          "name": "applicationId",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        }
      ],
      "post": {
        "tags": [
          "Drafts"
        ],
        "operationId": "createMarketingFollowup",
        "summary": "Save a linked follow-up draft",
        "description": "Save a new offer or questionnaire draft linked to a live campaign in this application. The selected response group remains attached through edits, duplication and launch. Saved included and excluded audiences further restrict the group. Saving does not send, publish or change the source campaign.",
        "security": [
          {
            "marketingBearer": []
          },
          {
            "marketingConsoleCookie": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "x-mementom-activity-id": {
                "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
                "schema": {
                  "$ref": "#/components/schemas/ActivityId"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "405": {
            "$ref": "#/components/responses/405"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        },
        "x-required-scope": "marketing:campaigns:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FollowupMutation"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "marketingBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "mkt_<id>.<secret>",
        "description": "Server only. Required operation scope is listed in x-required-scope. Browser Origin/Sec-Fetch-Site requests are rejected. Expiry, revocation, active company/account/membership and current role are checked on every call."
      },
      "marketingConsoleCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "mementom_marketing_session",
        "description": "Established same-origin marketing console session (owner/admin/marketing). Credential management requires this session; a server Bearer credential cannot use those routes. Cookie writes require same-origin protection."
      }
    },
    "responses": {
      "400": {
        "description": "Invalid JSON, fields, catalog bindings, type/range, query or pricing assumptions.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "401": {
        "description": "Missing, invalid, expired or revoked credential/session; or current company/account/app access ended.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "403": {
        "description": "Insufficient scope or company role, browser-origin bearer use, wrong surface or unsupported operation.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "404": {
        "description": "Application/credential/campaign is unavailable in the authorized scope. Foreign application IDs are not disclosed.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "405": {
        "description": "Method not allowed.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "409": {
        "description": "Workspace/content revision conflict or duplicate immutable insight key. Refresh and reconcile before another write.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "413": {
        "description": "Request body or report event limit exceeded.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "429": {
        "description": "Service rate limit or sign-in cooldown. Honor Retry-After when present; no fixed public quota is promised.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          },
          "Retry-After": {
            "schema": {
              "type": "string"
            },
            "description": "Optional retry delay supplied by the service or gateway."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "500": {
        "description": "Unexpected service failure; record the activity ID and reconcile any mutation before retrying.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "503": {
        "description": "Service or backing dependency unavailable. Reconcile mutations after recovery; do not blindly replay writes.",
        "headers": {
          "x-mementom-activity-id": {
            "description": "Opaque correlation ID for debugging. Save this value, not Authorization. Early transport/proxy failures may not carry it.",
            "schema": {
              "$ref": "#/components/schemas/ActivityId"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "CampaignInboxBroadcast": {
        "type": "object",
        "required": [
          "id",
          "applicationId",
          "campaignId",
          "campaignRevision",
          "status",
          "counts",
          "createdAt",
          "finishedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "applicationId": {
            "type": "string"
          },
          "campaignId": {
            "type": "string",
            "format": "uuid"
          },
          "campaignRevision": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "enum": [
              "queued",
              "completed",
              "cancelled"
            ]
          },
          "counts": {
            "type": "object",
            "required": [
              "no_action",
              "clicked",
              "landed"
            ],
            "additionalProperties": false,
            "properties": {
              "no_action": {
                "type": "integer",
                "minimum": 0
              },
              "clicked": {
                "type": "integer",
                "minimum": 0
              },
              "landed": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "replayed": {
            "type": "boolean"
          },
          "activityId": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "reminder",
              "availability"
            ],
            "default": "reminder"
          }
        }
      },
      "ApplicationId": {
        "type": "string",
        "pattern": "^app_[A-Za-z0-9_-]+$"
      },
      "ActivityId": {
        "type": "string",
        "description": "Opaque request correlation ID. Also returned in x-mementom-activity-id."
      },
      "Scope": {
        "type": "string",
        "enum": [
          "marketing:read",
          "marketing:audiences:write",
          "marketing:content:write",
          "marketing:campaigns:write",
          "marketing:pricing:write",
          "marketing:insights:propose",
          "marketing:objective:write",
          "marketing:campaigns:manage",
          "marketing:campaigns:publish",
          "marketing:agreements:write",
          "marketing:agreements:accept",
          "marketing:purchase:write",
          "marketing:campaigns:inbox:write",
          "marketing:reports:read"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Machine-readable error code."
          },
          "message": {
            "type": "string"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "error"
        ]
      },
      "Application": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "displayName": {
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          }
        },
        "required": [
          "applicationId",
          "displayName"
        ],
        "additionalProperties": false
      },
      "ApplicationList": {
        "type": "object",
        "properties": {
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Application"
            }
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "applications"
        ]
      },
      "CredentialIssue": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Scope"
            },
            "minItems": 1,
            "uniqueItems": true,
            "contains": {
              "const": "marketing:read"
            }
          },
          "expiresInDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90,
            "default": 30
          }
        },
        "required": [
          "applicationId",
          "label",
          "scopes"
        ],
        "additionalProperties": false
      },
      "Credential": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^mkt_[a-f0-9]{32}$"
          },
          "label": {
            "type": "string"
          },
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "developerAccountId": {
            "type": "string",
            "description": "Issuing staff account; this is never a consumer identity."
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Scope"
            }
          },
          "createdAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix milliseconds."
          },
          "expiresAt": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix milliseconds."
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "Unix milliseconds."
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          }
        },
        "required": [
          "id",
          "label",
          "applicationId",
          "developerAccountId",
          "scopes",
          "createdAt",
          "expiresAt",
          "revokedAt",
          "status"
        ]
      },
      "CredentialIssued": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Credential"
          },
          {
            "type": "object",
            "properties": {
              "credential": {
                "type": "string",
                "pattern": "^mkt_[a-f0-9]{32}\\.[A-Za-z0-9_-]{43}$",
                "description": "Secret displayed once. Move directly into a server secret store; never embed it in a web app or record it in a trace.",
                "readOnly": true
              }
            },
            "required": [
              "credential"
            ]
          }
        ]
      },
      "CredentialList": {
        "type": "object",
        "properties": {
          "credentials": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Credential"
            }
          },
          "availableScopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Scope"
            }
          }
        },
        "required": [
          "credentials",
          "availableScopes"
        ]
      },
      "Rule": {
        "type": "object",
        "properties": {
          "definitionId": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "operator": {
            "type": "string",
            "enum": [
              "equals",
              "contains",
              "gte",
              "lte",
              "matches"
            ]
          },
          "value": {
            "oneOf": [
              {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              },
              {
                "$ref": "#/components/schemas/EventMatch"
              }
            ]
          }
        },
        "required": [
          "definitionId",
          "version",
          "operator",
          "value"
        ],
        "additionalProperties": false,
        "description": "Use an ID/version from this workspace. equals supports enum/boolean/numeric; gte/lte numeric; contains enumset. Values must match the definition domain. matches requires an EventMatch value for a registered event; property types, catalog membership and lookback are validated against its definition."
      },
      "Criterion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "definitionId": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "operator": {
            "type": "string",
            "enum": [
              "equals",
              "contains",
              "gte",
              "lte",
              "matches"
            ]
          },
          "value": {
            "oneOf": [
              {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              },
              {
                "$ref": "#/components/schemas/EventMatch"
              }
            ]
          }
        },
        "required": [
          "id",
          "definitionId",
          "version",
          "operator",
          "value"
        ],
        "additionalProperties": false
      },
      "AudienceLeaf": {
        "type": "object",
        "properties": {
          "not": {
            "type": "boolean",
            "description": "Negate this condition after evaluating it. Omitted or false preserves its result."
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "insight": {
            "type": "string",
            "description": "ID of a criterion in criteria."
          },
          "logic": {
            "type": "string",
            "enum": [
              "AND",
              "OR"
            ]
          }
        },
        "required": [
          "id",
          "insight"
        ],
        "additionalProperties": false
      },
      "AudienceGroup": {
        "type": "object",
        "properties": {
          "not": {
            "type": "boolean",
            "description": "Negate the completed group result, including the head group. NOR uses OR joins for every direct child and not:true."
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "logic": {
            "type": "string",
            "enum": [
              "AND",
              "OR"
            ]
          },
          "peerLogic": {
            "type": "string",
            "enum": [
              "AND",
              "OR"
            ]
          },
          "children": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/AudienceLeaf"
                },
                {
                  "$ref": "#/components/schemas/AudienceGroup"
                }
              ]
            },
            "minItems": 1
          }
        },
        "required": [
          "id",
          "children"
        ],
        "additionalProperties": false,
        "description": "Groups evaluate children left to right, using leaf logic or group peerLogic, then apply optional not. Defaults are AND. NOR is a group with OR child joins and not:true, negating the whole union once. Negation complements only the existing permitted eligible population. Whole tree: at most 256 nodes and depth 16; node IDs are unique."
      },
      "AudienceSimple": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "mode": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "minItems": 1,
            "maxItems": 8
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "insightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 60,
            "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
          }
        },
        "required": [
          "name",
          "mode",
          "rules"
        ],
        "additionalProperties": false,
        "description": "A definition ID may appear only once in a simple audience."
      },
      "AudienceStructured": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 2
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "logic": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AudienceGroup"
              },
              {
                "properties": {
                  "id": {
                    "const": "head"
                  }
                }
              }
            ]
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Criterion"
            },
            "minItems": 1,
            "maxItems": 64
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "insightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 60,
            "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
          }
        },
        "required": [
          "schemaVersion",
          "name",
          "logic",
          "criteria"
        ],
        "additionalProperties": false,
        "description": "Every criterion ID is unique and used by at least one leaf. Root id is head."
      },
      "AudienceInput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/AudienceSimple"
          },
          {
            "$ref": "#/components/schemas/AudienceStructured"
          },
          {
            "$ref": "#/components/schemas/AudienceSimilarity"
          }
        ]
      },
      "AudienceSave": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
              },
              "mode": {
                "type": "string",
                "enum": [
                  "all",
                  "any"
                ]
              },
              "rules": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Rule"
                },
                "minItems": 1,
                "maxItems": 8
              },
              "audienceId": {
                "type": "string"
              },
              "tags": {
                "$ref": "#/components/schemas/Tags"
              },
              "minimumCvbRating": {
                "$ref": "#/components/schemas/CvbThreshold"
              },
              "insightPurchasePercent": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "default": 60,
                "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
              }
            },
            "required": [
              "name",
              "mode",
              "rules"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "const": 2
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
              },
              "logic": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AudienceGroup"
                  },
                  {
                    "properties": {
                      "id": {
                        "const": "head"
                      }
                    }
                  }
                ]
              },
              "criteria": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Criterion"
                },
                "minItems": 1,
                "maxItems": 64
              },
              "audienceId": {
                "type": "string"
              },
              "tags": {
                "$ref": "#/components/schemas/Tags"
              },
              "minimumCvbRating": {
                "$ref": "#/components/schemas/CvbThreshold"
              },
              "insightPurchasePercent": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "default": 60,
                "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
              }
            },
            "required": [
              "schemaVersion",
              "name",
              "logic",
              "criteria"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "const": 3
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
              },
              "similarity": {
                "$ref": "#/components/schemas/SimilaritySpecification"
              },
              "tags": {
                "$ref": "#/components/schemas/Tags"
              },
              "minimumCvbRating": {
                "$ref": "#/components/schemas/CvbThreshold"
              },
              "insightPurchasePercent": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "default": 60,
                "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
              },
              "audienceId": {
                "type": "string"
              }
            },
            "required": [
              "schemaVersion",
              "name",
              "similarity"
            ],
            "additionalProperties": false
          }
        ],
        "description": "Omit audienceId to create; provide an existing same-app ID to replace its definition. Referencing campaign drafts retain snapshots and are marked audienceChanged."
      },
      "AudienceMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "$ref": "#/components/schemas/AudienceSave"
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "CountRequest": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "audience": {
            "$ref": "#/components/schemas/AudienceInput"
          },
          "actionFees": {
            "$ref": "#/components/schemas/ActionFeesPreview"
          },
          "campaignId": {
            "type": "string"
          },
          "engagementId": {
            "type": "string"
          },
          "refinements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "maxItems": 8,
            "description": "Draft-only additional AND conditions. Saved campaign context always uses its immutable engagement refinements."
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          }
        },
        "required": [
          "expectedRevision",
          "audience"
        ],
        "additionalProperties": false
      },
      "CountResult": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "available": {
                "const": true
              },
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "eligible": {
                "type": "integer",
                "minimum": 0
              },
              "breakdown": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "logic": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "id",
                    "logic",
                    "count"
                  ],
                  "additionalProperties": false
                }
              },
              "asOf": {
                "type": "string",
                "format": "date-time"
              },
              "basis": {
                "type": "string"
              },
              "sample": {
                "const": false
              },
              "activityId": {
                "$ref": "#/components/schemas/ActivityId"
              },
              "pricing": {
                "$ref": "#/components/schemas/PricingEstimate"
              },
              "pricingBreakdown": {
                "$ref": "#/components/schemas/AudiencePricingBreakdown"
              },
              "similarity": {
                "$ref": "#/components/schemas/SimilarityReadiness"
              },
              "pricingEligibility": {
                "type": "object",
                "properties": {
                  "available": {
                    "type": "boolean"
                  },
                  "code": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              },
              "includedCount": {
                "type": "integer",
                "minimum": 0
              },
              "excludedCount": {
                "type": "integer",
                "minimum": 0
              },
              "audienceCounts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "enum": [
                        "include",
                        "exclude"
                      ]
                    },
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "role",
                    "index",
                    "count"
                  ]
                }
              },
              "refinedCount": {
                "type": "integer",
                "minimum": 0,
                "description": "Distinct inclusion matches remaining after refinement and campaign CVB constraints, before exclusion removal."
              },
              "constraints": {
                "type": "object",
                "properties": {
                  "refinements": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Rule"
                    },
                    "maxItems": 8,
                    "description": "Draft-only additional AND conditions. Saved campaign context always uses its immutable engagement refinements."
                  },
                  "minimumCvbRating": {
                    "$ref": "#/components/schemas/CvbThreshold"
                  }
                },
                "required": [
                  "refinements",
                  "minimumCvbRating"
                ]
              }
            },
            "required": [
              "available",
              "count",
              "eligible",
              "breakdown",
              "asOf",
              "basis",
              "sample"
            ]
          },
          {
            "type": "object",
            "properties": {
              "available": {
                "const": false
              },
              "count": {
                "type": "null"
              },
              "reason": {
                "type": "string"
              },
              "activityId": {
                "$ref": "#/components/schemas/ActivityId"
              },
              "pricing": {
                "$ref": "#/components/schemas/PricingEstimate"
              },
              "pricingBreakdown": {
                "$ref": "#/components/schemas/AudiencePricingBreakdown"
              },
              "similarity": {
                "$ref": "#/components/schemas/SimilarityReadiness"
              },
              "pricingEligibility": {
                "type": "object",
                "properties": {
                  "available": {
                    "type": "boolean"
                  },
                  "code": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "available",
              "count",
              "reason"
            ]
          }
        ]
      },
      "Creative": {
        "type": "object",
        "properties": {
          "headline": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "cta": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "landingUrl": {
            "type": "string",
            "description": "Optional public HTTPS company destination, without username, password, query string or fragment. Empty uses the saved Mementom offer page."
          },
          "image": {
            "type": "string",
            "description": "Optional PNG/JPEG/WebP base64 data URL. Creative writes use a 4 MiB JSON request envelope; uploaded files may be prepared automatically before saving."
          },
          "brandName": {
            "type": "string",
            "maxLength": 80,
            "description": "Brand shown on the creative. Empty leaves the brand line blank. Plain text only."
          },
          "offerLabel": {
            "type": "string",
            "maxLength": 120,
            "description": "Authored offer label or badge. No reward or completion wording is inserted automatically. Plain text only."
          },
          "terms": {
            "type": "string",
            "maxLength": 1000,
            "description": "Offer terms shown as authored. Plain text only."
          },
          "promoCode": {
            "type": "string",
            "maxLength": 80,
            "description": "Optional promotional code. Plain text only."
          },
          "imageAlt": {
            "type": "string",
            "maxLength": 180,
            "description": "Description of the creative image for assistive technology. Plain text only."
          },
          "design": {
            "$ref": "#/components/schemas/CreativeDesign"
          },
          "productId": {
            "type": "string",
            "maxLength": 120,
            "description": "Canonical same-application ID from get_product. Aliases resolve only through registered mappings. Audience choices are not inventory."
          },
          "landingDetails": {
            "type": "string",
            "maxLength": 5000
          },
          "discount": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "percent": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "required": [
                  "percent"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Offer discount requires a productId. Omit or supply null for no discount."
          }
        },
        "required": [
          "headline",
          "body",
          "cta"
        ],
        "additionalProperties": false
      },
      "CompanyEmailCreative": {
        "type": "object",
        "properties": {
          "headline": {
            "type": "string",
            "maxLength": 120,
            "description": "Optional approved fallback copy. The company may leave it empty while awaiting signed email."
          },
          "body": {
            "type": "string",
            "maxLength": 2000,
            "description": "Optional approved fallback copy. The company may leave it empty while awaiting signed email."
          },
          "cta": {
            "type": "string",
            "maxLength": 60,
            "description": "Optional approved fallback copy. The company may leave it empty while awaiting signed email."
          },
          "landingUrl": {
            "type": "string",
            "description": "Optional public HTTPS company destination, without username, password, query string or fragment. Empty uses the saved Mementom offer page."
          },
          "image": {
            "type": "string",
            "description": "Optional PNG/JPEG/WebP base64 data URL. Creative writes use a 4 MiB JSON request envelope; uploaded files may be prepared automatically before saving."
          },
          "brandName": {
            "type": "string",
            "maxLength": 80,
            "description": "Brand shown on the creative. Empty leaves the brand line blank. Plain text only."
          },
          "offerLabel": {
            "type": "string",
            "maxLength": 120,
            "description": "Authored offer label or badge. No reward or completion wording is inserted automatically. Plain text only."
          },
          "terms": {
            "type": "string",
            "maxLength": 1000,
            "description": "Offer terms shown as authored. Plain text only."
          },
          "promoCode": {
            "type": "string",
            "maxLength": 80,
            "description": "Optional promotional code. Plain text only."
          },
          "imageAlt": {
            "type": "string",
            "maxLength": 180,
            "description": "Description of the creative image for assistive technology. Plain text only."
          },
          "design": {
            "$ref": "#/components/schemas/CreativeDesign"
          },
          "productId": {
            "type": "string",
            "maxLength": 120,
            "description": "Canonical same-application ID from get_product. Aliases resolve only through registered mappings. Audience choices are not inventory."
          },
          "landingDetails": {
            "type": "string",
            "maxLength": 5000
          },
          "discount": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "percent": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "required": [
                  "percent"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Offer discount requires a productId. Omit or supply null for no discount."
          }
        },
        "required": [],
        "additionalProperties": false,
        "description": "Offer creative for an explicitly company-authored email campaign. An empty object is allowed while awaiting the actual email. Keep any supplied terms and destination exact."
      },
      "QuestionInsight": {
        "type": "object",
        "properties": {
          "definitionId": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "definitionId",
          "version"
        ],
        "additionalProperties": false
      },
      "QuestionV1": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 1
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "questionType": {
            "type": "string",
            "enum": [
              "multipleChoice",
              "boolean",
              "slider"
            ]
          },
          "answerType": {
            "type": "string",
            "enum": [
              "single",
              "multiple"
            ]
          },
          "maxAnswers": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "step": {
            "type": "integer",
            "minimum": 1
          },
          "insight": {
            "$ref": "#/components/schemas/QuestionInsight"
          }
        },
        "required": [
          "schemaVersion",
          "prompt",
          "questionType",
          "answerType",
          "maxAnswers",
          "insight"
        ],
        "additionalProperties": false,
        "description": "Use an approved or standard company insight of the same type. Multiple choice uses enum choices; boolean and slider require single answer and maxAnswers=1. Slider requires integer step dividing the registered integer range; other types forbid step. Choice count and maxAnswers must fit the registered domain."
      },
      "LegacyQuestion": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
            },
            "minItems": 2,
            "maxItems": 8,
            "uniqueItems": true
          }
        },
        "required": [
          "prompt",
          "options"
        ],
        "additionalProperties": false,
        "description": "Existing unbound question compatibility. New integrations should use QuestionV1 for typed answers and registered insight provenance."
      },
      "QuestionInput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/QuestionV1"
          },
          {
            "$ref": "#/components/schemas/LegacyQuestion"
          }
        ]
      },
      "ContentFields": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "type": {
            "type": "string",
            "enum": [
              "offer",
              "questionnaire",
              "insight_request"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/Creative"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionInput"
            },
            "maxItems": 10
          },
          "requestedInsightIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "engagementMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Default combined fee in cents. Omission preserves a saved or duplicated value; new content defaults to 200. Campaign placements may select their own fee."
          },
          "purchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Default combined fee in cents. Omission preserves a saved or duplicated value; new content defaults to 0. Campaign placements may select their own fee."
          }
        },
        "required": [
          "name",
          "type",
          "content",
          "questions",
          "requestedInsightIds"
        ],
        "additionalProperties": false,
        "description": "Questionnaire: 1–10 questions. Other types: questions must be empty. Insight request: at least one requestedInsightId. All insight IDs belong to this workspace catalog."
      },
      "ContentSave": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "type": {
            "type": "string",
            "enum": [
              "offer",
              "questionnaire",
              "insight_request"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/Creative"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionInput"
            },
            "maxItems": 10
          },
          "requestedInsightIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true
          },
          "contentId": {
            "type": "string"
          },
          "expectedContentRevision": {
            "type": "integer",
            "minimum": 1
          },
          "duplicateFromId": {
            "type": "string"
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "engagementMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company completion fee. Offers: verified accepted arrival, not a click; questionnaires: completed response. Consumer and platform each receive half; settlement is separate."
          },
          "purchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Independent cumulative company fee for verified purchase after accepted arrival. Event validation exists; no production callback endpoint or settlement. Zero disables this fee."
          },
          "verifiedLandingMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Offer-only alias for engagementMinor. Must agree if both are supplied. Verified arrival_confirmed only, never a raw click."
          },
          "cpcMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company total fee for one distinct confirmed event; cumulative with configured landing/purchase fees, split equally between consumer and platform."
          },
          "continuation": {
            "$ref": "#/components/schemas/QuestionnaireContinuation"
          }
        },
        "required": [
          "name",
          "type",
          "content",
          "questions",
          "requestedInsightIds"
        ],
        "additionalProperties": false,
        "description": "Omit IDs to create. Edit with contentId and its current expectedContentRevision. Duplicate with duplicateFromId and a complete payload; do not combine it with contentId. A new/duplicate record forbids expectedContentRevision. Historical editions remain available for campaign snapshots."
      },
      "ContentMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "$ref": "#/components/schemas/ContentSave"
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "Engagement": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "type": {
            "type": "string",
            "enum": [
              "offer",
              "questionnaire",
              "insight_request"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/Creative"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionInput"
            },
            "maxItems": 10
          },
          "requestedInsightIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true
          },
          "audienceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true,
            "description": "A standard campaign needs an included audience. A linked follow-up can use only its source response group or intersect it with saved audiences."
          },
          "excludedAudienceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true
          },
          "refinements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "maxItems": 8
          },
          "engagementMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company completion fee. Offers: verified accepted arrival, not a click; questionnaires: completed response. Consumer and platform each receive half; settlement is separate."
          },
          "purchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Independent cumulative company fee for verified purchase after accepted arrival. Event validation exists; no production callback endpoint or settlement. Zero disables this fee."
          },
          "contentId": {
            "type": "string"
          },
          "contentRevision": {
            "type": "integer",
            "minimum": 1
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "verifiedLandingMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Offer-only alias for engagementMinor. Must agree if both are supplied. Verified arrival_confirmed only, never a raw click."
          },
          "cpcMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company total fee for one distinct confirmed event; cumulative with configured landing/purchase fees, split equally between consumer and platform."
          },
          "continuation": {
            "$ref": "#/components/schemas/QuestionnaireContinuation"
          }
        },
        "required": [
          "name",
          "type",
          "content",
          "questions",
          "requestedInsightIds",
          "audienceIds",
          "purchaseMinor"
        ],
        "additionalProperties": false,
        "description": "Include at least one same-app saved audience; included/excluded IDs must be disjoint. Combined engagement and purchase fees must be positive. Purchase fees only apply to offers. Optional saved contentId/contentRevision require the full unchanged author-controlled content of that edition; the service snapshots definitions and content."
      },
      "CompanyEmailEngagement": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "type": {
            "type": "string",
            "const": "offer"
          },
          "content": {
            "$ref": "#/components/schemas/CompanyEmailCreative"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuestionInput"
            },
            "maxItems": 0
          },
          "requestedInsightIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true
          },
          "audienceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true,
            "description": "A standard campaign needs an included audience. A linked follow-up can use only its source response group or intersect it with saved audiences."
          },
          "excludedAudienceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true
          },
          "refinements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "maxItems": 8
          },
          "engagementMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company completion fee. Offers: verified accepted arrival, not a click; questionnaires: completed response. Consumer and platform each receive half; settlement is separate."
          },
          "purchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Independent cumulative company fee for verified purchase after accepted arrival. Event validation exists; no production callback endpoint or settlement. Zero disables this fee."
          },
          "contentId": {
            "type": "string"
          },
          "contentRevision": {
            "type": "integer",
            "minimum": 1
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "verifiedLandingMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Offer-only alias for engagementMinor. Must agree if both are supplied. Verified arrival_confirmed only, never a raw click."
          },
          "cpcMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company total fee for one distinct confirmed event; cumulative with configured landing/purchase fees, split equally between consumer and platform."
          },
          "continuation": {
            "$ref": "#/components/schemas/QuestionnaireContinuation"
          }
        },
        "required": [
          "name",
          "type",
          "content",
          "questions",
          "requestedInsightIds",
          "audienceIds",
          "purchaseMinor"
        ],
        "additionalProperties": false,
        "description": "Offer only. Targeting, fees and approved commercial terms are configured before sending company creative."
      },
      "CampaignV2": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 2
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "objective": {
            "type": "string",
            "enum": [
              "return_visitors",
              "learn_preferences",
              "collect_insights"
            ]
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "budgetMinor": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000000
          },
          "dailyCapMinor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 100000000
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional daily cap. Omitted/null means no separate daily limit; total budget remains enforced."
          },
          "responseWindowHours": {
            "type": "integer",
            "enum": [
              24,
              72,
              168
            ]
          },
          "webActivity": {
            "type": "boolean",
            "deprecated": true,
            "description": "Accepted for compatibility. Each shopper’s Web Activity settings determine delivery of new matched offers and questions."
          },
          "emailDelivery": {
            "type": "string",
            "enum": [
              "mementom",
              "company"
            ],
            "default": "mementom",
            "description": "Mementom automatically emails authorized campaign matches. Choose company to publish the existing campaign message before sending an email update."
          },
          "engagements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Engagement"
            },
            "minItems": 1,
            "maxItems": 10
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "paymentAgreementId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Explicit applicable agreement ID from get_payment_agreement; required when multiple agreements apply."
          },
          "senderDomain": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63})?$",
            "description": "Optional domain override for the company’s campaign email. Omit on a new campaign to use the saved keyring default when available; use an empty string to use the application’s allowed domains. Do not send a mailbox."
          },
          "contentSource": {
            "type": "string",
            "enum": [
              "editor",
              "external"
            ],
            "description": "Where the company supplies the campaign message. Omit for older drafts that predate this choice."
          }
        },
        "required": [
          "schemaVersion",
          "name",
          "objective",
          "startAt",
          "endAt",
          "budgetMinor",
          "responseWindowHours",
          "engagements"
        ],
        "additionalProperties": false,
        "description": "Creates a draft. Published creative is immutable. Total and optional daily budget must cover maximum click + completion + purchase + insight exposure per delivery. Currency USD, integer cents. Fees are company total costs; configured fees are not settled payments."
      },
      "CompanyEmailCampaignV2": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 2
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "objective": {
            "type": "string",
            "enum": [
              "return_visitors",
              "learn_preferences",
              "collect_insights"
            ]
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "budgetMinor": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000000
          },
          "dailyCapMinor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 100000000
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional daily cap. Omitted/null means no separate daily limit; total budget remains enforced."
          },
          "responseWindowHours": {
            "type": "integer",
            "enum": [
              24,
              72,
              168
            ]
          },
          "webActivity": {
            "type": "boolean",
            "deprecated": true,
            "description": "Accepted for compatibility. Each shopper’s Web Activity settings determine delivery of new matched offers and questions."
          },
          "emailDelivery": {
            "type": "string",
            "const": "brand",
            "description": "Wait for an authenticated company email before releasing the offer to eligible recipients."
          },
          "engagements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanyEmailEngagement"
            },
            "minItems": 1,
            "maxItems": 10
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "paymentAgreementId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Explicit applicable agreement ID from get_payment_agreement; required when multiple agreements apply."
          },
          "senderDomain": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63})?$",
            "description": "Optional domain override for the company’s campaign email. Omit on a new campaign to use the saved keyring default when available; use an empty string to use the application’s allowed domains. Do not send a mailbox."
          },
          "contentSource": {
            "type": "string",
            "enum": [
              "editor",
              "external"
            ],
            "description": "Where the company supplies the campaign message. Omit for older drafts that predate this choice."
          }
        },
        "required": [
          "schemaVersion",
          "name",
          "objective",
          "startAt",
          "endAt",
          "budgetMinor",
          "responseWindowHours",
          "engagements",
          "emailDelivery"
        ],
        "additionalProperties": false,
        "description": "Company-authored email campaign draft. Save approved targeting, fees and any supplied offer terms without drafting creative on behalf of the company. Publication arms release through authenticated company email."
      },
      "LegacyCampaign": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "audienceId": {
            "type": "string"
          },
          "engagementMinor": {
            "type": "integer",
            "minimum": 2,
            "maximum": 100000,
            "multipleOf": 2
          },
          "budgetMinor": {
            "type": "integer",
            "minimum": 2,
            "maximum": 100000000
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          }
        },
        "required": [
          "name",
          "audienceId",
          "engagementMinor",
          "budgetMinor"
        ],
        "additionalProperties": false,
        "description": "Legacy simple draft compatibility; new integrations should use CampaignV2."
      },
      "CampaignInput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CampaignV2"
          },
          {
            "$ref": "#/components/schemas/LegacyCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignUpdate"
          },
          {
            "$ref": "#/components/schemas/CompanyEmailCampaignV2"
          },
          {
            "$ref": "#/components/schemas/CompanyEmailCampaignUpdate"
          }
        ]
      },
      "CampaignMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "$ref": "#/components/schemas/CampaignInput"
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "PricingPolicy": {
        "type": "object",
        "properties": {
          "conversionPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 60,
            "description": "Purchase allocation of the single product conversion baseline; click receives the remainder. Independent of personal insight allocation. Nondefault values require separately named current company conversion agreement terms."
          },
          "schemaVersion": {
            "const": 1
          },
          "brandTier": {
            "type": "string",
            "enum": [
              "free",
              "basic",
              "pro",
              "enterprise"
            ]
          },
          "marketTier": {
            "type": "string",
            "enum": [
              "economy",
              "retail",
              "mid",
              "luxury",
              "ultra"
            ]
          },
          "sourceWeight": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "dataPointWeight": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "uniquenessWeight": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "confidenceWeight": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "baseCPA": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000,
            "description": "Legacy compatibility field. Product conversion pricing uses 6% of authoritative discounted product value times the existing market multiplier; this field adds no independent purchase fee."
          },
          "splitAddOnCostsWithCPA": {
            "type": "boolean"
          },
          "insightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 60,
            "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
          }
        },
        "additionalProperties": false,
        "description": "Planning assumptions. Omitted fields reset to documented defaults. Product conversion is one 6% retail baseline times the existing market multiplier, with conversionPurchasePercent60 by default. Personal insight allocation is independently controlled by insightPurchasePercent. Their nondefault splits require their respective current company agreement terms. No product context means no conversion baseline; no independent click or purchase floor is added."
      },
      "PricingProfile": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "demographic",
              "location",
              "behavior",
              "question"
            ]
          },
          "purchaseType": {
            "type": "string",
            "enum": [
              "general",
              "precision",
              "subscription"
            ]
          },
          "baseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          },
          "sourceCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "dataPointCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "uniqueness": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "ageDays": {
            "type": "number",
            "minimum": 0,
            "maximum": 36500
          },
          "halfLifeDays": {
            "type": "number",
            "minimum": 1,
            "maximum": 3650
          },
          "expiresAfterDays": {
            "type": "number",
            "minimum": 1,
            "maximum": 3650
          }
        },
        "additionalProperties": false,
        "description": "One outside-catalog definition only. Omitted values use default behavior/general, counts 1, uniqueness 0, confidence 1, age 0, half-life 30, expiry 90. No paid license or settlement is created."
      },
      "PricingInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "policy": {
                "$ref": "#/components/schemas/PricingPolicy"
              }
            },
            "required": [
              "policy"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "definitionId": {
                "type": "string"
              },
              "profile": {
                "$ref": "#/components/schemas/PricingProfile"
              }
            },
            "required": [
              "definitionId",
              "profile"
            ],
            "additionalProperties": false
          }
        ]
      },
      "PricingMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "$ref": "#/components/schemas/PricingInput"
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "InsightProposal": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)+$",
                "maxLength": 64
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 240,
                "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
              },
              "windowDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 30
              },
              "ttlDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 30
              },
              "type": {
                "const": "enum"
              },
              "values": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 48,
                  "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
                },
                "minItems": 2,
                "maxItems": 20,
                "uniqueItems": true
              }
            },
            "required": [
              "key",
              "label",
              "description",
              "windowDays",
              "ttlDays",
              "type",
              "values"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)+$",
                "maxLength": 64
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 240,
                "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
              },
              "windowDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 30
              },
              "ttlDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 30
              },
              "type": {
                "const": "boolean"
              }
            },
            "required": [
              "key",
              "label",
              "description",
              "windowDays",
              "ttlDays",
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)+$",
                "maxLength": 64
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 240,
                "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
              },
              "windowDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 30
              },
              "ttlDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 30
              },
              "type": {
                "const": "integer"
              },
              "minimum": {
                "type": "integer",
                "minimum": 0,
                "maximum": 99
              },
              "maximum": {
                "type": "integer",
                "minimum": 0,
                "maximum": 99
              }
            },
            "required": [
              "key",
              "label",
              "description",
              "windowDays",
              "ttlDays",
              "type",
              "minimum",
              "maximum"
            ],
            "additionalProperties": false
          }
        ],
        "description": "Non-identifying custom definition only. No email, phone, address, identifiers, links or long numeric strings in metadata. Maximum >= minimum. Categories unique after normalization and case folding. Saved pending_review; an authorized developer owner/admin must review before use. Existing keys are immutable; standard template keys cannot be proposed."
      },
      "ProposalMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "$ref": "#/components/schemas/InsightProposal"
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "ObjectiveInput": {
        "type": "object",
        "properties": {
          "objective": {
            "type": "string",
            "enum": [
              "return_visitors",
              "learn_preferences"
            ]
          }
        },
        "required": [
          "objective"
        ],
        "additionalProperties": false
      },
      "ObjectiveMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "$ref": "#/components/schemas/ObjectiveInput"
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "InsightDefinition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "enum",
              "enumset",
              "boolean",
              "integer",
              "number"
            ]
          },
          "values": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            }
          },
          "minimum": {
            "type": "number"
          },
          "maximum": {
            "type": "number"
          },
          "windowDays": {
            "type": "integer",
            "minimum": 0
          },
          "ttlDays": {
            "type": "integer",
            "minimum": 0
          },
          "status": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "priceMinor": {
            "type": "integer",
            "minimum": 0
          },
          "isSample": {
            "type": "boolean"
          },
          "sample": {
            "type": "object"
          },
          "pricing": {
            "$ref": "#/components/schemas/PricingEstimate"
          }
        },
        "required": [
          "id",
          "key",
          "version",
          "label",
          "type"
        ]
      },
      "PricingEstimate": {
        "type": "object",
        "properties": {
          "personalInsightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Actual personal insight allocation, independent of conversion baseline allocation. Mementom-managed active fixed company terms override new estimates; saved engagements pin the value."
          },
          "personalInsightAgreementId": {
            "type": "string",
            "description": "Mementom-managed agreement that established the saved personal insight allocation, when applicable."
          },
          "fullConversionBaseMinor": {
            "type": "integer",
            "minimum": 0,
            "description": "Single complete conversion baseline before personal insight charges. Zero without product context; saved action terms remain authoritative."
          },
          "conversion": {
            "type": "object",
            "description": "Product/price/revision snapshot, retailRate, existing marketTier and marketMultiplier, fullConversionBaseMinor, clickBaseMinor, buyBaseMinor and independent conversion purchasePercent/clickPercent."
          },
          "status": {
            "const": "planning_estimate"
          },
          "version": {
            "type": "string"
          },
          "currency": {
            "const": "USD"
          },
          "dataMinor": {
            "type": "integer",
            "minimum": 0
          },
          "engagementMinor": {
            "type": "integer",
            "minimum": 0
          },
          "totalMinor": {
            "type": "integer",
            "minimum": 0
          },
          "consumerMinor": {
            "type": "number"
          },
          "platformMinor": {
            "type": "number"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PricingLine"
            }
          },
          "quoteAvailable": {
            "const": false
          },
          "outsideConsentRequired": {
            "type": "boolean"
          },
          "expiredDefinitionIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scope": {
            "type": "string"
          },
          "reference": {
            "type": "object"
          },
          "policy": {
            "$ref": "#/components/schemas/PricingPolicy"
          },
          "perAction": {
            "$ref": "#/components/schemas/ActionCostPreview"
          }
        },
        "description": "Planning estimate, not a live quote, authorized charge or settled payment. Per-field valuations also have this status and may expose factors/profile/baseMinor/priceMinor."
      },
      "SavedAudience": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "schemaVersion": {
            "enum": [
              2,
              3
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "all",
              "any",
              "structured",
              "similarity"
            ]
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            }
          },
          "logic": {
            "$ref": "#/components/schemas/AudienceGroup"
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Criterion"
            }
          },
          "status": {
            "const": "draft"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "pricing": {
            "$ref": "#/components/schemas/PricingEstimate"
          },
          "isSample": {
            "type": "boolean"
          },
          "sample": {
            "type": "object"
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "similarity": {
            "$ref": "#/components/schemas/SimilaritySpecification"
          },
          "insightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 60,
            "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
          }
        },
        "required": [
          "id",
          "name",
          "mode",
          "rules",
          "status",
          "pricing"
        ]
      },
      "SavedContent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "offer",
              "questionnaire",
              "insight_request"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/Creative"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedQuestion"
            }
          },
          "requestedInsightIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requestedInsights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsightDefinition"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "editions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContentEdition"
            }
          },
          "duplicatedFromId": {
            "type": "string"
          },
          "isSample": {
            "type": "boolean"
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "engagementMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company completion fee. Offers: verified accepted arrival, not a click; questionnaires: completed response. Consumer and platform each receive half; settlement is separate."
          },
          "purchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Independent cumulative company fee for verified purchase after accepted arrival. Event validation exists; no production callback endpoint or settlement. Zero disables this fee."
          },
          "hostedUrl": {
            "type": "string",
            "format": "uri",
            "readOnly": true,
            "description": "Mementom offer preview for the owning company session. Draft saving does not publish it."
          },
          "verifiedLandingMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Offer-only alias for engagementMinor. Must agree if both are supplied. Verified arrival_confirmed only, never a raw click."
          },
          "cpcMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company total fee for one distinct confirmed event; cumulative with configured landing/purchase fees, split equally between consumer and platform."
          },
          "continuation": {
            "$ref": "#/components/schemas/QuestionnaireContinuation"
          }
        },
        "required": [
          "id",
          "revision",
          "name",
          "type",
          "content",
          "questions",
          "requestedInsightIds"
        ]
      },
      "SavedCampaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "schemaVersion": {
            "const": 2
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "paused",
              "stopped",
              "deleted"
            ]
          },
          "objective": {
            "type": "string",
            "enum": [
              "return_visitors",
              "learn_preferences",
              "collect_insights"
            ]
          },
          "engagements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedEngagement"
            }
          },
          "budgetMinor": {
            "type": "integer",
            "minimum": 0
          },
          "dailyCapMinor": {
            "type": "integer",
            "minimum": 0
          },
          "responseWindowHours": {
            "type": "integer",
            "minimum": 0
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "routing": {
            "const": "first_matching_engagement"
          },
          "frequency": {
            "const": "once_per_campaign"
          },
          "audienceChanged": {
            "type": "boolean"
          },
          "pricingChanged": {
            "type": "boolean"
          },
          "isSample": {
            "type": "boolean"
          },
          "pricing": {
            "$ref": "#/components/schemas/PricingEstimate"
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "targetingRevision": {
            "type": "integer",
            "minimum": 0
          },
          "duplicatedFromId": {
            "type": "string"
          },
          "duplicatedFromRevision": {
            "type": "integer",
            "minimum": 1
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "consoleUrl": {
            "type": "string",
            "format": "uri",
            "description": "Service-returned campaign detail link; preserves selected application and campaign through normal key authorization."
          },
          "followup": {
            "$ref": "#/components/schemas/FollowupBinding"
          },
          "contentSource": {
            "type": "string",
            "enum": [
              "editor",
              "external"
            ],
            "description": "Where the company supplies the campaign message. Omit for older drafts that predate this choice."
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "budgetMinor",
          "createdAt"
        ]
      },
      "Workspace": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "definitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsightDefinition"
            }
          },
          "outsideCatalog": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsightDefinition"
            }
          },
          "captureCatalog": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsightDefinition"
            }
          },
          "audiences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedAudience"
            }
          },
          "contentLibrary": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedContent"
            }
          },
          "campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedCampaign"
            }
          },
          "objective": {
            "type": "string",
            "enum": [
              "return_visitors",
              "learn_preferences"
            ]
          },
          "pricingPolicy": {
            "$ref": "#/components/schemas/PricingPolicy"
          },
          "pricingProfiles": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PricingProfile"
            }
          },
          "pricingUpdatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "suggestions": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "sampleSummary": {
            "type": "object"
          },
          "market": {
            "type": "object",
            "description": "Aggregate catalog coverage and provenance; earnings may be unavailable."
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "consumerIngestion": {
                "const": true
              },
              "companyInsightMatching": {
                "const": true
              },
              "holderPermissionRequired": {
                "const": false
              },
              "outreach": {
                "const": false
              },
              "billing": {
                "const": false
              },
              "samples": {
                "const": true
              },
              "campaignTests": {
                "type": "boolean",
                "description": "Local QA capability, not authorization for bearer credentials to simulate."
              }
            },
            "required": [
              "consumerIngestion",
              "companyInsightMatching",
              "holderPermissionRequired",
              "outreach",
              "billing"
            ]
          },
          "readiness": {
            "type": "string"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          },
          "pricingAllocation": {
            "$ref": "#/components/schemas/PricingAllocationCapability"
          }
        },
        "required": [
          "applicationId",
          "revision",
          "definitions",
          "outsideCatalog",
          "audiences",
          "contentLibrary",
          "campaigns",
          "objective",
          "pricingPolicy",
          "pricingProfiles",
          "capabilities",
          "readiness",
          "generatedAt"
        ],
        "description": "Same saved records as the marketing console. Marketing responses omit developer-only templates, datasets and ingestion receipts. Respect isSample and market provenance; catalog planning examples are not paid inventory."
      },
      "ReportMetrics": {
        "type": "object",
        "properties": {
          "delivered": {
            "type": "integer",
            "minimum": 0
          },
          "viewed": {
            "type": "integer",
            "minimum": 0
          },
          "started": {
            "type": "integer",
            "minimum": 0
          },
          "responded": {
            "type": "integer",
            "minimum": 0
          },
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "arrivals": {
            "type": "integer",
            "minimum": 0
          },
          "insightsReleased": {
            "type": "integer",
            "minimum": 0
          },
          "purchases": {
            "type": "integer",
            "minimum": 0
          },
          "reversals": {
            "type": "integer",
            "minimum": 0
          },
          "netPurchases": {
            "type": "integer",
            "minimum": 0
          },
          "optedOut": {
            "type": "integer",
            "minimum": 0
          },
          "mature": {
            "type": "integer",
            "minimum": 0
          },
          "matureResponded": {
            "type": "integer",
            "minimum": 0
          },
          "matureStarted": {
            "type": "integer",
            "minimum": 0
          },
          "matureCompleted": {
            "type": "integer",
            "minimum": 0
          },
          "matureArrivals": {
            "type": "integer",
            "minimum": 0
          },
          "matureNetPurchases": {
            "type": "integer",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "minimum": 0
          },
          "timedResponders": {
            "type": "integer",
            "minimum": 0
          },
          "viewTimedResponders": {
            "type": "integer",
            "minimum": 0
          },
          "modeledSpendMinor": {
            "type": "integer",
            "minimum": 0
          },
          "modeledConsumerMinor": {
            "type": "integer",
            "minimum": 0
          },
          "responseRate": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "matureResponseRate": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "medianResponseMs": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "p90ResponseMs": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "medianViewedResponseMs": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "costPerResponseMinor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "costPerPurchaseMinor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "revenueMinor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "settledMinor": {
            "type": "null",
            "description": "No settlement integration."
          },
          "windows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "hours": {
                  "type": "integer",
                  "minimum": 0
                },
                "eligible": {
                  "type": "integer",
                  "minimum": 0
                },
                "responded": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "hours",
                "eligible",
                "responded"
              ],
              "additionalProperties": false
            }
          },
          "clicks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "modeledClickMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "modeledCompletionMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "modeledPurchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "modeledInsightMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          }
        },
        "required": [
          "delivered",
          "viewed",
          "started",
          "responded",
          "completed",
          "arrivals",
          "insightsReleased",
          "purchases",
          "reversals",
          "netPurchases",
          "optedOut",
          "mature",
          "matureResponded",
          "matureStarted",
          "matureCompleted",
          "matureArrivals",
          "matureNetPurchases",
          "pending",
          "timedResponders",
          "viewTimedResponders",
          "modeledSpendMinor",
          "modeledConsumerMinor",
          "responseRate",
          "matureResponseRate",
          "medianResponseMs",
          "p90ResponseMs",
          "medianViewedResponseMs",
          "costPerResponseMinor",
          "costPerPurchaseMinor",
          "revenueMinor",
          "settledMinor",
          "windows"
        ],
        "description": "Counts are aggregate. Rates and monetary ratios are null when their denominator is zero. Revenue is null unless all net purchases carry recorded amounts. Modeled costs are not settled spend."
      },
      "Report": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 1
          },
          "campaignId": {
            "type": "string"
          },
          "campaignRevision": {
            "type": "integer",
            "minimum": 1
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "windowHours": {
            "type": "integer",
            "minimum": 0
          },
          "overview": {
            "$ref": "#/components/schemas/ReportMetrics"
          },
          "budgetMinor": {
            "type": "integer",
            "minimum": 0
          },
          "isSample": {
            "type": "boolean"
          },
          "recommendations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "evidence": {
                  "type": "string"
                },
                "action": {
                  "type": "string"
                },
                "confidence": {
                  "type": "string"
                }
              },
              "required": [
                "title",
                "evidence",
                "action",
                "confidence"
              ],
              "additionalProperties": false
            }
          },
          "engagements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "offer",
                    "questionnaire",
                    "insight_request"
                  ]
                },
                "audiences": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "metrics": {
                  "$ref": "#/components/schemas/ReportMetrics"
                },
                "questions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "prompt": {
                        "type": "string"
                      },
                      "questionType": {
                        "type": "string"
                      },
                      "answerType": {
                        "type": "string"
                      },
                      "insight": {
                        "anyOf": [
                          {
                            "$ref": "#/components/schemas/QuestionInsight"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "insightLabel": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "provenance": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "answered": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "distribution": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "count": {
                                  "type": "integer",
                                  "minimum": 0
                                }
                              },
                              "required": [
                                "label",
                                "count"
                              ],
                              "additionalProperties": false
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "prompt",
                      "answered",
                      "distribution"
                    ]
                  }
                },
                "tags": {
                  "$ref": "#/components/schemas/Tags"
                }
              },
              "required": [
                "id",
                "name",
                "type",
                "audiences",
                "metrics",
                "questions"
              ],
              "additionalProperties": false
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "landings": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object"
            }
          },
          "landingTotals": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "companyMinor": {
                "type": "integer",
                "minimum": 0
              },
              "consumerMinor": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "count",
              "companyMinor",
              "consumerMinor"
            ]
          },
          "landingPage": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer",
                "minimum": 0,
                "maximum": 200
              },
              "nextCursor": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "limit",
              "nextCursor"
            ]
          }
        },
        "required": [
          "schemaVersion",
          "campaignId",
          "campaignRevision",
          "mode",
          "generatedAt",
          "windowHours",
          "overview",
          "budgetMinor",
          "isSample",
          "recommendations",
          "engagements",
          "limitations"
        ],
        "description": "Read-only aggregate report. Test is synthetic, never live evidence. Starter-pack examples can generate an unpersisted synthetic preview. Zero events do not prove delivery. Live question distributions are withheld below five answers. Landing totals cover all receipts; landings contains at most landingLimit receipts (default 100, maximum 200). Follow landingPage.nextCursor with landingCursor to read subsequent pages."
      },
      "ActivityEvent": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          },
          "operation": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "server",
              "console",
              "mcp"
            ]
          },
          "blockers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreflightIssue"
            }
          }
        },
        "required": [
          "eventId",
          "eventType",
          "result",
          "createdAt"
        ],
        "description": "Safe operational projection. Never contains Authorization, credentials, raw request content, images, captions, or consumer identifiers."
      },
      "ActivityList": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityEvent"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "events",
          "total"
        ]
      },
      "SavedEngagement": {
        "type": "object",
        "properties": {
          "personalInsightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Actual personal insight allocation, independent of conversion baseline allocation. Mementom-managed active fixed company terms override new estimates; saved engagements pin the value."
          },
          "personalInsightAgreementId": {
            "type": "string",
            "description": "Mementom-managed agreement that established the saved personal insight allocation, when applicable."
          },
          "conversion": {
            "type": "object",
            "description": "Service-owned product conversion pricing snapshot captured when a new or unpublished product campaign is saved. Published terms are immutable."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "type": {
            "type": "string",
            "enum": [
              "offer",
              "questionnaire",
              "insight_request"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/Creative"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedQuestion"
            }
          },
          "requestedInsightIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true
          },
          "audienceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 20,
            "uniqueItems": true
          },
          "excludedAudienceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "uniqueItems": true
          },
          "refinements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "maxItems": 8
          },
          "engagementMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company completion fee. Offers: verified accepted arrival, not a click; questionnaires: completed response. Consumer and platform each receive half; settlement is separate."
          },
          "purchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Independent cumulative company fee for verified purchase after accepted arrival. Event validation exists; no production callback endpoint or settlement. Zero disables this fee."
          },
          "contentId": {
            "type": "string"
          },
          "contentRevision": {
            "type": "integer",
            "minimum": 1
          },
          "id": {
            "type": "string"
          },
          "audienceSnapshots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedAudience"
            }
          },
          "excludedAudienceSnapshots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedAudience"
            }
          },
          "requestedInsights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsightDefinition"
            }
          },
          "contentSnapshot": {
            "$ref": "#/components/schemas/ContentEdition"
          },
          "pricing": {
            "$ref": "#/components/schemas/PricingEstimate"
          },
          "releasePricing": {
            "$ref": "#/components/schemas/PricingEstimate"
          },
          "completionEvent": {
            "type": "string",
            "enum": [
              "arrival_confirmed",
              "response_completed",
              "insight_release_completed"
            ]
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "hostedUrl": {
            "type": "string",
            "format": "uri",
            "readOnly": true,
            "description": "Saved Mementom offer preview. Requires the owning company marketing session; saving a draft does not publish it."
          },
          "verifiedLandingMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Offer-only alias for engagementMinor. Must agree if both are supplied. Verified arrival_confirmed only, never a raw click."
          },
          "cpcMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Company total fee for one distinct confirmed event; cumulative with configured landing/purchase fees, split equally between consumer and platform."
          },
          "continuation": {
            "$ref": "#/components/schemas/QuestionnaireContinuation"
          },
          "continuationOffers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContentEdition"
            },
            "description": "Service-owned immutable offer snapshots. Never accepted as author input."
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "audienceIds",
          "audienceSnapshots",
          "excludedAudienceIds",
          "excludedAudienceSnapshots",
          "refinements",
          "content",
          "questions",
          "requestedInsightIds",
          "requestedInsights",
          "engagementMinor",
          "purchaseMinor",
          "pricing",
          "releasePricing",
          "completionEvent"
        ],
        "additionalProperties": true
      },
      "SavedQuestion": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 1
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "questionType": {
            "type": "string",
            "enum": [
              "multipleChoice",
              "boolean",
              "slider"
            ]
          },
          "answerType": {
            "type": "string",
            "enum": [
              "single",
              "multiple"
            ]
          },
          "maxAnswers": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "step": {
            "type": "integer",
            "minimum": 1
          },
          "insight": {
            "$ref": "#/components/schemas/QuestionInsight"
          },
          "id": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "insightDefinition": {
            "$ref": "#/components/schemas/InsightDefinition"
          },
          "provenance": {
            "const": "self_reported"
          },
          "answerChoices": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "boolean",
                "number"
              ]
            }
          },
          "answerMinValue": {
            "type": "integer",
            "minimum": 0
          },
          "answerMaxValue": {
            "type": "integer",
            "minimum": 0
          },
          "answerTrueLabel": {
            "type": "string"
          },
          "answerFalseLabel": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "prompt",
          "options"
        ],
        "additionalProperties": true,
        "description": "Typed questions include the registered definition snapshot and finite answer domain. Legacy questions retain id, prompt and options without an insight binding."
      },
      "ContentEdition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "offer",
              "questionnaire",
              "insight_request"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/Creative"
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedQuestion"
            }
          },
          "requestedInsightIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requestedInsights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsightDefinition"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "duplicatedFromId": {
            "type": "string"
          },
          "isSample": {
            "type": "boolean"
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "engagementMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Default combined fee in cents. Omission preserves a saved or duplicated value; new content defaults to 200. Campaign placements may select their own fee."
          },
          "purchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "multipleOf": 2,
            "description": "Default combined fee in cents. Omission preserves a saved or duplicated value; new content defaults to 0. Campaign placements may select their own fee."
          },
          "hostedUrl": {
            "type": "string",
            "format": "uri",
            "readOnly": true,
            "description": "Mementom offer preview for the owning company session. Draft saving does not publish it."
          },
          "continuation": {
            "$ref": "#/components/schemas/QuestionnaireContinuation"
          }
        },
        "required": [
          "id",
          "revision",
          "name",
          "type",
          "content",
          "questions",
          "requestedInsightIds"
        ],
        "additionalProperties": true,
        "description": "A saved content snapshot without its editions collection."
      },
      "PricingLine": {
        "type": "object",
        "properties": {
          "definitionId": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "priceMinor": {
            "type": "integer",
            "minimum": 0
          },
          "currency": {
            "const": "USD"
          },
          "licenseDays": {
            "type": "integer",
            "minimum": 0
          },
          "assumption": {
            "type": "boolean"
          },
          "valuation": {
            "$ref": "#/components/schemas/PricingEstimate"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "clickMinor": {
            "type": "integer",
            "minimum": 0
          },
          "purchaseMinor": {
            "type": "integer",
            "minimum": 0
          },
          "purchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "clickPercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          }
        },
        "required": [
          "definitionId",
          "label",
          "source",
          "priceMinor",
          "currency"
        ],
        "additionalProperties": true
      },
      "Tags": {
        "type": "array",
        "maxItems": 12,
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 40
        },
        "description": "Classification tags. IDs are trimmed, lowercased, whitespace is hyphenated, and explicit taxonomy aliases are canonicalized. Up to 12 distinct tags. Metadata does not grant access or change audience matching. Omitted tags preserve existing tags when editing; an empty array clears them."
      },
      "CreativeDesign": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "layout": {
            "type": "string",
            "enum": [
              "image-top",
              "background",
              "text"
            ],
            "description": "Default: image-top."
          },
          "backgroundColor": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "description": "Six-digit hexadecimal color. Default: #ffffff."
          },
          "textColor": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "description": "Six-digit hexadecimal color. Default: #182840."
          },
          "accentColor": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "description": "Six-digit hexadecimal color. Default: #245cdb."
          },
          "buttonTextColor": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "description": "Six-digit hexadecimal color. Default: #ffffff."
          },
          "overlayColor": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "description": "Six-digit hexadecimal color. Default: #000000."
          },
          "overlayOpacity": {
            "type": "number",
            "minimum": 0,
            "maximum": 85,
            "description": "Overlay opacity as a percentage. Default: 45."
          },
          "imagePosition": {
            "type": "string",
            "enum": [
              "center",
              "top",
              "bottom",
              "left",
              "right"
            ],
            "description": "Default: center."
          },
          "textAlign": {
            "type": "string",
            "enum": [
              "left",
              "center"
            ],
            "description": "Default: left."
          },
          "contentPosition": {
            "type": "string",
            "enum": [
              "top",
              "center",
              "bottom"
            ],
            "description": "Default: bottom."
          },
          "fontFamily": {
            "type": "string",
            "enum": [
              "sans",
              "serif"
            ],
            "description": "Default: sans."
          },
          "headlineSize": {
            "type": "string",
            "enum": [
              "small",
              "medium",
              "large"
            ],
            "description": "Default: medium."
          },
          "buttonStyle": {
            "type": "string",
            "enum": [
              "rounded",
              "pill",
              "square"
            ],
            "description": "Default: rounded."
          },
          "imageFit": {
            "type": "string",
            "enum": [
              "cover",
              "contain"
            ],
            "description": "Default: cover."
          }
        },
        "description": "Optional controlled creative styling. Omitted fields use the documented defaults. Unknown settings, arbitrary CSS, null and values outside these enums/ranges are rejected."
      },
      "EventFilter": {
        "type": "object",
        "properties": {
          "property": {
            "type": "string"
          },
          "operator": {
            "type": "string",
            "enum": [
              "equals",
              "gte",
              "lte"
            ]
          },
          "value": {
            "type": [
              "string",
              "number",
              "boolean"
            ]
          }
        },
        "required": [
          "property",
          "operator",
          "value"
        ],
        "additionalProperties": false,
        "description": "Use a registered event property and its permitted value. Numeric properties support equals/gte/lte; other properties support equals. Catalog values must belong to this application."
      },
      "EventMatch": {
        "type": "object",
        "properties": {
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventFilter"
            },
            "maxItems": 8
          },
          "lookbackDays": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "filters"
        ],
        "additionalProperties": false,
        "description": "All filters must match the same event record. Empty filters match any current event. Omit lookbackDays to use the registered window; an explicit lookback cannot exceed that window. Observation timestamps come from the service."
      },
      "CampaignUpdate": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 2
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "objective": {
            "type": "string",
            "enum": [
              "return_visitors",
              "learn_preferences",
              "collect_insights"
            ]
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "budgetMinor": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000000
          },
          "dailyCapMinor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 100000000
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional daily cap. Omitted/null means no separate daily limit; total budget remains enforced."
          },
          "responseWindowHours": {
            "type": "integer",
            "enum": [
              24,
              72,
              168
            ]
          },
          "webActivity": {
            "type": "boolean",
            "deprecated": true,
            "description": "Accepted for compatibility. Each shopper’s Web Activity settings determine delivery of new matched offers and questions."
          },
          "emailDelivery": {
            "type": "string",
            "enum": [
              "mementom",
              "company"
            ],
            "description": "Mementom automatic email or publish the existing campaign message before sending an email update. Omission preserves the saved draft mode."
          },
          "engagements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Engagement"
            },
            "minItems": 1,
            "maxItems": 10
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "campaignId": {
            "type": "string",
            "minLength": 1
          },
          "expectedCampaignRevision": {
            "type": "integer",
            "minimum": 1
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "dailyCapConfigured": {
            "type": "boolean",
            "description": "Preserves declared optional-cap state from saved campaign."
          },
          "senderDomain": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63})?$",
            "description": "Optional domain override for the company’s campaign email. Omit on a new campaign to use the saved keyring default when available; use an empty string to use the application’s allowed domains. Do not send a mailbox."
          },
          "contentSource": {
            "type": "string",
            "enum": [
              "editor",
              "external"
            ],
            "description": "Where the company supplies the campaign message. Omit for older drafts that predate this choice."
          }
        },
        "required": [
          "schemaVersion",
          "name",
          "objective",
          "startAt",
          "endAt",
          "budgetMinor",
          "responseWindowHours",
          "engagements",
          "campaignId",
          "expectedCampaignRevision"
        ],
        "additionalProperties": false,
        "description": "Replaces an existing editable draft using current workspace and campaign revisions. Published campaigns must be duplicated to change creative."
      },
      "CompanyEmailCampaignUpdate": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 2
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "objective": {
            "type": "string",
            "enum": [
              "return_visitors",
              "learn_preferences",
              "collect_insights"
            ]
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "budgetMinor": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000000
          },
          "dailyCapMinor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 100000000
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional daily cap. Omitted/null means no separate daily limit; total budget remains enforced."
          },
          "responseWindowHours": {
            "type": "integer",
            "enum": [
              24,
              72,
              168
            ]
          },
          "webActivity": {
            "type": "boolean",
            "deprecated": true,
            "description": "Accepted for compatibility. Each shopper’s Web Activity settings determine delivery of new matched offers and questions."
          },
          "emailDelivery": {
            "type": "string",
            "const": "brand",
            "description": "Wait for an authenticated company email before releasing the offer to eligible recipients."
          },
          "engagements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanyEmailEngagement"
            },
            "minItems": 1,
            "maxItems": 10
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "campaignId": {
            "type": "string",
            "minLength": 1
          },
          "expectedCampaignRevision": {
            "type": "integer",
            "minimum": 1
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "dailyCapConfigured": {
            "type": "boolean",
            "description": "Preserves declared optional-cap state from saved campaign."
          },
          "senderDomain": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63})?$",
            "description": "Optional domain override for the company’s campaign email. Omit on a new campaign to use the saved keyring default when available; use an empty string to use the application’s allowed domains. Do not send a mailbox."
          },
          "contentSource": {
            "type": "string",
            "enum": [
              "editor",
              "external"
            ],
            "description": "Where the company supplies the campaign message. Omit for older drafts that predate this choice."
          }
        },
        "required": [
          "schemaVersion",
          "name",
          "objective",
          "startAt",
          "endAt",
          "budgetMinor",
          "responseWindowHours",
          "engagements",
          "campaignId",
          "expectedCampaignRevision",
          "emailDelivery"
        ],
        "additionalProperties": false,
        "description": "Replace an editable company-authored campaign draft using current revisions. Specify brand mode; senderDomain is optional and may be cleared with an empty string. Published creative remains immutable."
      },
      "CampaignRelayRequest": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          }
        },
        "required": [
          "campaignId"
        ],
        "additionalProperties": false
      },
      "CampaignRelayAddresses": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "campaignId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^deal-[a-f0-9]{48}@[a-z0-9.-]+\\.[a-z]{2,63}$",
              "description": "Opaque, current campaign relay address. It does not identify a holder or their mailbox."
            }
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "applicationId",
          "campaignId",
          "addresses"
        ],
        "additionalProperties": false,
        "description": "Current campaign relay addresses scoped by company and application."
      },
      "CampaignRelayBroadcast": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "campaignId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "address": {
            "type": "string",
            "pattern": "^broadcast-[a-f0-9]{48}@[a-z0-9.-]+\\.[a-z]{2,63}$",
            "description": "Opaque campaign relay address for one company-authored email to current eligible matches."
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "applicationId",
          "campaignId",
          "address"
        ],
        "additionalProperties": false,
        "description": "Current campaign broadcast relay. No email was sent by this request."
      },
      "CampaignRelayChecklist": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "campaignId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string",
                  "pattern": "^deal-[a-f0-9]{48}@[a-z0-9.-]+\\.[a-z]{2,63}$",
                  "description": "Opaque, current campaign relay address. It does not identify a holder or their mailbox."
                },
                "handled": {
                  "type": "boolean"
                }
              },
              "required": [
                "address",
                "handled"
              ],
              "additionalProperties": false
            }
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "applicationId",
          "campaignId",
          "addresses"
        ],
        "additionalProperties": false,
        "description": "Current relay rows with manual handling markers. A marker is not delivery confirmation."
      },
      "CampaignRelayRecipientHandledRequest": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "address": {
            "type": "string",
            "pattern": "^deal-[a-f0-9]{48}@[a-z0-9.-]+\\.[a-z]{2,63}$",
            "description": "Opaque, current campaign relay address. It does not identify a holder or their mailbox."
          },
          "handled": {
            "type": "boolean"
          }
        },
        "required": [
          "campaignId",
          "address",
          "handled"
        ],
        "additionalProperties": false
      },
      "CampaignRelayRecipientHandled": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "campaignId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "address": {
            "type": "string",
            "pattern": "^deal-[a-f0-9]{48}@[a-z0-9.-]+\\.[a-z]{2,63}$",
            "description": "Opaque, current campaign relay address. It does not identify a holder or their mailbox."
          },
          "handled": {
            "type": "boolean"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "applicationId",
          "campaignId",
          "address",
          "handled"
        ],
        "additionalProperties": false,
        "description": "Saved manual marker for this current relay address. No email was sent by this request."
      },
      "CampaignUpdateMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CampaignUpdate"
              },
              {
                "$ref": "#/components/schemas/CompanyEmailCampaignUpdate"
              }
            ]
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "CampaignIdentityMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "properties": {
              "campaignId": {
                "type": "string",
                "minLength": 1
              },
              "expectedCampaignRevision": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "campaignId",
              "expectedCampaignRevision"
            ],
            "additionalProperties": false
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "CampaignDuplicateMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "properties": {
              "campaignId": {
                "type": "string",
                "minLength": 1
              },
              "expectedCampaignRevision": {
                "type": "integer",
                "minimum": 1
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              }
            },
            "required": [
              "campaignId",
              "expectedCampaignRevision"
            ],
            "additionalProperties": false
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "CampaignStateMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "properties": {
              "campaignId": {
                "type": "string",
                "minLength": 1
              },
              "expectedCampaignRevision": {
                "type": "integer",
                "minimum": 1
              },
              "state": {
                "type": "string",
                "enum": [
                  "paused",
                  "stopped"
                ]
              }
            },
            "required": [
              "campaignId",
              "expectedCampaignRevision",
              "state"
            ],
            "additionalProperties": false
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "CampaignAudiencesMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "properties": {
              "campaignId": {
                "type": "string",
                "minLength": 1
              },
              "expectedCampaignRevision": {
                "type": "integer",
                "minimum": 1
              },
              "engagementId": {
                "type": "string",
                "minLength": 1
              },
              "expectedTargetingRevision": {
                "type": "integer",
                "minimum": 0
              },
              "audienceIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 1,
                "maxItems": 20,
                "uniqueItems": true
              },
              "excludedAudienceIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "maxItems": 20,
                "uniqueItems": true
              }
            },
            "required": [
              "campaignId",
              "expectedCampaignRevision",
              "engagementId",
              "expectedTargetingRevision",
              "audienceIds",
              "excludedAudienceIds"
            ],
            "additionalProperties": false
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "CampaignSettingsMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "campaignId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedCampaignRevision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "expectedTargetingRevision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "minimumCvbRating": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 5,
                    "multipleOf": 0.1
                  }
                },
                "required": [
                  "campaignId",
                  "expectedCampaignRevision",
                  "expectedTargetingRevision",
                  "minimumCvbRating"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "campaignId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedCampaignRevision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "expectedTargetingRevision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "content": {
                    "type": "object",
                    "minProperties": 1,
                    "properties": {
                      "headline": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "body": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      },
                      "cta": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "campaignId",
                  "expectedCampaignRevision",
                  "expectedTargetingRevision",
                  "content"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "campaignId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedCampaignRevision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "expectedTargetingRevision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "responseWindowHours": {
                    "type": "integer",
                    "enum": [
                      24,
                      72,
                      168
                    ]
                  }
                },
                "required": [
                  "campaignId",
                  "expectedCampaignRevision",
                  "expectedTargetingRevision",
                  "responseWindowHours"
                ],
                "additionalProperties": false
              }
            ]
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "CampaignAudienceMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "all",
                      "any"
                    ]
                  },
                  "rules": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Rule"
                    },
                    "minItems": 1,
                    "maxItems": 8
                  },
                  "tags": {
                    "$ref": "#/components/schemas/Tags"
                  },
                  "campaignId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedCampaignRevision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "engagementId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedTargetingRevision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "audienceId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minimumCvbRating": {
                    "$ref": "#/components/schemas/CvbThreshold"
                  },
                  "insightPurchasePercent": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100,
                    "default": 60,
                    "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
                  }
                },
                "required": [
                  "name",
                  "mode",
                  "rules",
                  "campaignId",
                  "expectedCampaignRevision",
                  "engagementId",
                  "expectedTargetingRevision",
                  "audienceId"
                ],
                "additionalProperties": false,
                "description": "A definition ID may appear only once in a simple audience."
              },
              {
                "type": "object",
                "properties": {
                  "schemaVersion": {
                    "const": 2
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
                  },
                  "logic": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/AudienceGroup"
                      },
                      {
                        "properties": {
                          "id": {
                            "const": "head"
                          }
                        }
                      }
                    ]
                  },
                  "criteria": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Criterion"
                    },
                    "minItems": 1,
                    "maxItems": 64
                  },
                  "tags": {
                    "$ref": "#/components/schemas/Tags"
                  },
                  "campaignId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedCampaignRevision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "engagementId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedTargetingRevision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "audienceId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minimumCvbRating": {
                    "$ref": "#/components/schemas/CvbThreshold"
                  },
                  "insightPurchasePercent": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100,
                    "default": 60,
                    "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
                  }
                },
                "required": [
                  "schemaVersion",
                  "name",
                  "logic",
                  "criteria",
                  "campaignId",
                  "expectedCampaignRevision",
                  "engagementId",
                  "expectedTargetingRevision",
                  "audienceId"
                ],
                "additionalProperties": false,
                "description": "Every criterion ID is unique and used by at least one leaf. Root id is head."
              },
              {
                "type": "object",
                "properties": {
                  "schemaVersion": {
                    "const": 3
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
                  },
                  "similarity": {
                    "$ref": "#/components/schemas/SimilaritySpecification"
                  },
                  "tags": {
                    "$ref": "#/components/schemas/Tags"
                  },
                  "minimumCvbRating": {
                    "$ref": "#/components/schemas/CvbThreshold"
                  },
                  "insightPurchasePercent": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100,
                    "default": 60,
                    "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
                  },
                  "campaignId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedCampaignRevision": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "engagementId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedTargetingRevision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "audienceId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "schemaVersion",
                  "name",
                  "similarity",
                  "campaignId",
                  "expectedCampaignRevision",
                  "engagementId",
                  "expectedTargetingRevision",
                  "audienceId"
                ],
                "additionalProperties": false
              }
            ]
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "CvbThreshold": {
        "type": "number",
        "minimum": 0,
        "maximum": 5,
        "enum": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5],
        "description": "Minimum CVB rating from 0.0 to 5.0 in steps of 0.1. Omit for a new campaign to default to 0; draft MCP edits retain the current threshold when omitted. Supply 0 explicitly to remove the threshold."
      },
      "CampaignComparisonRequest": {
        "type": "object",
        "properties": {
          "campaignIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "minItems": 1,
            "uniqueItems": true
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ],
            "default": "live"
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "CampaignLandingTotals": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "companyMinor": {
            "type": "integer",
            "minimum": 0
          },
          "consumerMinor": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "count",
          "companyMinor",
          "consumerMinor"
        ],
        "additionalProperties": false
      },
      "CampaignComparisonTotals": {
        "type": "object",
        "properties": {
          "delivered": {
            "type": "integer",
            "minimum": 0
          },
          "viewed": {
            "type": "integer",
            "minimum": 0
          },
          "started": {
            "type": "integer",
            "minimum": 0
          },
          "responded": {
            "type": "integer",
            "minimum": 0
          },
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "arrivals": {
            "type": "integer",
            "minimum": 0
          },
          "insightsReleased": {
            "type": "integer",
            "minimum": 0
          },
          "purchases": {
            "type": "integer",
            "minimum": 0
          },
          "reversals": {
            "type": "integer",
            "minimum": 0
          },
          "netPurchases": {
            "type": "integer",
            "minimum": 0
          },
          "optedOut": {
            "type": "integer",
            "minimum": 0
          },
          "mature": {
            "type": "integer",
            "minimum": 0
          },
          "matureResponded": {
            "type": "integer",
            "minimum": 0
          },
          "matureStarted": {
            "type": "integer",
            "minimum": 0
          },
          "matureCompleted": {
            "type": "integer",
            "minimum": 0
          },
          "matureArrivals": {
            "type": "integer",
            "minimum": 0
          },
          "matureNetPurchases": {
            "type": "integer",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "minimum": 0
          },
          "timedResponders": {
            "type": "integer",
            "minimum": 0
          },
          "viewTimedResponders": {
            "type": "integer",
            "minimum": 0
          },
          "modeledSpendMinor": {
            "type": "integer",
            "minimum": 0
          },
          "modeledConsumerMinor": {
            "type": "integer",
            "minimum": 0
          },
          "responseRate": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "matureResponseRate": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "costPerResponseMinor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "costPerPurchaseMinor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "revenueMinor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "settledMinor": {
            "type": "null",
            "description": "No settlement integration."
          },
          "windows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "hours": {
                  "type": "integer",
                  "minimum": 0
                },
                "eligible": {
                  "type": "integer",
                  "minimum": 0
                },
                "responded": {
                  "type": "integer",
                  "minimum": 0
                },
                "responseRate": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0
                }
              },
              "required": [
                "hours",
                "eligible",
                "responded",
                "responseRate"
              ],
              "additionalProperties": false
            }
          },
          "campaigns": {
            "type": "integer",
            "minimum": 0
          },
          "budgetMinor": {
            "type": "integer",
            "minimum": 0
          },
          "dailyCapMinor": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "landingTotals": {
            "$ref": "#/components/schemas/CampaignLandingTotals"
          },
          "clicks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "modeledClickMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "modeledCompletionMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "modeledPurchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "modeledInsightMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          }
        },
        "required": [
          "delivered",
          "viewed",
          "started",
          "responded",
          "completed",
          "arrivals",
          "insightsReleased",
          "purchases",
          "reversals",
          "netPurchases",
          "optedOut",
          "mature",
          "matureResponded",
          "matureStarted",
          "matureCompleted",
          "matureArrivals",
          "matureNetPurchases",
          "pending",
          "timedResponders",
          "viewTimedResponders",
          "modeledSpendMinor",
          "modeledConsumerMinor",
          "responseRate",
          "matureResponseRate",
          "costPerResponseMinor",
          "costPerPurchaseMinor",
          "revenueMinor",
          "settledMinor",
          "windows",
          "campaigns",
          "budgetMinor",
          "dailyCapMinor",
          "landingTotals"
        ],
        "description": "Campaign participation totals. Rates divide summed numerators by summed eligible denominators; latency percentiles are not aggregated. Revenue remains unknown unless recorded for all net purchases."
      },
      "CampaignComparisonEntry": {
        "type": "object",
        "properties": {
          "campaignRevision": {
            "type": "integer",
            "minimum": 1
          },
          "windowHours": {
            "type": "integer",
            "minimum": 0
          },
          "budgetMinor": {
            "type": "integer",
            "minimum": 0
          },
          "isSample": {
            "type": "boolean"
          },
          "overview": {
            "$ref": "#/components/schemas/ReportMetrics"
          },
          "recommendations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "evidence": {
                  "type": "string"
                },
                "action": {
                  "type": "string"
                },
                "confidence": {
                  "type": "string"
                }
              },
              "required": [
                "title",
                "evidence",
                "action",
                "confidence"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "paused",
              "stopped",
              "deleted"
            ]
          },
          "dailyCapMinor": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "landingTotals": {
            "$ref": "#/components/schemas/CampaignLandingTotals"
          }
        },
        "required": [
          "campaignRevision",
          "windowHours",
          "budgetMinor",
          "isSample",
          "overview",
          "recommendations",
          "id",
          "name",
          "status",
          "dailyCapMinor",
          "landingTotals"
        ],
        "additionalProperties": false
      },
      "CampaignComparison": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 1
          },
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ],
            "default": "live"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "countingUnit": {
            "const": "campaign_participations"
          },
          "campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CampaignComparisonEntry"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/CampaignComparisonTotals"
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "schemaVersion",
          "applicationId",
          "mode",
          "generatedAt",
          "countingUnit",
          "campaigns",
          "totals",
          "limitations"
        ],
        "additionalProperties": false
      },
      "ProductSearch": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string",
            "maxLength": 200
          },
          "sku": {
            "type": "string",
            "maxLength": 200
          },
          "color": {
            "type": "string",
            "maxLength": 200
          },
          "category": {
            "type": "string",
            "maxLength": 200
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "available": {
            "type": "boolean"
          },
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "ProductLookup": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "variantId": {
            "type": "string",
            "maxLength": 120
          }
        },
        "required": [
          "productId"
        ],
        "additionalProperties": false
      },
      "CampaignPreflightRequest": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "minLength": 1
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "expectedCampaignRevision": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "campaignId"
        ],
        "additionalProperties": false
      },
      "ProductOfferMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          },
          "payload": {
            "type": "object",
            "properties": {
              "productId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "expectedProductRevision": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "discount": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "percent": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      }
                    },
                    "required": [
                      "percent"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Offer discount requires a productId. Omit or supply null for no discount."
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "content": {
                "type": "object",
                "properties": {
                  "headline": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
                  },
                  "cta": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60,
                    "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
                  },
                  "image": {
                    "type": "string",
                    "description": "Optional PNG/JPEG/WebP base64 data URL. Creative writes use a 4 MiB JSON request envelope; uploaded files may be prepared automatically before saving."
                  },
                  "brandName": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Brand shown on the creative. Empty leaves the brand line blank. Plain text only."
                  },
                  "offerLabel": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "Authored offer label or badge. No reward or completion wording is inserted automatically. Plain text only."
                  },
                  "terms": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Offer terms shown as authored. Plain text only."
                  },
                  "promoCode": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Optional promotional code. Plain text only."
                  },
                  "imageAlt": {
                    "type": "string",
                    "maxLength": 180,
                    "description": "Description of the creative image for assistive technology. Plain text only."
                  },
                  "design": {
                    "$ref": "#/components/schemas/CreativeDesign"
                  },
                  "landingDetails": {
                    "type": "string",
                    "maxLength": 5000
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "engagementMinor": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000,
                "multipleOf": 2
              },
              "verifiedLandingMinor": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000,
                "multipleOf": 2
              },
              "purchaseMinor": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000,
                "multipleOf": 2
              },
              "cpcMinor": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000,
                "multipleOf": 2,
                "description": "Company total fee for one distinct confirmed event; cumulative with configured landing/purchase fees, split equally between consumer and platform."
              }
            },
            "required": [
              "productId",
              "expectedProductRevision"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "canonicalProductId": {
            "type": "string"
          },
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "identity": {
            "type": "object",
            "additionalProperties": true
          },
          "variants": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "priceMinor": {
            "type": "integer",
            "minimum": 0
          },
          "currency": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "size": {
            "type": [
              "string",
              "null"
            ]
          },
          "available": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "stock": {
            "type": [
              "integer",
              "null"
            ]
          },
          "stockTracked": {
            "type": "boolean"
          },
          "supportedOfferTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "eligibility": {
            "type": "object",
            "additionalProperties": true
          },
          "redemption": {
            "type": "object",
            "additionalProperties": true
          },
          "revision": {
            "type": "string"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "canonicalProductId",
          "applicationId",
          "name",
          "revision",
          "eligibility"
        ],
        "additionalProperties": true
      },
      "PreflightIssue": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "fieldPath": {
            "type": "string"
          },
          "engagementId": {
            "type": [
              "string",
              "null"
            ]
          },
          "productId": {
            "type": "string"
          },
          "agreementId": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "correctiveAction": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "fieldPath",
          "message",
          "correctiveAction"
        ],
        "additionalProperties": true
      },
      "CampaignPreflight": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "blockers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreflightIssue"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreflightIssue"
            }
          },
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          },
          "revision": {
            "type": "integer"
          },
          "campaignId": {
            "type": [
              "string",
              "null"
            ]
          },
          "campaignRevision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "products": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "financialTerms": {
            "$ref": "#/components/schemas/CampaignFinancialTerms"
          },
          "paymentAgreement": {
            "$ref": "#/components/schemas/CampaignPaymentAgreement"
          },
          "deliveryEligibility": {
            "type": "object"
          },
          "validatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "applicationId",
          "revision",
          "campaignId",
          "valid",
          "blockers",
          "warnings",
          "products",
          "deliveryEligibility",
          "validatedAt"
        ]
      },
      "FinancialTerms": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          },
          "financialTerms": {
            "$ref": "#/components/schemas/CampaignFinancialTerms"
          }
        },
        "required": [
          "applicationId",
          "financialTerms"
        ],
        "additionalProperties": true
      },
      "PaymentAgreement": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          },
          "paymentAgreement": {
            "$ref": "#/components/schemas/CampaignPaymentAgreement"
          }
        },
        "required": [
          "applicationId",
          "paymentAgreement"
        ],
        "additionalProperties": true
      },
      "ProductList": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          },
          "revision": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          },
          "total": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextOffset": {
            "type": [
              "integer",
              "null"
            ]
          },
          "searchableAttributes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "applicationId",
          "revision",
          "items",
          "total",
          "hasMore",
          "nextOffset"
        ],
        "additionalProperties": true
      },
      "ProductResult": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          },
          "revision": {
            "type": "integer"
          },
          "product": {
            "$ref": "#/components/schemas/Product"
          },
          "resolution": {
            "type": "object",
            "properties": {
              "requestedId": {
                "type": "string"
              },
              "canonicalProductId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "kind": {
                "enum": [
                  "canonical",
                  "legacy_alias",
                  "unresolved"
                ]
              },
              "variantId": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [],
            "additionalProperties": true
          },
          "reasons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreflightIssue"
            }
          }
        },
        "required": [
          "applicationId",
          "revision",
          "product",
          "resolution",
          "reasons"
        ],
        "additionalProperties": true
      },
      "CampaignFinancialTerms": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 1
          },
          "amountMeaning": {
            "const": "company_total_cost"
          },
          "currency": {
            "const": "USD"
          },
          "amountUnit": {
            "const": "minor"
          },
          "budgetMinor": {
            "type": [
              "integer",
              "null"
            ]
          },
          "dailyCapMinor": {
            "type": [
              "integer",
              "null"
            ]
          },
          "dailyCapConfigured": {
            "type": "boolean"
          },
          "effectiveDailyCapMinor": {
            "type": [
              "integer",
              "null"
            ]
          },
          "supportedTriggers": {
            "type": "object"
          },
          "budgetEnforcement": {
            "type": "object"
          },
          "attribution": {
            "type": "object"
          },
          "engagements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "engagementId": {
                  "type": "string"
                },
                "cpcMinor": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100000,
                  "multipleOf": 2,
                  "description": "Company total fee for one distinct confirmed event; cumulative with configured landing/purchase fees, split equally between consumer and platform."
                },
                "verifiedLandingMinor": {
                  "type": "integer"
                },
                "completion": {
                  "type": "object"
                },
                "purchase": {
                  "type": "object"
                },
                "insights": {
                  "type": "object"
                },
                "maximumPerDeliveryMinor": {
                  "type": "integer"
                }
              },
              "required": [],
              "additionalProperties": true
            }
          },
          "settlement": {
            "type": "object"
          },
          "paymentAgreement": {
            "$ref": "#/components/schemas/CampaignPaymentAgreement"
          }
        },
        "required": [
          "schemaVersion",
          "amountMeaning",
          "currency",
          "budgetMinor",
          "dailyCapMinor",
          "engagements",
          "settlement",
          "paymentAgreement"
        ],
        "additionalProperties": true
      },
      "CampaignPaymentAgreement": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "agreement": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "informationAvailable": {
            "type": "boolean"
          },
          "campaignCovered": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "additionalAcceptanceRequired": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "status",
          "agreement",
          "informationAvailable",
          "campaignCovered",
          "additionalAcceptanceRequired"
        ],
        "additionalProperties": true
      },
      "PaymentAgreementTerms": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "currency": {
            "const": "USD"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveUntil": {
            "type": "string",
            "format": "date-time"
          },
          "maxCampaignBudgetMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "maxDailyCapMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "maxCpcMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "maxVerifiedLandingMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "maxPurchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "maxInsightMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "campaignIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "text",
          "currency",
          "effectiveFrom",
          "effectiveUntil",
          "maxCampaignBudgetMinor",
          "maxDailyCapMinor",
          "maxCpcMinor",
          "maxVerifiedLandingMinor",
          "maxPurchaseMinor",
          "maxInsightMinor"
        ]
      },
      "PaymentAgreementCreateMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$"
          },
          "payload": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "terms": {
                "$ref": "#/components/schemas/PaymentAgreementTerms"
              }
            },
            "required": [
              "version",
              "terms"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "expectedRevision",
          "idempotencyKey",
          "payload"
        ],
        "additionalProperties": false
      },
      "PaymentAgreementAcceptMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$"
          },
          "payload": {
            "type": "object",
            "properties": {
              "agreementId": {
                "type": "string",
                "maxLength": 120
              },
              "expectedAgreementRevision": {
                "type": "integer",
                "minimum": 1
              },
              "termsDigest": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "accept": {
                "const": true
              }
            },
            "required": [
              "agreementId",
              "expectedAgreementRevision",
              "termsDigest",
              "accept"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "expectedRevision",
          "idempotencyKey",
          "payload"
        ],
        "additionalProperties": false
      },
      "PurchaseReceipt": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "deliveryId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "engagementId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "transactionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "type": {
            "enum": [
              "purchase_confirmed",
              "purchase_reversed"
            ]
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "currency": {
            "const": "USD"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "required": [
          "eventId",
          "deliveryId",
          "engagementId",
          "transactionId",
          "productId",
          "type",
          "amountMinor",
          "currency",
          "occurredAt"
        ]
      },
      "SimilaritySourceSnapshot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "schemaVersion": {
            "const": 2
          },
          "mode": {
            "enum": [
              "all",
              "any",
              "structured"
            ]
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            }
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Criterion"
            }
          },
          "logic": {
            "$ref": "#/components/schemas/AudienceGroup"
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "insightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 60,
            "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
          }
        },
        "required": [
          "id",
          "name",
          "mode",
          "rules"
        ],
        "additionalProperties": false,
        "description": "Service-pinned ordinary source definition. Caller content never overrides saved source lineage."
      },
      "SimilaritySpecification": {
        "type": "object",
        "properties": {
          "sourceAudienceId": {
            "type": "string",
            "minLength": 1
          },
          "sourceRevision": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "sourceSnapshot": {
            "$ref": "#/components/schemas/SimilaritySourceSnapshot",
            "readOnly": true
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "minItems": 2,
            "maxItems": 16
          },
          "balance": {
            "enum": [
              "closest",
              "balanced",
              "wider"
            ],
            "default": "balanced"
          },
          "excludeSource": {
            "type": "boolean",
            "default": true
          },
          "policyVersion": {
            "const": "company-permitted-v1"
          },
          "evaluatorVersion": {
            "const": "predicate-neighbors-v1"
          },
          "refresh": {
            "const": "on_use"
          }
        },
        "required": [
          "sourceAudienceId",
          "sourceRevision",
          "features",
          "balance",
          "excludeSource",
          "policyVersion",
          "evaluatorVersion",
          "refresh"
        ],
        "additionalProperties": false,
        "description": "Service-side non-trained nearest source predicate-pattern evaluator. Closest allows zero differences, Balanced floor(featureCount/3), Wider floor(featureCount/2). Every feature requires current permitted evidence; missing evidence is ineligible. No pooled training or persisted person vectors. Minimum source/result cohorts default20; these are engineering privacy controls, not validated prediction quality."
      },
      "AudienceSimilarity": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 3
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "similarity": {
            "$ref": "#/components/schemas/SimilaritySpecification"
          },
          "tags": {
            "$ref": "#/components/schemas/Tags"
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "insightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 60,
            "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
          }
        },
        "required": [
          "schemaVersion",
          "name",
          "similarity"
        ],
        "additionalProperties": false
      },
      "PricingAllocationCapability": {
        "type": "object",
        "properties": {
          "adjustable": {
            "type": "boolean"
          },
          "defaultPurchasePercent": {
            "const": 60
          },
          "defaultClickPercent": {
            "const": 40
          },
          "minimumPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "maximumPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "agreementId": {
            "type": "string"
          },
          "basis": {
            "type": "string"
          }
        },
        "required": [
          "adjustable",
          "defaultPurchasePercent",
          "defaultClickPercent",
          "minimumPurchasePercent",
          "maximumPurchasePercent",
          "basis"
        ],
        "additionalProperties": false,
        "description": "Authoritative service-owned Mementom/company agreement capability. Spend, CVB, tier or relationship do not automatically grant qualification. No company-facing operation edits the agreement."
      },
      "ActionCostComponent": {
        "type": "object",
        "properties": {
          "kind": {
            "enum": [
              "base",
              "targeting",
              "add_on"
            ]
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "kind",
          "amountMinor"
        ],
        "additionalProperties": false
      },
      "ActionCostPreview": {
        "type": "object",
        "properties": {
          "fullConversionBaseMinor": {
            "type": "integer",
            "minimum": 0,
            "description": "Single complete conversion baseline before personal insight charges. Zero without product context; saved action terms remain authoritative."
          },
          "conversion": {
            "type": "object",
            "description": "Product/price/revision snapshot, retailRate, existing marketTier and marketMultiplier, fullConversionBaseMinor, clickBaseMinor, buyBaseMinor and independent conversion purchasePercent/clickPercent."
          },
          "buyMinor": {
            "type": "integer",
            "minimum": 0
          },
          "clickMinor": {
            "type": "integer",
            "minimum": 0
          },
          "buyComponents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionCostComponent"
            }
          },
          "clickComponents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionCostComponent"
            }
          },
          "clickDataMinor": {
            "type": "integer",
            "minimum": 0
          },
          "purchaseDataMinor": {
            "type": "integer",
            "minimum": 0
          },
          "insightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "insightClickPercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "basis": {
            "type": "string"
          },
          "status": {
            "const": "planning_estimate"
          },
          "currency": {
            "const": "USD"
          }
        },
        "required": [
          "buyMinor",
          "clickMinor",
          "buyComponents",
          "clickComponents",
          "clickDataMinor",
          "purchaseDataMinor",
          "basis"
        ],
        "description": "Company total spend only. Each insight valuation is allocated once across click/purchase with even-cent conservation. Condition rows contain insight costs only; aggregate previews add actual supplied/saved campaign action fees, or documented legacy defaults when no campaign context exists."
      },
      "ActionFeesPreview": {
        "type": "object",
        "properties": {
          "engagementMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          },
          "purchaseMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          },
          "cpcMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          }
        },
        "required": [
          "engagementMinor",
          "purchaseMinor"
        ],
        "additionalProperties": false,
        "description": "Read-only draft action amounts in even whole cents. Changes here do not update a campaign. Use campaignId+engagementId to resolve immutable saved action terms instead."
      },
      "DraftOfferProductPreview": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "variantId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "discount": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "percent": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              }
            },
            "required": [
              "percent"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "productId"
        ],
        "additionalProperties": false,
        "description": "Draft-only catalog offer. The service resolves the current product, variant and discount. Its conversion fees replace draft actionFees when both are provided. Omit this field when quoting a saved campaign."
      },
      "RequestedInsightIdsPreview": {
        "type": "array",
        "maxItems": 20,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "description": "Draft-only requested insights. A selected insight is priced only once if it is also used for targeting. Omit this field when quoting a saved campaign."
      },
      "CountSetRequest": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "audiences": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/AudienceInput"
                },
                {
                  "$ref": "#/components/schemas/SavedAudience"
                }
              ]
            }
          },
          "excludedAudiences": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/AudienceInput"
                },
                {
                  "$ref": "#/components/schemas/SavedAudience"
                }
              ]
            }
          },
          "audienceIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "excludedAudienceIds": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "actionFees": {
            "$ref": "#/components/schemas/ActionFeesPreview"
          },
          "offerProduct": {
            "$ref": "#/components/schemas/DraftOfferProductPreview"
          },
          "requestedInsightIds": {
            "$ref": "#/components/schemas/RequestedInsightIdsPreview"
          },
          "campaignId": {
            "type": "string"
          },
          "engagementId": {
            "type": "string"
          },
          "refinements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "maxItems": 8,
            "description": "Draft-only additional AND conditions. Saved campaign context always uses its immutable engagement refinements."
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          }
        },
        "required": [
          "expectedRevision"
        ],
        "oneOf": [
          {
            "required": [
              "audiences"
            ],
            "not": {
              "required": [
                "audienceIds"
              ]
            }
          },
          {
            "required": [
              "audienceIds"
            ],
            "not": {
              "required": [
                "audiences"
              ]
            }
          }
        ],
        "additionalProperties": false,
        "description": "Choose either actual inclusion/exclusion definitions (including pinned campaign snapshots) or current saved IDs. Inclusion union minus exclusion union is evaluated once per eligible person. At most512 conditions/four similarity audiences; one consistent allocation required. No individual membership is returned. Do not sum component counts. Final targeting is inclusion union AND refinements AND campaign minimum CVB, minus exclusion union. Saved campaignId/engagementId resolves authoritative constraints and cannot be combined with draft targeting or pricing overrides."
      },
      "AudienceCountAggregate": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "available": {
                "const": true
              },
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "eligible": {
                "type": "integer",
                "minimum": 0
              },
              "breakdown": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "logic": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "id",
                    "logic",
                    "count"
                  ],
                  "additionalProperties": false
                }
              },
              "asOf": {
                "type": "string",
                "format": "date-time"
              },
              "basis": {
                "type": "string"
              },
              "sample": {
                "const": false
              },
              "activityId": {
                "$ref": "#/components/schemas/ActivityId"
              }
            },
            "required": [
              "available",
              "count",
              "eligible",
              "breakdown",
              "asOf",
              "basis",
              "sample"
            ]
          },
          {
            "type": "object",
            "properties": {
              "available": {
                "const": false
              },
              "count": {
                "type": "null"
              },
              "reason": {
                "type": "string"
              },
              "activityId": {
                "$ref": "#/components/schemas/ActivityId"
              }
            },
            "required": [
              "available",
              "count",
              "reason"
            ]
          }
        ]
      },
      "AudiencePricingBreakdown": {
        "type": "object",
        "properties": {
          "total": {
            "type": "object",
            "properties": {
              "count": {
                "$ref": "#/components/schemas/AudienceCountAggregate"
              },
              "pricing": {
                "$ref": "#/components/schemas/PricingEstimate"
              }
            },
            "required": [
              "count",
              "pricing"
            ]
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "criterionId": {
                  "type": "string"
                },
                "nodeId": {
                  "type": "string"
                },
                "definitionId": {
                  "type": "string"
                },
                "version": {
                  "type": "integer",
                  "minimum": 1
                },
                "count": {
                  "$ref": "#/components/schemas/AudienceCountAggregate"
                },
                "pricing": {
                  "$ref": "#/components/schemas/PricingEstimate"
                },
                "audienceIndex": {
                  "type": "integer",
                  "minimum": 0
                },
                "role": {
                  "enum": [
                    "include",
                    "exclude",
                    "refinement"
                  ]
                },
                "needsPricedSharedEvidence": {
                  "type": "boolean"
                }
              },
              "required": [
                "criterionId",
                "definitionId",
                "version",
                "count",
                "pricing"
              ]
            }
          }
        },
        "required": [
          "total",
          "conditions"
        ],
        "description": "Independent condition counts over the same eligible population, actual combined total and per-action company costs. The existing CountResult.breakdown node array remains unchanged."
      },
      "SimilarityReadiness": {
        "type": "object",
        "properties": {
          "state": {
            "enum": [
              "ready",
              "insufficient_source",
              "insufficient_candidates",
              "permission_changed",
              "stale",
              "failed"
            ]
          },
          "available": {
            "type": "boolean"
          },
          "count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sourceCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "eligibleCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "minimumSource": {
            "type": "integer",
            "minimum": 3
          },
          "minimumResult": {
            "type": "integer",
            "minimum": 3
          },
          "source": {
            "type": "object"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "bands": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "balance": {
                  "enum": [
                    "closest",
                    "balanced",
                    "wider"
                  ]
                },
                "maximumDifferences": {
                  "type": "integer",
                  "minimum": 0
                },
                "available": {
                  "type": "boolean"
                },
                "count": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              }
            }
          },
          "policyVersion": {
            "const": "company-permitted-v1"
          },
          "evaluatorVersion": {
            "const": "predicate-neighbors-v1"
          },
          "basis": {
            "type": "string"
          },
          "asOf": {
            "type": "string",
            "format": "date-time"
          },
          "quality": {
            "type": "object"
          }
        },
        "required": [
          "state",
          "available",
          "count"
        ],
        "description": "Aggregate-only readiness and distance bands. Below-minimum source/result aggregates are null, never invented zero. No person identities or vectors."
      },
      "AudiencePreviewRequest": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "suggestionId": {
            "type": "string"
          },
          "audience": {
            "$ref": "#/components/schemas/AudienceInput"
          },
          "actionFees": {
            "$ref": "#/components/schemas/ActionFeesPreview"
          },
          "offerProduct": {
            "$ref": "#/components/schemas/DraftOfferProductPreview"
          },
          "requestedInsightIds": {
            "$ref": "#/components/schemas/RequestedInsightIdsPreview"
          },
          "campaignId": {
            "type": "string"
          },
          "engagementId": {
            "type": "string"
          },
          "refinements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "maxItems": 8,
            "description": "Draft-only additional AND conditions. Saved campaign context always uses its immutable engagement refinements."
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          }
        },
        "required": [
          "expectedRevision"
        ],
        "oneOf": [
          {
            "required": [
              "suggestionId"
            ],
            "not": {
              "required": [
                "audience"
              ]
            }
          },
          {
            "required": [
              "audience"
            ],
            "not": {
              "required": [
                "suggestionId"
              ]
            }
          }
        ],
        "additionalProperties": false
      },
      "LookalikePreviewRequest": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "sourceAudienceId": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "minItems": 2,
            "maxItems": 16
          },
          "balance": {
            "enum": [
              "closest",
              "balanced",
              "wider"
            ],
            "default": "balanced"
          },
          "excludeSource": {
            "type": "boolean",
            "default": true
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Nonempty plain text. HTML, control characters and identifying fields are rejected where applicable."
          },
          "minimumCvbRating": {
            "$ref": "#/components/schemas/CvbThreshold"
          },
          "insightPurchasePercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 60,
            "description": "Purchase allocation of the unchanged insight valuation; click receives the remainder. Changes require the company’s current Mementom-negotiated range. Consumer revenue share remains separate."
          },
          "actionFees": {
            "$ref": "#/components/schemas/ActionFeesPreview"
          },
          "offerProduct": {
            "$ref": "#/components/schemas/DraftOfferProductPreview"
          },
          "requestedInsightIds": {
            "$ref": "#/components/schemas/RequestedInsightIdsPreview"
          },
          "campaignId": {
            "type": "string"
          },
          "engagementId": {
            "type": "string"
          },
          "refinements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "maxItems": 8,
            "description": "Draft-only additional AND conditions. Saved campaign context always uses its immutable engagement refinements."
          }
        },
        "required": [
          "expectedRevision",
          "sourceAudienceId",
          "features"
        ],
        "additionalProperties": false
      },
      "AudiencePreviewResult": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "available": {
            "type": "boolean"
          },
          "state": {
            "type": "string"
          },
          "definition": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AudienceInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "existingAudienceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "suggestion": {
            "type": "object"
          },
          "source": {
            "type": "object"
          },
          "policy": {
            "type": "object"
          },
          "count": {
            "$ref": "#/components/schemas/CountResult"
          },
          "pricing": {
            "$ref": "#/components/schemas/PricingEstimate"
          },
          "saved": {
            "const": false
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "applicationId",
          "revision",
          "available",
          "definition",
          "count",
          "saved"
        ],
        "description": "Read-only preview. No audience/content/campaign record is created, no revision is advanced and nothing is launched. Missing suggestion requirements never yield a partial definition."
      },
      "ContinuationOffer": {
        "type": "object",
        "properties": {
          "contentId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "contentRevision": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "contentId",
          "contentRevision"
        ],
        "additionalProperties": false
      },
      "QuestionnaireContinuation": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": 1
          },
          "defaultOffer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContinuationOffer"
              },
              {
                "type": "null"
              }
            ]
          },
          "rules": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "properties": {
                "questionId": {
                  "type": "string",
                  "pattern": "^q(?:[1-9]|10)$"
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "equals",
                    "includes",
                    "between"
                  ]
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      },
                      "minItems": 2,
                      "maxItems": 2
                    }
                  ]
                },
                "offer": {
                  "$ref": "#/components/schemas/ContinuationOffer"
                }
              },
              "required": [
                "questionId",
                "operator",
                "value",
                "offer"
              ],
              "additionalProperties": false
            }
          },
          "returnUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional registered company HTTPS destination. Never carries answers or holder identity."
          }
        },
        "required": [
          "schemaVersion",
          "defaultOffer",
          "rules",
          "returnUrl"
        ],
        "additionalProperties": false
      },
      "CampaignResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "const": "completed"
          },
          "campaignId": {
            "type": "string"
          },
          "engagementId": {
            "type": "string"
          },
          "answers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "questionId": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "values": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  }
                }
              },
              "required": [
                "questionId",
                "prompt",
                "values"
              ],
              "additionalProperties": false
            }
          },
          "completedAt": {
            "type": "string",
            "format": "date-time"
          },
          "offer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContinuationOffer"
              },
              {
                "type": "null"
              }
            ]
          },
          "returnUrl": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "status",
          "answers",
          "completedAt",
          "offer",
          "returnUrl"
        ],
        "additionalProperties": false
      },
      "CampaignResponses": {
        "type": "object",
        "properties": {
          "applicationId": {
            "type": "string"
          },
          "campaignId": {
            "type": "string"
          },
          "responses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CampaignResponse"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "activityId": {
            "type": "string"
          }
        },
        "required": [
          "applicationId",
          "campaignId",
          "responses",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "SessionPurchaseReceipt": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{1,160}$"
          },
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Canonical product ID in this application."
          },
          "type": {
            "enum": [
              "purchase_confirmed",
              "purchase_reversed"
            ]
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000000
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "sessionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "additionalProperties": false,
        "required": [
          "transactionId",
          "productId",
          "type",
          "amountMinor",
          "currency",
          "occurredAt",
          "sessionId"
        ]
      },
      "CampaignOfferAvailability": {
        "type": "object",
        "required": [
          "campaignId",
          "asOf",
          "eligibleAssignedCount",
          "newMatchCapacity",
          "offers"
        ],
        "properties": {
          "campaignId": {
            "type": "string",
            "format": "uuid"
          },
          "asOf": {
            "type": "string",
            "format": "date-time"
          },
          "eligibleAssignedCount": {
            "type": "integer",
            "minimum": 0
          },
          "newMatchCapacity": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Additional matches funded today by this campaign. Null when costs vary or there is no monetary limit."
          },
          "offers": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "engagementId",
                "newMatchCapacity"
              ],
              "properties": {
                "engagementId": {
                  "type": "string"
                },
                "newMatchCapacity": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                }
              }
            }
          }
        }
      },
      "FollowupGroup": {
        "type": "string",
        "enum": [
          "responded",
          "not_responded"
        ]
      },
      "FollowupBinding": {
        "type": "object",
        "properties": {
          "sourceCampaignId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "group": {
            "$ref": "#/components/schemas/FollowupGroup"
          }
        },
        "required": [
          "sourceCampaignId",
          "group"
        ],
        "additionalProperties": false
      },
      "FollowupGroups": {
        "type": "object",
        "properties": {
          "applicationId": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "campaignId": {
            "type": "string"
          },
          "campaignRevision": {
            "type": "integer",
            "minimum": 1
          },
          "asOf": {
            "type": "string",
            "format": "date-time"
          },
          "groups": {
            "type": "object",
            "properties": {
              "responded": {
                "type": "integer",
                "minimum": 0
              },
              "notResponded": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "responded",
              "notResponded"
            ],
            "additionalProperties": false
          },
          "delivered": {
            "type": "integer",
            "minimum": 0
          },
          "optedOut": {
            "type": "integer",
            "minimum": 0
          },
          "canCreate": {
            "type": "boolean"
          },
          "activityId": {
            "$ref": "#/components/schemas/ActivityId"
          }
        },
        "required": [
          "applicationId",
          "campaignId",
          "campaignRevision",
          "asOf",
          "groups",
          "delivered",
          "optedOut",
          "canCreate"
        ],
        "additionalProperties": false
      },
      "FollowupMutation": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "properties": {
              "sourceCampaignId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "group": {
                "$ref": "#/components/schemas/FollowupGroup"
              },
              "campaign": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CampaignV2"
                  },
                  {
                    "$ref": "#/components/schemas/CompanyEmailCampaignV2"
                  }
                ]
              }
            },
            "required": [
              "sourceCampaignId",
              "group",
              "campaign"
            ],
            "additionalProperties": false
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{8,120}$",
            "description": "Optional application/actor/operation-scoped key. Identical retries return original saved receipt; changed payload returns 409. No expiry; capacity 2000 per workspace."
          }
        },
        "required": [
          "expectedRevision",
          "payload"
        ],
        "additionalProperties": false
      }
    }
  },
  "externalDocs": {
    "description": "Company integration guide, configurable Aster example, automation and planned MCP mappings",
    "url": "https://mementom.app/developers/guides/marketing-api.md"
  }
}
