autoresearch
autoresearch

Manage autoresearch prediction pipelines.

A pipeline defines a target event, population, and horizon. The autoresearch training loop finds the best predictive recipe; the inference workflow scores users daily and emits autoresearch_prediction events.

put/api/projects/{project_id}/autoresearch/{id}/

Request

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

Path parameters

idstring uuid required

A UUID string identifying this autoresearch pipeline.

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

namestring required

Display name for the pipeline.

descriptionstring

Optional free-text description.

target_eventstring

PostHog event name to predict, e.g. '$pageview' or 'signed_up'. Omit when predicting an action target (pass target_definition instead).

horizon_daysinteger

Prediction horizon in days (1-365). The model predicts whether the target event occurs within this window.

training_lookback_daysinteger

How far back to look for training examples (7-730 days). Larger windows give more data but may include stale behavior. Default: 180.

training_populationobject

Training population filter. Use {} for all identified users.

inference_populationobject

Inference population filter. Defaults to training_population if not set.

cadence_daysinteger

Re-score the inference population every N days (1-365). Default: 1.

iteration_budgetinteger

Total training iterations allowed for the autoresearch loop (1-500). Default: 50.

success_aucnumber double nullable

Target AUC threshold (0-1). Training stops early if reached. Default: 0.75.

plateau_iterationsinteger

Stop training if no improvement in this many consecutive iterations (at least 1). Default: 10.

output_person_propertystring

Person property name for the prediction score, e.g. 'predicted_p_pageview'. Auto-derived from target_event if omitted. Letters, digits, and _ $ . - only, and it cannot start with $ (reserved for PostHog's own properties); must be unique among this project's non-archived pipelines.

Example request

{
  "training_population": {
    "properties": [
      {
        "key": "email",
        "type": "person",
        "operator": "is_set"
      }
    ]
  },
  "inference_population": {
    "properties": [
      {
        "key": "email",
        "type": "person",
        "operator": "is_set"
      }
    ]
  }
}

Response

namestring required

Display name for the pipeline.

descriptionstring

Optional free-text description.

target_eventstring

PostHog event name to predict, e.g. '$pageview' or 'signed_up'. Omit when predicting an action target (pass target_definition instead).

horizon_daysinteger

Prediction horizon in days (1-365). The model predicts whether the target event occurs within this window.

training_lookback_daysinteger

How far back to look for training examples (7-730 days). Larger windows give more data but may include stale behavior. Default: 180.

training_populationobject

Training population filter. Use {} for all identified users.

inference_populationobject

Inference population filter. Defaults to training_population if not set.

cadence_daysinteger

Re-score the inference population every N days (1-365). Default: 1.

iteration_budgetinteger

Total training iterations allowed for the autoresearch loop (1-500). Default: 50.

success_aucnumber double nullable

Target AUC threshold (0-1). Training stops early if reached. Default: 0.75.

plateau_iterationsinteger

Stop training if no improvement in this many consecutive iterations (at least 1). Default: 10.

output_person_propertystring

Person property name for the prediction score, e.g. 'predicted_p_pageview'. Auto-derived from target_event if omitted. Letters, digits, and _ $ . - only, and it cannot start with $ (reserved for PostHog's own properties); must be unique among this project's non-archived pipelines.

Example response

{
  "training_population": {
    "properties": [
      {
        "key": "email",
        "type": "person",
        "operator": "is_set"
      }
    ]
  },
  "inference_population": {
    "properties": [
      {
        "key": "email",
        "type": "person",
        "operator": "is_set"
      }
    ]
  }
}

Changes

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