endpoints

Ask AI to rewrite the endpoint's query into a semantically equivalent form that can be materialized. Only applicable to SQL (HogQL) endpoints that currently fail the materialization checks. The suggestion is validated against the live checks before being returned; nothing is saved. Requires the organization's AI data processing approval.

post/api/projects/{project_id}/endpoints/{name}/materialization_suggestion/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/endpoints/{name}/materialization_suggestion/
  • Auth: HTTP bearer

Path parameters

namestring required

URL-safe name for the endpoint

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

versioninteger nullable

Endpoint version to suggest a fix for. Defaults to the latest version.

Response

suggestion_status'ok' | 'cannot_fix' | 'invalid' | 'model_error' required
  • ok - ok
  • cannot_fix - cannot_fix
  • invalid - invalid
  • model_error - model_error
suggested_querystring nullable required

The complete rewritten SQL query, or null when no rewrite was produced.

explanationstring nullable required

User-facing explanation of what was changed and why, or why no fix exists.

attemptsinteger required

How many suggest→validate rounds were used.

errorstring nullable required

Last validation failure when the suggestion did not pass the checks.

original_reasonstring required

The materialization blocker that triggered the suggestion.

Changes

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