{
  "generated_at": "2026-04-16T23:58:40.500Z",
  "system": {
    "id": "topolo-messaging",
    "name": "Topolo Messaging",
    "slug": "topolo-messaging",
    "kind": "application",
    "summary": "First-party WhatsApp Business messaging application for multi-number brand workspaces, shared inboxes, campaigns, automations, provider webhooks, and cross-application integration boundaries.",
    "aliases": [],
    "lifecycle": "active",
    "last_verified": "2026-04-16",
    "owners": [
      "platform-experience",
      "messaging-platform"
    ],
    "repo_paths": [
      "PlatformApplications/TopoloMessaging"
    ],
    "service_ids": [
      "srv_topolo_messaging"
    ],
    "visibility": "public",
    "api_contract": {
      "type": "curated",
      "source": "PlatformApplications/TopoloMessaging/functions/api/messaging/[[path]].ts",
      "notes": "Topolo Messaging is a Worker-with-assets application using shared Topolo UI Kit shell, launcher, Auth, command-palette, loading, and BugFix surfaces. It owns a Messaging D1 schema for workspaces, WhatsApp numbers, inboxes, contacts, conversations, messages, campaign drafts, automation definitions, outbound jobs, and webhook events. The app exposes /api/messaging/* for signed workspace operations, /api/auth/* as the same-origin Auth gateway, and /api/messaging/whatsapp/webhook for Meta webhook verification and signed event ingestion. Provider dispatch is queued through Cloudflare Queues; live WhatsApp Cloud API credentials must be provisioned as Worker secrets before outbound jobs move from provider_unconfigured to provider-sent states."
    },
    "primary_hosts": [
      "https://messages.topolo.app"
    ],
    "doc_paths": [
      "applications/messaging",
      "internal/apps/topolo-messaging"
    ],
    "security_assurance": {
      "risk_tier": "high",
      "auth_boundary": "Topolo Auth service access with Messaging-owned inbox, campaign, number, and automation authorization.",
      "tenant_isolation": "organization_scoped",
      "external_inputs": [
        "browser",
        "api",
        "callback",
        "webhook",
        "queue",
        "scheduled_task"
      ],
      "sensitive_data": [
        "identity",
        "org_data",
        "customer_content",
        "telemetry"
      ],
      "last_security_review": "2026-04-16",
      "security_review_status": "not_started",
      "pentest_status": "not_started",
      "evidence_doc": "internal/apps/topolo-messaging"
    },
    "dependencies": [
      "topolo-auth",
      "topolo-bugfix"
    ],
    "public_hub_url": "/systems/topolo-messaging",
    "internal_hub_url": null,
    "application_api_url": "/reference/apps/topolo-messaging",
    "generated_openapi_url": null,
    "machine_urls": {
      "system": "/machine/systems/topolo-messaging.json",
      "application": "/machine/applications/topolo-messaging.json"
    }
  },
  "docs": {
    "public": [
      {
        "id": "applications/messaging.mdx",
        "title": "Topolo Messaging",
        "summary": "Public overview of the Topolo Messaging WhatsApp Business application for inboxes, campaigns, automations, and multi-number brand workspaces.",
        "audience": "public",
        "tags": [
          "messaging",
          "whatsapp",
          "campaigns",
          "automations"
        ],
        "url": "/applications/messaging.mdx",
        "last_verified": "2026-04-16"
      }
    ],
    "internal": [],
    "runbooks": []
  },
  "authority": {
    "owners": [
      "platform-experience",
      "messaging-platform"
    ],
    "repo_paths": [
      "PlatformApplications/TopoloMessaging"
    ],
    "service_ids": [
      "srv_topolo_messaging"
    ],
    "dependencies": [
      "topolo-auth",
      "topolo-bugfix"
    ],
    "aliases": []
  },
  "interfaces": {
    "contract_type": "curated",
    "contract_source": "PlatformApplications/TopoloMessaging/functions/api/messaging/[[path]].ts",
    "contract_source_exists": true,
    "openapi": null,
    "readme": null
  },
  "auth": {
    "depends_on_topolo_auth": true,
    "api_key_scopes": [
      {
        "id": "aks_messaging_automations_manage",
        "name": "automations.manage",
        "description": "Create and manage WhatsApp automation definitions",
        "resourcePattern": null,
        "kind": "api_key_scope"
      },
      {
        "id": "aks_messaging_campaigns_manage",
        "name": "campaigns.manage",
        "description": "Create and manage WhatsApp campaign drafts and send plans",
        "resourcePattern": null,
        "kind": "api_key_scope"
      },
      {
        "id": "aks_messaging_inbox_read",
        "name": "inbox.read",
        "description": "Read WhatsApp inboxes, numbers, conversations, campaigns, and automations",
        "resourcePattern": null,
        "kind": "api_key_scope"
      },
      {
        "id": "aks_messaging_messages_send",
        "name": "messages.send",
        "description": "Create outbound WhatsApp message jobs",
        "resourcePattern": null,
        "kind": "api_key_scope"
      },
      {
        "id": "aks_messaging_numbers_read",
        "name": "numbers.read",
        "description": "Read WhatsApp Business number configuration",
        "resourcePattern": null,
        "kind": "api_key_scope"
      }
    ],
    "service_permissions": [
      {
        "id": "perm_topolo_messaging_automations_manage",
        "name": "automations:manage",
        "description": "Create and manage WhatsApp automation definitions",
        "resourcePattern": "workspace/{workspace_id}/automation/{automation_id}",
        "kind": "permission"
      },
      {
        "id": "perm_topolo_messaging_campaigns_manage",
        "name": "campaigns:manage",
        "description": "Create and manage WhatsApp campaign drafts and send plans",
        "resourcePattern": "workspace/{workspace_id}/campaign/{campaign_id}",
        "kind": "permission"
      },
      {
        "id": "perm_topolo_messaging_context_read",
        "name": "context:read",
        "description": "Look up Auth-owned user and organization context from Messaging",
        "resourcePattern": null,
        "kind": "permission"
      },
      {
        "id": "perm_topolo_messaging_inbox_read",
        "name": "inbox:read",
        "description": "View WhatsApp inboxes, conversations, numbers, campaigns, and automations",
        "resourcePattern": null,
        "kind": "permission"
      },
      {
        "id": "perm_topolo_messaging_inbox_write",
        "name": "inbox:write",
        "description": "Manage inbox conversation state and assignments",
        "resourcePattern": null,
        "kind": "permission"
      },
      {
        "id": "perm_topolo_messaging_messages_send",
        "name": "messages:send",
        "description": "Create outbound WhatsApp message jobs",
        "resourcePattern": "workspace/{workspace_id}/number/{number_id}",
        "kind": "permission"
      },
      {
        "id": "perm_topolo_messaging_numbers_manage",
        "name": "numbers:manage",
        "description": "Register and manage WhatsApp Business phone numbers",
        "resourcePattern": "workspace/{workspace_id}/number/{number_id}",
        "kind": "permission"
      }
    ]
  },
  "runtime": {
    "primary_hosts": [
      "https://messages.topolo.app"
    ],
    "repo_entries": [
      "PlatformApplications/TopoloMessaging/dispatch.wrangler.toml",
      "PlatformApplications/TopoloMessaging/functions/",
      "PlatformApplications/TopoloMessaging/index.html",
      "PlatformApplications/TopoloMessaging/migrations/",
      "PlatformApplications/TopoloMessaging/package-lock.json",
      "PlatformApplications/TopoloMessaging/package.json",
      "PlatformApplications/TopoloMessaging/postcss.config.cjs",
      "PlatformApplications/TopoloMessaging/src/",
      "PlatformApplications/TopoloMessaging/tailwind.config.js",
      "PlatformApplications/TopoloMessaging/topolo.cloudcontrol.json",
      "PlatformApplications/TopoloMessaging/tsconfig.json",
      "PlatformApplications/TopoloMessaging/tsconfig.node.json",
      "PlatformApplications/TopoloMessaging/vite.config.ts",
      "PlatformApplications/TopoloMessaging/wrangler.toml"
    ],
    "wrangler_surfaces": [
      {
        "path": "PlatformApplications/TopoloMessaging/wrangler.toml",
        "observabilityEnabled": true,
        "environments": [],
        "routes": [],
        "vars": [
          "AUTH_API_URL"
        ],
        "bindings": [
          {
            "kind": "d1",
            "binding": "MESSAGING_DB",
            "sourcePath": "PlatformApplications/TopoloMessaging/wrangler.toml",
            "target": "ed144d7f-dd7d-4e49-a645-54c0ba61be7b"
          },
          {
            "kind": "queue",
            "binding": "MESSAGING_OUTBOUND_QUEUE",
            "sourcePath": "PlatformApplications/TopoloMessaging/wrangler.toml",
            "target": "topolo-messaging-prod-outbound"
          },
          {
            "kind": "queue",
            "binding": "MESSAGING_WEBHOOK_QUEUE",
            "sourcePath": "PlatformApplications/TopoloMessaging/wrangler.toml",
            "target": "topolo-messaging-prod-webhooks"
          }
        ],
        "cronTriggers": [],
        "workerName": "topolo-messaging",
        "main": "src/worker.ts",
        "compatibilityDate": "2026-04-16",
        "assetsDirectory": "dist"
      }
    ],
    "packages": [
      {
        "path": "PlatformApplications/TopoloMessaging/package.json",
        "name": "topolo-messaging",
        "description": "First-party WhatsApp Business messaging, inbox, campaign, and automation application for Topolo.",
        "scripts": [
          "dev",
          "build",
          "build:worker",
          "build:dispatch-worker",
          "preview",
          "check",
          "db:migrate",
          "db:migrate:remote",
          "clean"
        ],
        "scriptCommands": [
          {
            "name": "dev",
            "command": "vite"
          },
          {
            "name": "build",
            "command": "tsc && vite build --mode production"
          },
          {
            "name": "build:worker",
            "command": "wrangler deploy --dry-run --outdir .wrangler/deploy-build"
          },
          {
            "name": "build:dispatch-worker",
            "command": "wrangler deploy --config dispatch.wrangler.toml --dry-run --outdir .wrangler/dispatch-deploy-build"
          },
          {
            "name": "preview",
            "command": "vite preview"
          },
          {
            "name": "check",
            "command": "npm run build && npm run build:worker && npm run build:dispatch-worker"
          },
          {
            "name": "db:migrate",
            "command": "wrangler d1 migrations apply MESSAGING_DB"
          },
          {
            "name": "db:migrate:remote",
            "command": "wrangler d1 migrations apply MESSAGING_DB --remote"
          },
          {
            "name": "clean",
            "command": "rm -rf dist .wrangler"
          }
        ]
      }
    ]
  },
  "data": {
    "env_vars": [
      "AUTH_API_URL"
    ],
    "bindings": [
      {
        "kind": "d1",
        "binding": "MESSAGING_DB",
        "sourcePath": "PlatformApplications/TopoloMessaging/wrangler.toml",
        "target": "ed144d7f-dd7d-4e49-a645-54c0ba61be7b"
      }
    ],
    "queue_bindings": [
      {
        "kind": "queue",
        "binding": "MESSAGING_OUTBOUND_QUEUE",
        "sourcePath": "PlatformApplications/TopoloMessaging/wrangler.toml",
        "target": "topolo-messaging-prod-outbound"
      },
      {
        "kind": "queue",
        "binding": "MESSAGING_WEBHOOK_QUEUE",
        "sourcePath": "PlatformApplications/TopoloMessaging/wrangler.toml",
        "target": "topolo-messaging-prod-webhooks"
      }
    ],
    "storage_kinds": [
      "d1"
    ],
    "workflow_signals": [
      "MESSAGING_OUTBOUND_QUEUE -> topolo-messaging-prod-outbound",
      "MESSAGING_WEBHOOK_QUEUE -> topolo-messaging-prod-webhooks"
    ]
  },
  "deployment": {
    "commands": [
      {
        "name": "build",
        "command": "PlatformApplications/TopoloMessaging/package.json :: tsc && vite build --mode production"
      },
      {
        "name": "build:worker",
        "command": "PlatformApplications/TopoloMessaging/package.json :: wrangler deploy --dry-run --outdir .wrangler/deploy-build"
      },
      {
        "name": "build:dispatch-worker",
        "command": "PlatformApplications/TopoloMessaging/package.json :: wrangler deploy --config dispatch.wrangler.toml --dry-run --outdir .wrangler/dispatch-deploy-build"
      },
      {
        "name": "preview",
        "command": "PlatformApplications/TopoloMessaging/package.json :: vite preview"
      }
    ],
    "routes": [],
    "environments": [],
    "assets_directories": [
      "dist"
    ],
    "observability_enabled": true
  },
  "debugging": {
    "failure_modes": [
      "Neither OpenAPI nor README-derived interface detail was found."
    ],
    "entrypoints": [
      "PlatformApplications/TopoloMessaging/wrangler.toml",
      "PlatformApplications/TopoloMessaging/functions/api/messaging/[[path]].ts",
      "PlatformApplications/TopoloMessaging/package.json"
    ]
  }
}