Create/update the growth definition (ADMIN)
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Validated by growthDefinitionPayloadSchema (@/lib/growth-definition). Includes status, templateType, defaultAnalysisSubject, analysisSubjectKey, northStarMetric, aarrrStages, defaultFunnel, defaultRetention. status “PUBLISHED” stamps publishedAt.
object
Examplegenerated
{}Responses
Section titled “Responses”{ definition }. Some keys are dynamic — 200 body is exactly {definition: definition is typed DashboardGrowthDefinitionRecord | null because the repository re-reads after upsert (dashboard-growth-definitions.ts:128), so null is reachable in principle; in practice a successful upsert returns the row. Same JSON-column caveats and timestamp formats as growthGetDefinition. publishedAt is set to new Date().toISOString() when status == “PUBLISHED”, otherwise explicitly null. Error bodies: 400 {error: “增长定义配置无效”, issues: detail field on this route).
object
Same shape as growthGetDefinition.definition.
object
Must match /^properties(.[a-zA-Z0-9_]+)+$/ when set.
Free-form JSON column; not validated on write beyond “object or null”. Shape written by this app: {label: string, aggregation: “count”|“sum”, scope: GrowthAnalysisSubject, eventName: string|null, propertyPath: string|null}.
object
Exactly 5 stages when written through PUT (stageSchema.length(5)).
object
Free-form JSON column. Shape written by this app: {scope: GrowthAnalysisSubject, windowHours: number, steps: string[]}.
object
Free-form JSON column. Shape written by this app: {scope: GrowthAnalysisSubject, startEvent: string|null, returnEvent: string|null, granularity: “day”|“week”|“month”}.
object
ISO-8601 with milliseconds and Z, or null.
SQLite CURRENT_TIMESTAMP text: ‘YYYY-MM-DD HH:MM:SS’ (UTC).
SQLite CURRENT_TIMESTAMP text: ‘YYYY-MM-DD HH:MM:SS’ (UTC).
Invalid definition.
Validation error envelope (Zod). issues/details present on schema failures.
object
object
object
Examplegenerated
{ "error": "example", "issues": [ {} ], "details": [ {} ]}Save failed.
object
Human-readable error message.
Examplegenerated
{ "error": "example", "message": "example"}