Vision

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

POST
GET

Create vision scanners suggest tags

Suggest classifier tags grounded in the scanner's own observations and the org's product data.

Required API key scopes

replay_scanner:readsession_recording:read

Request parameters

  • prompt
    string
  • tags
    array
  • multi_label
    boolean
    Default: true
  • allow_freeform_tags
    boolean
    Default: false
  • scanner_id
    string | null

Response


Example request

POST /api/projects/:project_id/vision/scanners/suggest_tags
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/vision/scanners/suggest_tags/\
-d prompt="string"

Example response

Status 200
RESPONSE
{
"suggestions": [
{
"tag": "string",
"rationale": "string",
"source": "observed"
}
]
}
Status 503 Tag suggestions couldn't be generated.
RESPONSE
{
"detail": "string"
}

Retrieve vision scanners watch feed

Succeeded observations in the window worth watching, ranked — feeds the What to watch tab.

Required API key scopes

replay_scanner:readsession_recording:read

Query parameters

  • date_from
    string
    Default: -7d
  • date_to
    string
  • limit
    integer
    Default: 20
  • scanner_ids
    string
  • scanner_type
    string
    One of: "monitor""classifier""scorer""summarizer""experiment"
  • search
    string
  • tags
    string

Response


Example request

GET /api/projects/:project_id/vision/scanners/watch_feed
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/vision/scanners/watch_feed/

Example response

Status 200
RESPONSE
{
"results": [
{
"observation": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"scanner_id": "43593f58-da3f-45f0-a7bf-8763ef29bdf1",
"scanner_origin": "configured",
"session_id": "string",
"status": "pending",
"error_reason": "string",
"workflow_id": "string",
"scanner_snapshot": {
"name": "string",
"scanner_type": "monitor",
"scanner_version": 0,
"model": "string",
"provider": "string",
"emits_signals": true,
"scanner_config": null,
"variant_sampling_rates": {
"property1": 0.1,
"property2": 0.1
}
},
"scanner_result": {
"model_output": null,
"signals_count": 0,
"experiment_variant": "string",
"session_duration_s": 0
},
"prompt_question": "string",
"prompt_valence": "good",
"triggered_by": "schedule",
"triggered_by_user": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"backfill_id": "724334b4-c968-4355-bf48-120b6dce0c58",
"distinct_id": "string",
"recording_subject_email": "string",
"previous_observation_id": "bdc4be48-ad44-4150-aaf7-80ca533d4bac",
"next_observation_id": "67a517e1-9b1d-4c86-8d8e-6ec9b5738f26",
"label": {
"is_correct": true,
"feedback": ""
},
"viewed": true,
"media": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "thumbnail",
"position": 0,
"asset_id": 0,
"description": "string",
"video_start_ms": 0,
"video_end_ms": 0
}
],
"summary_line": "string",
"started_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z"
},
"reason": {
"kind": "signal_emitted",
"signals_count": 0,
"problem_types": [
"string"
],
"signals": [
{
"problem_type": "string",
"headline": "string"
}
],
"verdict": "string",
"verdict_share": 0,
"notability": 0,
"jev_probability": 0,
"notability_reason": "string",
"score": 0,
"window_mean": 0,
"tag": "string",
"tag_share": 0
}
}
],
"ranker": "weighted-score"
}