Skip to content

docs(endpoints): Add documentation for HogQL variable validation#14986

Merged
sarahxsanders merged 4 commits intomasterfrom
docs-writer-ai-update-2026-02-12T15-24-00-053Z
Feb 13, 2026
Merged

docs(endpoints): Add documentation for HogQL variable validation#14986
sarahxsanders merged 4 commits intomasterfrom
docs-writer-ai-update-2026-02-12T15-24-00-053Z

Conversation

@inkeep
Copy link
Contributor

@inkeep inkeep bot commented Feb 12, 2026

Changes

This PR updates the endpoints documentation to reflect the new HogQL variable validation behavior introduced in PostHog/posthog#47622.

Updated files

contents/docs/endpoints/variables.mdx

  • Added new "Variable validation" section explaining that variable placeholders must have matching variable definitions
  • Documents the validation errors users may encounter
  • Links to data management variables page and troubleshooting guide

contents/docs/endpoints/troubleshooting.mdx

  • Expanded the "Variable errors" section with three new validation errors:
    • "Query references undefined variable(s)" - when {variables.X} placeholder doesn't have a matching variable definition
    • "Variable ID(s) not valid UUIDs" - when variable IDs aren't valid UUID format
    • "Variable ID(s) not found" - when variable IDs don't exist in the database
  • Added actionable troubleshooting steps with links to relevant pages

Context

PR #47622 adds server-side validation when creating/updating endpoints to ensure:

  1. Every {variables.X} placeholder has a matching variable with code_name: "X"
  2. Variable IDs are valid UUIDs
  3. Variable IDs reference existing InsightVariable objects

The error messages in the code reference /docs/endpoints/variables, making this documentation update important for users encountering these validation errors.


Triggered by PostHog/posthog#47622

inkeep bot added 2 commits February 12, 2026 15:25
… #47622

Add troubleshooting guidance for three new validation errors introduced in PR #47622:
- "Query references undefined variable(s)" - when placeholders don't have matching definitions
- "Variable ID(s) not valid UUIDs" - when variable IDs aren't valid UUID format
- "Variable ID(s) not found" - when variable IDs don't exist in the project
Add documentation about the new validation that occurs when creating or
updating endpoints with HogQL variables. This includes:
- Explanation that variable placeholders must have matching definitions
- Link to data management variables page
- List of possible validation error messages and how to fix them
- Link to troubleshooting for more details
@inkeep inkeep bot requested a review from a team February 12, 2026 15:26
@vercel
Copy link

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
posthog Ready Ready Preview Feb 12, 2026 10:28pm

Request Review

Copy link
Contributor

@sarahxsanders sarahxsanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Create the variable in [data management variables](https://app.posthog.com/data-management/variables)
- Verify you're using the correct project

> **Note:** `filters_override` is deprecated and will be removed in a future release. Use `variables` instead. See the [variables documentation](/docs/endpoints/variables) for migration guidance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be updated to use the right callout component, with proper spacing

Comment on lines 47 to 49
- **"Query references undefined variable(s)"** - Your query uses a placeholder that doesn't have a matching variable definition. Define the variable with the correct `code_name`.
- **"Variable ID(s) not valid UUIDs"** - Variable IDs must be valid UUIDs.
- **"Variable ID(s) not found"** - The variable doesn't exist. Create it in data management first.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put error messages in code block: Query references undefined variable(s)

inkeep bot added 2 commits February 12, 2026 22:02
…roubleshooting

- Add CalloutBox import
- Change error messages from bold to code blocks for consistency
- Replace blockquote with CalloutBox component for deprecation notice
@inkeep
Copy link
Contributor Author

inkeep bot commented Feb 12, 2026

Thanks for the feedback @sarahxsanders! I've made the requested changes:

contents/docs/endpoints/troubleshooting.mdx:

  • Converted the deprecation notice from a blockquote to a proper <CalloutBox> component with appropriate spacing
  • Also updated the error messages to use code blocks for consistency

contents/docs/endpoints/variables.mdx:

  • Changed error messages from bold text to inline code blocks (e.g., "Query references undefined variable(s)" instead of "Query references undefined variable(s)")

@sarahxsanders sarahxsanders merged commit 5d9cd83 into master Feb 13, 2026
15 checks passed
@sarahxsanders sarahxsanders deleted the docs-writer-ai-update-2026-02-12T15-24-00-053Z branch February 13, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant