{
  "manifest_version": "1.0.0",
  "template": {
    "id": "50b089ea-fc34-4f39-91ba-fadcce8e30d6",
    "slug": "openwa",
    "name": "OpenWA",
    "description": "OpenWA: self-hosted WhatsApp API gateway with dashboard, webhooks & MCP",
    "url": "https://railway.com/deploy/openwa",
    "upstream": {
      "repo_url": "https://github.com/mc9max/openwa"
    }
  },
  "services": [
    {
      "name": "openwa",
      "source": {
        "repo": "https://github.com/mc9max/openwa"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "TZ",
      "service": "openwa",
      "description": "Timezone for log stamps and 'today' stats. Stored message timestamps are always UTC.",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "PORT",
      "service": "openwa",
      "description": "HTTP listen port. The bundled React dashboard, the REST API (under /api), and Swagger (when enabled) all serve from this one port.",
      "secret": false,
      "strategy": "default",
      "default": "2785"
    },
    {
      "key": "NODE_ENV",
      "service": "openwa",
      "description": "Runtime mode. Keep production (the image ships the production build).",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "DATABASE_TYPE",
      "service": "openwa",
      "description": "Data store: SQLite (zero-config, lives on the openwa-data volume at /app/data) or Postgres (then also set DATABASE_HOST/PORT/USERNAME/PASSWORD, typically a sibling Postgres service).",
      "secret": false,
      "strategy": "default",
      "default": "sqlite"
    },
    {
      "key": "API_MASTER_KEY",
      "service": "openwa",
      "description": "Your admin API key. Prefilled with a fresh owa_k1_<64-hex> key per deployment via Railway's secret() function. OpenWA seeds this exact value as the default ADMIN key on first boot (needs 32+ chars in production); overwrite it with your own value to use that instead. No effect after the first boot (empty key table) — thereafter rotate keys in the dashboard.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "openwa"
      }
    },
    "cli": "railway deploy --template openwa",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "50b089ea-fc34-4f39-91ba-fadcce8e30d6",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "44c31ccf-a198-44f8-81f1-cbd53d33caa3": {
                  "icon": null,
                  "name": "openwa",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/mc9max/openwa",
                    "rootDirectory": null
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "description": "Timezone for log stamps and 'today' stats. Stored message timestamps are always UTC.",
                      "defaultValue": "UTC"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP listen port. The bundled React dashboard, the REST API (under /api), and Swagger (when enabled) all serve from this one port.",
                      "defaultValue": "2785"
                    },
                    "BASE_URL": {
                      "isOptional": true,
                      "description": "Public URL of this instance (e.g. https://openwa-xyz.up.railway.app). Used in outbound payloads and callback examples. Blank = app default.",
                      "defaultValue": ""
                    },
                    "NODE_ENV": {
                      "isOptional": false,
                      "description": "Runtime mode. Keep production (the image ships the production build).",
                      "defaultValue": "production"
                    },
                    "DATABASE_TYPE": {
                      "isOptional": false,
                      "description": "Data store: SQLite (zero-config, lives on the openwa-data volume at /app/data) or Postgres (then also set DATABASE_HOST/PORT/USERNAME/PASSWORD, typically a sibling Postgres service).",
                      "defaultValue": "sqlite"
                    },
                    "API_KEY_PEPPER": {
                      "isOptional": true,
                      "description": "Optional HMAC pepper for API-key hashing. Leave blank to use plain SHA-256. If you set it, set it BEFORE first boot — enabling it later locks out existing keys until the old pepper is restored.",
                      "defaultValue": ""
                    },
                    "API_MASTER_KEY": {
                      "isOptional": false,
                      "description": "Your admin API key. Prefilled with a fresh owa_k1_<64-hex> key per deployment via Railway's secret() function. OpenWA seeds this exact value as the default ADMIN key on first boot (needs 32+ chars in production); overwrite it with your own value to use that instead. No effect after the first boot (empty key table) — thereafter rotate keys in the dashboard.",
                      "defaultValue": "{{API_MASTER_KEY}}"
                    },
                    "ENABLE_SWAGGER": {
                      "isOptional": true,
                      "description": "Set to 'true' to publish interactive API docs at /api/docs (off by default; recommended to leave off on a public domain).",
                      "defaultValue": ""
                    },
                    "AUTO_START_SESSIONS": {
                      "isOptional": true,
                      "description": "Set to 'true' to reconnect previously paired WhatsApp sessions automatically on boot instead of showing a fresh QR code.",
                      "defaultValue": ""
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:2785": {
                        "port": 2785
                      }
                    }
                  },
                  "volumeMounts": {
                    "44c31ccf-a198-44f8-81f1-cbd53d33caa3": {
                      "mountPath": "/app/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-10-08T22:14:43.517Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-10-08T21:51:37.147Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_82925523d94d4ab8831a",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 78,
    "typical_build_seconds": 41,
    "typical_start_seconds": 20,
    "slowest_service": "openwa"
  }
}
