Skip to content

Get the project growth definition + templates + candidate events

projectId
required
string

{ definition, draft, templates, analysisSubjects, events }. Some keys are dynamic — Envelope is FIXED: {definition, draft, templates, analysisSubjects, events}. definition is null when the project has never saved one. definition’s own columns are a fixed schema, BUT its four JSON columns (northStarMetric / aarrrStages / defaultFunnel / defaultRetention) are typed only as Record<string,unknown> / Array<Record<string,unknown>> in the repo layer and are stored as raw JSON text columns. On the WRITE path only aarrrStages is structurally validated (stageSchema, exactly 5 items) — the other three go through z.record(z.string(), z.unknown()) and are stored verbatim. The shapes the app itself writes (from createGrowthDefinitionDraft) are documented below as the observed/typical shape, but the API cannot guarantee them for pre-existing rows, so they are kept permissive. Timestamp formats differ and this is a real inconsistency, not an oversight in this doc: publishedAt is written via new Date().toISOString() (RFC3339 with ms, e.g. “2026-07-24T10:11:12.345Z”) or null; createdAt/updatedAt default to SQLite CURRENT_TIMESTAMP and are stored as TEXT in “YYYY-MM-DD HH:MM:SS” (UTC, space separator, no timezone suffix) — NOT ISO-8601 with a T/Z.

Media typeapplication/json
object
definition
required
object
id
required
string
projectId
required
string
status
required
string
Allowed values: DRAFT PUBLISHED
templateType
required
string
Allowed values: CUSTOM B2B_SAAS CONTENT ECOMMERCE
defaultAnalysisSubject
required
string
Allowed values: EVENT SESSION VISITOR IDENTIFIED_USER ACCOUNT
analysisSubjectKey
required

Must match /^properties(.[a-zA-Z0-9_]+)+$/ when set.

string
nullable
northStarMetric
required

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
key
additional properties
any
aarrrStages
required

Exactly 5 stages when written through PUT (stageSchema.length(5)).

Array<object>
object
key
string
Allowed values: acquisition activation retention revenue referral
label
string
<= 40 characters
description
string
<= 200 characters
successEvents
Array<string>
<= 10 items
conversionWindowDays
integer
nullable >= 1 <= 365
defaultBreakdowns
Array<string>
<= 5 items
key
additional properties
any
defaultFunnel
required

Free-form JSON column. Shape written by this app: {scope: GrowthAnalysisSubject, windowHours: number, steps: string[]}.

object
key
additional properties
any
defaultRetention
required

Free-form JSON column. Shape written by this app: {scope: GrowthAnalysisSubject, startEvent: string|null, returnEvent: string|null, granularity: “day”|“week”|“month”}.

object
key
additional properties
any
publishedAt
required

ISO-8601 with milliseconds and Z, or null.

string
nullable
createdAt
required

SQLite CURRENT_TIMESTAMP text: ‘YYYY-MM-DD HH:MM:SS’ (UTC).

string
updatedAt
required

SQLite CURRENT_TIMESTAMP text: ‘YYYY-MM-DD HH:MM:SS’ (UTC).

string
draft
required

Server-computed suggested definition (never persisted by GET). Fully typed by createGrowthDefinitionDraft — shape is fixed.

object
status
required
string
Allowed values: DRAFT PUBLISHED
templateType
required
string
Allowed values: CUSTOM B2B_SAAS CONTENT ECOMMERCE
defaultAnalysisSubject
required
string
Allowed values: EVENT SESSION VISITOR IDENTIFIED_USER ACCOUNT
analysisSubjectKey
required
string
nullable
northStarMetric
required
object
label
required
string
aggregation
required
string
Allowed values: count sum
scope
required
string
Allowed values: EVENT SESSION VISITOR IDENTIFIED_USER ACCOUNT
eventName
required
string
nullable
propertyPath
required
string
nullable
aarrrStages
required
Array<object>
>= 5 items <= 5 items
object
key
required
string
Allowed values: acquisition activation retention revenue referral
label
required
string
description
required
string
successEvents
required
Array<string>
conversionWindowDays
required
integer
nullable
defaultBreakdowns
required
Array<string>
defaultFunnel
required
object
scope
required
string
Allowed values: EVENT SESSION VISITOR IDENTIFIED_USER ACCOUNT
windowHours
required
number
steps
required
Array<string>
defaultRetention
required
object
scope
required
string
Allowed values: EVENT SESSION VISITOR IDENTIFIED_USER ACCOUNT
startEvent
required
string
nullable
returnEvent
required
string
nullable
granularity
required
string
Allowed values: day week month
candidateEvents
required

First 12 candidate events (draft) / up to 50 (top-level events).

Array<object>
object
eventName
required
string
displayName
required
string
nullable
standardEventCode
required
string
nullable
templates
required

Static constant GROWTH_TEMPLATE_OPTIONS (4 entries).

Array<object>
object
value
required
string
Allowed values: CUSTOM B2B_SAAS CONTENT ECOMMERCE
label
required
string
description
required
string
recommendedSubject
required
string
Allowed values: EVENT SESSION VISITOR IDENTIFIED_USER ACCOUNT
subjectKeyHint
required
string
nullable
analysisSubjects
required

Static constant ANALYSIS_SUBJECT_OPTIONS (5 entries).

Array<object>
object
value
required
string
Allowed values: EVENT SESSION VISITOR IDENTIFIED_USER ACCOUNT
label
required
string
description
required
string
events
required

First 12 candidate events (draft) / up to 50 (top-level events).

Array<object>
object
eventName
required
string
displayName
required
string
nullable
standardEventCode
required
string
nullable