provider insight_variables POST /api/environments/{environment_id}/insight_variables/
@utdk/posthog /api/environments/{environment_id}/insight_variables/
environments_insight_variables_create
environment_id path required
Deprecated. Use /api/projects/{project_id}/ instead.
string

Try it

Authentication
Configure credentials for PostHog API
environmentsInsightVariablesCreate
POST/api/environments/{environment_id}/insight_variables/

Parameters

required

Deprecated. Use /api/projects/{project_id}/ instead.

Input

required

UUID of the SQL variable.

required

Human-readable name for the SQL variable.

required

Variable type. Controls how the value is rendered and substituted in HogQL. * `String` - String * `Number` - Number * `Boolean` - Boolean * `List` - List * `Date` - Date

Default value used when a query references this variable.

required

ID of the user who created the SQL variable.

required

Timestamp when the SQL variable was created.

required

Generated code-safe name used in HogQL as {variables.code_name}. Derived from name.

Allowed values for List variables. Null for other variable types.

Configure credentials above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import posthog from '@utdk/posthog';

await posthog.environmentsInsightVariablesCreate()