provider query GET /api/environments/{environment_id}/query/draft_sql/
@utdk/posthog /api/environments/{environment_id}/query/draft_sql/
environments_query_draft_sql_retrieve
DRF ViewSet mixin that gates coalesced responses behind permission checks. The QueryCoalescingMiddleware attaches cached response data to request.META["_coalesced_response"] for followers. This mixin runs DRF's initial() (auth + permissions + throttling) before returning the cached response, ensuring the request is authorized.
environment_id path required
Deprecated. Use /api/projects/{project_id}/ instead.
string

Try it

Authentication
Configure credentials for PostHog API
environmentsQueryDraftSqlRetrieve
GET/api/environments/{environment_id}/query/draft_sql/
DRF ViewSet mixin that gates coalesced responses behind permission checks. The QueryCoalescingMiddleware attaches cached response data to request.META["_coalesced_response"] for followers. This mixin runs DRF's initial() (auth + permissions + throttling) before returning the cached response, ensuring the request is authorized.

Parameters

required

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

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.environmentsQueryDraftSqlRetrieve()