autoresearch
autoresearch

Resolve a template

Resolve a template key and optional overrides into a concrete pipeline config. For activity-based templates ('likely_active_soon', 'at_risk_of_inactivity', 'return_after_first_use'), the target event is auto-resolved from your event schema — check resolved_activity_event and activity_event_alternatives, then override if needed. For 'feature_adoption' and 'repeat_key_behavior', supply target_event. After resolving, call autoresearch-validate-create to check volume and warnings, then autoresearch-create to create the pipeline.

post/api/projects/{project_id}/autoresearch/resolve-template/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/autoresearch/resolve-template/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request body

template_key'likely_active_soon' | 'at_risk_of_inactivity' | 'return_after_first_use' | 'feature_adoption' | 'repeat_key_behavior' required
  • likely_active_soon - Likely Active Soon
  • at_risk_of_inactivity - At Risk Of Inactivity
  • return_after_first_use - Return After First Use
  • feature_adoption - Feature Adoption
  • repeat_key_behavior - Repeat Key Behavior
target_eventstring

Event name to use as the prediction target. Required for 'feature_adoption' and 'repeat_key_behavior'. Optional override for activity-based templates ('likely_active_soon', 'at_risk_of_inactivity', 'return_after_first_use'); omit to use the auto-resolved event. To predict an action, create the pipeline with target_definition after resolving.

horizon_daysinteger

Override the template's default prediction horizon in days.

Response

Resolved pipeline config. Pass target_event, horizon_days, training_lookback_days, training_population, inference_population, and output_person_property directly to autoresearch-create. Always run autoresearch-validate-create on the resolved config before creating.

template_key'likely_active_soon' | 'at_risk_of_inactivity' | 'return_after_first_use' | 'feature_adoption' | 'repeat_key_behavior' required
  • likely_active_soon - Likely Active Soon
  • at_risk_of_inactivity - At Risk Of Inactivity
  • return_after_first_use - Return After First Use
  • feature_adoption - Feature Adoption
  • repeat_key_behavior - Repeat Key Behavior
display_namestring required

Human-readable template name.

descriptionstring required

What this template predicts.

suggested_namestring required

Suggested pipeline name. Pass as 'name' to autoresearch-create.

target_eventstring required

Resolved target event. Pass as 'target_event' to autoresearch-create. For activity-based templates this is the auto-resolved activity event (or your override).

resolved_activity_eventstring nullable required

Activity event found in your event schema, populated only for templates that auto-resolve the target ('likely_active_soon', 'at_risk_of_inactivity', 'return_after_first_use'). Null for templates where you supply target_event directly.

activity_event_alternativesstring[] required

Other viable activity events found in your schema. If the resolved event is not the right signal, re-resolve with one of these as target_event.

horizon_daysinteger required

Resolved prediction horizon in days.

training_lookback_daysinteger required

Training lookback in days, sized so the horizon leaves room for training examples. Pass as 'training_lookback_days' to autoresearch-create.

training_populationobject required

Resolved training population filter. Pass as 'training_population' to autoresearch-create.

inference_populationobject required

Resolved inference (daily scoring) population filter. Pass as 'inference_population' to autoresearch-create.

output_person_propertystring required

Suggested person property name for prediction scores. Pass as 'output_person_property' to autoresearch-create.

notesstring required

Usage notes and guidance for interpreting this resolved config.

Example response

{
  "training_population": {
    "kind": "performed_event_within_days",
    "event": "$pageview",
    "days": 30
  },
  "inference_population": {
    "kind": "performed_event_within_days",
    "event": "$pageview",
    "days": 30
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.