vision

Draft a full scanner configuration from a natural-language goal, for the goal-based creation flow.

post/api/projects/{project_id}/vision/scanners/draft/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/vision/scanners/draft/
  • 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

goalstring required

What the user wants to accomplish, e.g. 'find out where users get stuck during onboarding'.

monthly_credit_budgetinteger

Goal-based flow only: credits a month to spend (1 credit = $0.01). The draft picks the model, then solves sampling_mode and sampling_rate so the projected spend lands on this number, and sets credit_limit to it as a hard cap. Omitted on the legacy flow, and ignored while the goal-based flow's flag is off for the caller.

Response

namestring required

Drafted scanner name.

descriptionstring required

Drafted one-sentence description.

scanner_type'monitor' | 'classifier' | 'scorer' | 'summarizer' | 'experiment' required
  • monitor - Monitor
  • classifier - Classifier
  • scorer - Scorer
  • summarizer - Summarizer
  • experiment - Experiment
scanner_configunknown required
rationalestring required

Why the draft picked this scanner type and configuration, addressed to the user.

queryunknown required
sampling_ratenumber double nullable required

Goal-based flow only: the random sampling rate solved from monthly_credit_budget, 0..1. 1.0 when the budget covers every matching recording. Floored at the minimum rate, so a budget below that floor keeps the minimum. Null whenever sampling_mode is.

credit_limitinteger nullable required

Goal-based flow only: the monthly credit cap, set to monthly_credit_budget so a mis-estimate stops the scanner at the credits the user agreed to. Null on the legacy flow.

estimated_monthly_observationsinteger nullable required

Goal-based flow only: recordings a month the drafted scanner is projected to watch under the solved dials. Its credit cost lands at or under monthly_credit_budget, except when the budget is below what the minimum sampling rate can reach, where this is the floor and exceeds the budget. Null whenever sampling_mode is.

Changes

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