Marketing
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
GET | |
DELETE | |
PATCH | |
POST | |
GET | |
POST | |
POST | |
GET | |
GET | |
GET | |
GET | |
GET | |
GET | |
GET | |
POST | |
GET |
Create marketing analytics apply setup ops
Apply one or more setup operations from the setup plan, atomically. Either every operation lands or none does — a partially-applied batch has no well-defined undo. Returns undo_ops, computed from the pre-change state, which can be POSTed back to reverse the batch. Only send apply payloads returned by setup_plan.
Required API key scopes
marketing_analytics:writeRequest parameters
- opsarray
- sourceDefault:
setup_tab
Response
Example request
POST /api /projects /:project_id /marketing_analytics /apply_setup_opsExample response
Status 200 The applied operations and the ops that reverse them
Status 400 An operation was malformed, unsupported, or not applicable
Status 404 Marketing Setup and new dashboard feature flags are both off
Retrieve marketing analytics conversion goals
Read the configured conversion goals for the current project — each with its kind, target, last-30d count, integrated vs non-integrated split, and a misconfiguration flag. Read-only.
Required API key scopes
marketing_analytics:readResponse
Example request
GET /api /projects /:project_id /marketing_analytics /conversion_goalsExample response
Status 200 Configured conversion goals with last-30d performance
Delete marketing analytics conversion goals delete
Remove one conversion goal from the project, leaving the others in place.
Required API key scopes
marketing_analytics:writePath parameters
- conversion_goal_idstring
Response
Example request
DELETE /api /projects /:project_id /marketing_analytics /conversion_goals /:conversion_goal_id /deleteExample response
Status 200 The goals left after the delete
Status 403 Requires project admin access
Status 404 No goal with that conversion_goal_id
Update marketing analytics conversion goals update
Change one conversion goal in place. Fields you send are merged into the stored goal, the rest are kept, and the goal keeps its position in the list. Sending a different kind replaces the goal instead, since the shapes don't share their fields.
Required API key scopes
marketing_analytics:writePath parameters
- conversion_goal_idstring
Request parameters
- goal
Response
Example request
PATCH /api /projects /:project_id /marketing_analytics /conversion_goals /:conversion_goal_id /updateExample response
Status 200 The goal as updated
Status 400 The resulting goal does not match any conversion goal shape
Status 403 Requires project admin access
Status 404 No goal with that conversion_goal_id
Create marketing analytics conversion goals create
Add one conversion goal to the project. The server assigns conversion_goal_id and appends the goal to the end of the list, leaving existing goals untouched.
Required API key scopes
marketing_analytics:writeRequest parameters
- goal
Response
Example request
POST /api /projects /:project_id /marketing_analytics /conversion_goals /createExample response
Status 201 The goal as created
Status 400 The goal does not match any conversion goal shape
Status 403 Requires project admin access
Retrieve marketing analytics conversion recommendations
Required API key scopes
marketing_analytics:readResponse
Example request
GET /api /projects /:project_id /marketing_analytics /conversion_recommendationsExample response
Status 200
Create marketing analytics conversion recommendations start
Required API key scopes
marketing_analytics:writeRequest parameters
- refreshbooleanDefault:
false
Response
Example request
POST /api /projects /:project_id /marketing_analytics /conversion_recommendations /startExample response
Status 200
List all marketing analytics conversion recordings
Required API key scopes
marketing_analytics:readsession_recording:readRequest parameters
- client_query_idstring
- source
- goal_idstring
- groupstring
- source_namestringDefault:
- campaign_idstring | null
- afterstring
- limitintegerDefault:
100
Response
Example request
POST /api /projects /:project_id /marketing_analytics /conversion_recordingsExample response
Status 200
Retrieve marketing analytics data sources
Check the platform → data-warehouse side of every native marketing integration: connection state, sync recency, row counts, required-table status, and schema-mapping coverage. Read-only.
Required API key scopes
marketing_analytics:readQuery parameters
- source_typestring | null
Response
Example request
GET /api /projects /:project_id /marketing_analytics /data_sourcesExample response
Status 200 Per-integration data-source (sync) health
Retrieve marketing analytics diagnose
Aggregate data-source sync health, UTM attribution health, and conversion-goal config into a single per-integration diagnostic with recommended actions. Read-only.
Required API key scopes
marketing_analytics:readQuery parameters
- attribution_lookback_daysintegerDefault:
7 - include_conversion_goalsbooleanDefault:
true - source_typestring | null
Response
Example request
GET /api /projects /:project_id /marketing_analytics /diagnoseExample response
Status 200 End-to-end marketing analytics diagnostic
Retrieve marketing analytics explain conversion goal
Break down a single conversion goal's events over a period by event name, utm_source, and matched integration, with a small sample of events. Read-only.
Required API key scopes
marketing_analytics:readQuery parameters
- conversion_goal_idstring
- date_fromstring | null
- date_tostring | null
Response
Example request
GET /api /projects /:project_id /marketing_analytics /explain_conversion_goalExample response
Status 200 Per-event breakdown of a single conversion goal
Retrieve marketing analytics setup plan
Rank everything wrong with a team's marketing analytics setup into concrete suggestions, each carrying the evidence behind it and — where one exists — an apply operation to pass straight to apply_setup_ops, plus a readiness block saying which capabilities (cost, ROAS, cost per customer, retention by channel) are unlocked and which suggestion is blocking each. Prefer this over diagnose when the question is 'what should I fix next': diagnose explains what is wrong, setup_plan says what to do about it in a form you can act on. Read-only.
Required API key scopes
marketing_analytics:readQuery parameters
- date_fromstringDefault:
-30d - refreshbooleanDefault:
false
Response
Example request
GET /api /projects /:project_id /marketing_analytics /setup_planExample response
Status 200 Ranked, machine-applicable setup suggestions plus per-capability readiness
Status 404 Marketing Setup and new dashboard feature flags are both off
Retrieve marketing analytics source validation
Check connected marketing sources using the same validators as campaign queries. Read-only.
Required API key scopes
marketing_analytics:readResponse
Example request
GET /api /projects /:project_id /marketing_analytics /source_validationExample response
Status 200
Retrieve marketing analytics suggest conversion goals
Rank existing custom events as conversion-goal candidates by volume, UTM-tag coverage, and unique users, excluding system/autocaptured events. Read-only.
Required API key scopes
marketing_analytics:readQuery parameters
- min_countintegerDefault:
50 - top_nintegerDefault:
10
Response
Example request
GET /api /projects /:project_id /marketing_analytics /suggest_conversion_goalsExample response
Status 200 Ranked candidate events for conversion goals
Retrieve marketing analytics suggest utm mappings
Detect unmatched utm_source values from recent events and propose custom_source_mappings entries, alongside the full utm_source catalogue and current mappings. Read-only.
Required API key scopes
marketing_analytics:readQuery parameters
- lookback_daysintegerDefault:
90 - min_event_countintegerDefault:
10
Response
Example request
GET /api /projects /:project_id /marketing_analytics /suggest_utm_mappingsExample response
Status 200 Suggested utm_source → integration mappings
Create marketing analytics test mapping
Example request
POST /api /projects /:project_id /marketing_analytics /test_mappingExample response
Status 200 No response body
Retrieve marketing analytics utm audit
Cross-reference campaigns with spend from ad platforms against pageview events with UTM parameters to identify tracking issues.
Required API key scopes
marketing_analytics:readQuery parameters
- date_fromstringDefault:
-30d - date_tostring | null
Response
Example request
GET /api /projects /:project_id /marketing_analytics /utm_audit










