Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

refactor(openapi): move product routing to server-side x-product extension (#59587)

Julian Bez2d0591c79217
diff --git a/.agents/skills/implementing-mcp-tools/SKILL.md b/.agents/skills/implementing-mcp-tools/SKILL.md
index 54412127e391..7aab58182d50 100644
--- a/.agents/skills/implementing-mcp-tools/SKILL.md
+++ b/.agents/skills/implementing-mcp-tools/SKILL.md
@@ -11,9 +11,10 @@ Read the full guide at [docs/published/handbook/engineering/ai/implementing-mcp-
```sh
# 1. Scaffold a starter YAML with all operations disabled.
-# --product discovers endpoints via x-explicit-tags (priority 1) then
+# --product discovers endpoints via x-product (priority 1) then
# URL substring match (fallback). ViewSets in products/<name>/backend/
-# are auto-tagged. ViewSets elsewhere need @extend_schema(tags=["<product>"]).
+# are auto-attributed via module path. ViewSets elsewhere need
+# @extend_schema(extensions={"x-product": "<product>"}).
pnpm --filter=@posthog/mcp run scaffold-yaml -- --product your_product \
--output ../../products/your_product/mcp/tools.yaml
diff --git a/.agents/skills/improving-drf-endpoints/SKILL.md b/.agents/skills/improving-drf-endpoints/SKILL.md
index 0ec71434f869..a720ed2f8415 100644
--- a/.agents/skills/improving-drf-endpoints/SKILL.md
+++ b/.agents/skills/improving-drf-endpoints/SKILL.md
@@ -65,7 +65,7 @@ See [serializer-fields.md](references/serializer-fields.md) for patterns and exa
12. **Error responses are typed** — use `OpenApiResponse(response=ErrorSerializer)`, not `OpenApiTypes.OBJECT`
13. **List endpoints declare pagination** — reset with `pagination_class=None` on custom actions that don't paginate
14. **Prefer `@validated_request`** over manual `serializer.is_valid()` + `@extend_schema` — it handles both in one decorator
-15. **ViewSets outside `products/` need `@extend_schema(tags=["<product>"])`** — ViewSets in `products/<name>/backend/` are auto-tagged via module path, but ViewSets in `posthog/api/` or `ee/` are not. Without the tag, the MCP scaffold and frontend type generator can't route the endpoint to the right product
+15. **ViewSets outside `products/` need `@extend_schema(extensions={"x-product": "<product>"})`** — ViewSets in `products/<name>/backend/` are auto-attributed via module path; ViewSets in `posthog/api/` or `ee/` aren't and must declare attribution explicitly via the `x-product` extension. Accepts a plain string (`"product_analytics"`) or `ProductKey.X` enum (kebab values are normalized). Don't use `tags=["<product>"]` to influence codegen routing — `tags` is for Swagger UI display only. Without `x-product`, the MCP scaffold and frontend type generator can't route the endpoint to the right product
**Streaming endpoints:** For SSE or streaming responses, use `@extend_schema(request=InputSerializer, responses={(200, "text/event-stream"): OpenApiTypes.STR})` to document the request schema even though the response can't be fully typed.
diff --git a/docs/published/handbook/engineering/ai/implementing-mcp-tools.md b/docs/published/handbook/engineering/ai/implementing-mcp-tools.md
index 20a4c25152f2..12cf97592c81 100644
--- a/docs/published/handbook/engineering/ai/implementing-mcp-tools.md
+++ b/docs/published/handbook/engineering/ai/implementing-mcp-tools.md
@@ -168,15 +168,17 @@ Product teams own their definitions and control which operations are exposed as
1. **Scaffold** a starter YAML with all operations disabled.
`--product` discovers endpoints in two ways (same priority as frontend type generation):
- 1. **`x-explicit-tags`** — matches endpoints whose OpenAPI tag equals the product name.
- ViewSets in `products/<name>/backend/` are auto-tagged.
- ViewSets elsewhere (e.g. `posthog/api/`) need `@extend_schema(tags=["<product>"])`.
+ 1. **`x-product`** — matches endpoints whose product attribution equals the product name.
+ ViewSets in `products/<name>/backend/` are auto-attributed via the module path.
+ ViewSets elsewhere (e.g. `posthog/api/`, `ee/`) need
+ `@extend_schema(extensions={"x-product": "<product>"})`.
2. **URL substring fallback** — selects endpoints whose path contains `/<name>/`
(hyphens normalized to underscores).
If your product's API routes use a different slug than the product folder name
(e.g. `workflows` product with `/hog_flows/` routes),
- add `@extend_schema(tags=["workflows"])` to the ViewSet so the scaffold can find them.
+ add `@extend_schema(extensions={"x-product": "workflows"})` to the ViewSet so
+ the scaffold can find them.
```sh
pnpm --filter=@posthog/mcp run scaffold-yaml -- --product your_product
diff --git a/ee/api/rbac/role.py b/ee/api/rbac/role.py
index 4a05413e81b6..9ed63a55dc72 100644
--- a/ee/api/rbac/role.py
+++ b/ee/api/rbac/role.py
@@ -62,7 +62,7 @@ class RoleSerializer(serializers.ModelSerializer):
return organization.default_role_id == role.id
-@extend_schema(tags=["core", "platform_features"])
+@extend_schema(extensions={"x-product": "platform_features"})
class RoleViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "organization"
serializer_class = RoleSerializer
@@ -108,7 +108,7 @@ class RoleMembershipSerializer(serializers.ModelSerializer):
raise serializers.ValidationError("User is already part of the role.")
-@extend_schema(tags=["platform_features"])
+@extend_schema(extensions={"x-product": "platform_features"})
class RoleMembershipViewSet(
TeamAndOrgViewSetMixin,
mixins.ListModelMixin,
diff --git a/ee/api/subscription.py b/ee/api/subscription.py
index 3a06501316a0..3fbe6602ab66 100644
--- a/ee/api/subscription.py
+++ b/ee/api/subscription.py
@@ -643,7 +643,7 @@ class SubscriptionSerializer(serializers.ModelSerializer):
],
),
)
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class SubscriptionViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
scope_object = "subscription"
queryset = Subscription.objects.all()
@@ -905,7 +905,7 @@ class SubscriptionDeliveryCursorPagination(CursorPagination):
responses={200: SubscriptionDeliverySerializer},
),
)
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class SubscriptionDeliveryViewSet(TeamAndOrgViewSetMixin, viewsets.ReadOnlyModelViewSet):
scope_object = "subscription"
queryset = SubscriptionDelivery.objects.all()
diff --git a/ee/clickhouse/views/experiment_holdouts.py b/ee/clickhouse/views/experiment_holdouts.py
index 2c178915adac..9b750877447b 100644
--- a/ee/clickhouse/views/experiment_holdouts.py
+++ b/ee/clickhouse/views/experiment_holdouts.py
@@ -101,7 +101,7 @@ class ExperimentHoldoutSerializer(serializers.ModelSerializer):
return super().update(instance, validated_data)
-@extend_schema(tags=["experiments"], extensions={"x-swagger-tag": "experiment_holdouts"})
+@extend_schema(extensions={"x-swagger-tag": "experiment_holdouts", "x-product": "experiments"})
class ExperimentHoldoutViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "experiment"
queryset = ExperimentHoldout.objects.prefetch_related("created_by").all()
diff --git a/ee/clickhouse/views/experiment_saved_metrics.py b/ee/clickhouse/views/experiment_saved_metrics.py
index 7000850af725..42eb3859a89a 100644
--- a/ee/clickhouse/views/experiment_saved_metrics.py
+++ b/ee/clickhouse/views/experiment_saved_metrics.py
@@ -134,7 +134,7 @@ class ExperimentSavedMetricSerializer(
return ExperimentSavedMetricService(team=self.context["get_team"](), user=request.user)
-@extend_schema(tags=["experiments"], extensions={"x-swagger-tag": "experiment_saved_metrics"})
+@extend_schema(extensions={"x-swagger-tag": "experiment_saved_metrics", "x-product": "experiments"})
class ExperimentSavedMetricViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, viewsets.ModelViewSet):
scope_object = "experiment_saved_metric"
queryset = ExperimentSavedMetric.objects.prefetch_related("created_by").order_by(Lower("name")).all()
diff --git a/ee/clickhouse/views/groups.py b/ee/clickhouse/views/groups.py
index 0941bf173402..7a1ed0ae6889 100644
--- a/ee/clickhouse/views/groups.py
+++ b/ee/clickhouse/views/groups.py
@@ -10,7 +10,7 @@ from django.utils import timezone
import structlog
import posthoganalytics
from drf_spectacular.types import OpenApiTypes
-from drf_spectacular.utils import OpenApiParameter, extend_schema_view
+from drf_spectacular.utils import OpenApiParameter
from loginas.utils import is_impersonated_session
from opentelemetry import trace
from requests import HTTPError
@@ -224,7 +224,6 @@ class CreateGroupSerializer(serializers.ModelSerializer):
fields = ["group_type_index", "group_key", "group_properties"]
-@extend_schema(tags=["core"])
class GroupsViewSet(TeamAndOrgViewSetMixin, mixins.ListModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet):
scope_object = "group"
queryset = Group.objects.all() # nosemgrep: no-direct-persons-db-orm
@@ -951,14 +950,7 @@ class GroupUsageMetricSerializer(serializers.ModelSerializer, UserAccessControlS
)
-@extend_schema_view(
- list=extend_schema(tags=["customer_analytics"]),
- create=extend_schema(tags=["customer_analytics"]),
- retrieve=extend_schema(tags=["customer_analytics"]),
- update=extend_schema(tags=["customer_analytics"]),
- partial_update=extend_schema(tags=["customer_analytics"]),
- destroy=extend_schema(tags=["customer_analytics"]),
-)
+@extend_schema(extensions={"x-product": "customer_analytics"})
class GroupUsageMetricViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "usage_metric"
queryset = GroupUsageMetric.objects.all()
diff --git a/frontend/bin/generate-openapi-types.mjs b/frontend/bin/generate-openapi-types.mjs
index 014c6a2b4e61..c4045ac96073 100755
--- a/frontend/bin/generate-openapi-types.mjs
+++ b/frontend/bin/generate-openapi-types.mjs
@@ -199,9 +199,9 @@ function createTempDir() {
*
* Routing priority:
* 1. Tag matches product folder (includes auto-tags from backend) -> product
- * 2. URL path contains product folder name (fallback) -> product
- * 3. @validated_request decorator in posthog/api/ or ee/ -> core
- * 4. Explicit "core" tag -> core
+ * 2. Explicit "core" tag -> core (authoritative — wins over URL fallback)
+ * 3. URL path contains product folder name (fallback) -> product
+ * 4. @validated_request decorator in posthog/api/ or ee/ -> core
* 5. Otherwise -> skipped
*/
function buildGroupedSchemasByOutput(schema, mappings) {
@@ -226,8 +226,8 @@ function buildGroupedSchemasByOutput(schema, mappings) {
}
const operationId = operation.operationId || ''
- const explicitTags = operation['x-explicit-tags']
- const tags = Array.isArray(explicitTags) && explicitTags.length ? explicitTags : []
+ const productTags = operation['x-product']
+ const tags = Array.isArray(productTags) && productTags.length ? productTags : []
let outputDir = null
let routingMethod = null
@@ -239,7 +239,13 @@ function buildGroupedSchemasByOutput(schema, mappings) {
routingMethod = 'tag'
}
- // Priority 2: URL path contains product folder name (fallback)
+ // Priority 2: Explicit "core" tag is authoritative — devs use it to override URL fallback
+ if (!outputDir && tags.includes('core')) {
+ outputDir = resolveProductToOutputDir(null, mappings.productFoldersOnDisk)
+ routingMethod = 'tag'
+ }
+
+ // Priority 3: URL path contains product folder name (fallback)
if (!outputDir) {
const urlProduct = matchUrlToProduct(pathKey, mappings.productFoldersOnDisk)
if (urlProduct) {
@@ -248,7 +254,7 @@ function buildGroupedSchemasByOutput(schema, mappings) {
}
}
- // Priority 3: @validated_request decorator in core -> core
+ // Priority 4: @validated_request decorator in core -> core
if (!outputDir) {
for (const snakeCase of mappings.validatedRequestViewSets) {
if (operationId === snakeCase || operationId.startsWith(snakeCase + '_')) {
@@ -259,12 +265,6 @@ function buildGroupedSchemasByOutput(schema, mappings) {
}
}
- // Priority 4: Explicit "core" tag
- if (!outputDir && tags.includes('core')) {
- outputDir = resolveProductToOutputDir(null, mappings.productFoldersOnDisk)
- routingMethod = 'tag'
- }
-
// No match - skip
if (!outputDir) {
if (tags.length === 0) {
diff --git a/frontend/src/generated/core/api.schemas.ts b/frontend/src/generated/core/api.schemas.ts
index 0a0e2df30806..6f01a87c40c5 100644
--- a/frontend/src/generated/core/api.schemas.ts
+++ b/frontend/src/generated/core/api.schemas.ts
@@ -2143,90 +2143,26 @@ export interface PatchedProjectBackwardCompatApi {
readonly available_setup_task_ids?: readonly AvailableSetupTaskIdsEnumApi[]
}
-/**
- * * `team` - Only team
- * `global` - Global
- * `feature_flag` - Feature Flag
- */
-export type DashboardTemplateScopeEnumApi =
- (typeof DashboardTemplateScopeEnumApi)[keyof typeof DashboardTemplateScopeEnumApi]
-
-export const DashboardTemplateScopeEnumApi = {
- Team: 'team',
- Global: 'global',
- FeatureFlag: 'feature_flag',
-} as const
-
-export interface DashboardTemplateApi {
- readonly id: string
- /**
- * @maxLength 400
- * @nullable
- */
- template_name?: string | null
- /**
- * @maxLength 400
- * @nullable
- */
- dashboard_description?: string | null
- dashboard_filters?: unknown
- /** @nullable */
- tags?: string[] | null
- tiles?: unknown
- variables?: unknown
- /** @nullable */
- deleted?: boolean | null
- /** @nullable */
- readonly created_at: string | null
- readonly created_by: UserBasicApi
+export interface SharePasswordApi {
+ readonly id: number
+ readonly created_at: string
/**
- * @maxLength 8201
+ * @maxLength 100
* @nullable
*/
- image_url?: string | null
- /** @nullable */
- readonly team_id: number | null
- scope?: DashboardTemplateScopeEnumApi | BlankEnumApi | null
- /** @nullable */
- availability_contexts?: string[] | null
- /** Manually curated; used to highlight templates in the UI. */
- is_featured?: boolean
+ note?: string | null
+ readonly created_by_email: string
+ readonly is_active: boolean
}
-export interface PatchedDashboardTemplateApi {
- readonly id?: string
- /**
- * @maxLength 400
- * @nullable
- */
- template_name?: string | null
- /**
- * @maxLength 400
- * @nullable
- */
- dashboard_description?: string | null
- dashboard_filters?: unknown
- /** @nullable */
- tags?: string[] | null
- tiles?: unknown
- variables?: unknown
- /** @nullable */
- deleted?: boolean | null
- /** @nullable */
- readonly created_at?: string | null
- readonly created_by?: UserBasicApi
- /**
- * @maxLength 8201
- * @nullable
- */
- image_url?: string | null
- /** @nullable */
- readonly team_id?: number | null
- scope?: DashboardTemplateScopeEnumApi | BlankEnumApi | null
+export interface SharingConfigurationApi {
+ readonly created_at: string
+ enabled?: boolean
/** @nullable */
- availability_contexts?: string[] | null
- /** Manually curated; used to highlight templates in the UI. */
- is_featured?: boolean
+ readonly access_token: string | null
+ settings?: unknown
+ password_required?: boolean
+ readonly share_passwords: readonly SharePasswordApi[]
}
/**
@@ -2335,28 +2271,6 @@ export interface PatchedFileSystemApi {
readonly last_viewed_at?: string | null
}
-export interface SharePasswordApi {
- readonly id: number
- readonly created_at: string
- /**
- * @maxLength 100
- * @nullable
- */
- note?: string | null
- readonly created_by_email: string
- readonly is_active: boolean
-}
-
-export interface SharingConfigurationApi {
- readonly created_at: string
- enabled?: boolean
- /** @nullable */
- readonly access_token: string | null
- settings?: unknown
- password_required?: boolean
- readonly share_passwords: readonly SharePasswordApi[]
-}
-
export interface ProjectSecretAPIKeyApi {
readonly id: string
/** @maxLength 40 */
@@ -3226,6 +3140,99 @@ export interface PatchedUserApi {
readonly requires_credential_review?: boolean
}
+export interface UserGitHubAccountApi {
+ /**
+ * GitHub account type for the installation (e.g. User or Organization).
+ * @nullable
+ */
+ type?: string | null
+ /**
+ * GitHub login or organization name tied to the installation.
+ * @nullable
+ */
+ name?: string | null
+}
+
+export interface UserGitHubIntegrationItemApi {
+ /** PostHog UserIntegration row id. */
+ id: string
+ /** Integration kind; always `github` for this API. */
+ kind: string
+ /** GitHub App installation id. */
+ installation_id: string
+ /**
+ * Repository selection mode from GitHub (e.g. selected or all).
+ * @nullable
+ */
+ repository_selection?: string | null
+ /** Installation account metadata from GitHub. */
+ account?: UserGitHubAccountApi | null
+ /** True when this installation id matches a team-level GitHub integration on the active project. */
+ uses_shared_installation: boolean
+ /** When this integration row was created. */
+ created_at: string
+}
+
+export interface UserGitHubIntegrationListResponseApi {
+ /** GitHub personal integrations for the authenticated user. */
+ results: UserGitHubIntegrationItemApi[]
+}
+
+export interface PaginatedUserGitHubIntegrationListResponseListApi {
+ count: number
+ /** @nullable */
+ next?: string | null
+ /** @nullable */
+ previous?: string | null
+ results: UserGitHubIntegrationListResponseApi[]
+}
+
+export interface GitHubBranchesResponseApi {
+ /** List of branch names */
+ branches: string[]
+ /**
+ * The default branch of the repository
+ * @nullable
+ */
+ default_branch?: string | null
+ /** Whether more branches exist beyond the returned page */
+ has_more: boolean
+}
+
+export interface GitHubRepoApi {
+ id: number
+ name: string
+ full_name: string
+}
+
+export interface GitHubReposResponseApi {
+ repositories: GitHubRepoApi[]
+ /** Whether more repositories are available beyond this page. */
+ has_more: boolean
+}
+
+export interface GitHubReposRefreshResponseApi {
+ /** The refreshed repository cache. */
+ repositories: GitHubRepoApi[]
+}
+
+export interface UserGitHubLinkStartRequestApi {
+ /**
+ * Optional team/project id (e.g. PostHog Code); web UI uses the session's current team.
+ * @nullable
+ */
+ team_id?: number | null
+ /** Optional client hint (e.g. posthog_code) for return routing after OAuth. */
+ connect_from?: string
+}
+
+export interface UserGitHubLinkStartResponseApi {
+ /** URL to open in the browser to install or authorize the GitHub App for this user. */
+ install_url: string
+ /** OAuth or install flow used for this GitHub connection. */
+ connect_flow: string
+}
+
/**
* * `later` - Later
* `other` - Other
@@ -3584,3 +3591,55 @@ export type UsersListParams = {
*/
offset?: number
}
+
+export type UsersIntegrationsListParams = {
+ /**
+ * Number of results to return per page.
+ */
+ limit?: number
+ /**
+ * The initial index from which to return the results.
+ */
+ offset?: number
+}
+
+export type UsersIntegrationsGithubBranchesRetrieveParams = {
+ /**
+ * Maximum number of branches to return
+ * @minimum 1
+ * @maximum 1000
+ */
+ limit?: number
+ /**
+ * Number of branches to skip
+ * @minimum 0
+ */
+ offset?: number
+ /**
+ * Repository in owner/repo format
+ * @minLength 1
+ */
+ repo: string
+ /**
+ * Optional case-insensitive branch name search query.
+ */
+ search?: string
+}
+
+export type UsersIntegrationsGithubReposRetrieveParams = {
+ /**
+ * Maximum number of repositories to return per request (max 500).
+ * @minimum 1
+ * @maximum 500
+ */
+ limit?: number
+ /**
+ * Number of repositories to skip before returning results.
+ * @minimum 0
+ */
+ offset?: number
+ /**
+ * Optional case-insensitive repository name search query.
+ */
+ search?: string
+}
diff --git a/frontend/src/generated/core/api.ts b/frontend/src/generated/core/api.ts
index 7ca3b1613898..9f5446630642 100644
--- a/frontend/src/generated/core/api.ts
+++ b/frontend/src/generated/core/api.ts
@@ -14,13 +14,15 @@ import type {
CIMDVerificationTokenApi,
CIMDVerificationTokenWithValueApi,
CimdVerificationTokensListParams,
- DashboardTemplateApi,
DomainsListParams,
EnterprisePropertyDefinitionApi,
ExportedAssetApi,
ExportsListParams,
FileSystemApi,
FileSystemListParams,
+ GitHubBranchesResponseApi,
+ GitHubReposRefreshResponseApi,
+ GitHubReposResponseApi,
InvitesListParams,
OauthApplicationsListParams,
OnboardingSkipRequestApi,
@@ -39,8 +41,8 @@ import type {
PaginatedProjectSecretAPIKeyListApi,
PaginatedSubscriptionDeliveryListApi,
PaginatedSubscriptionListApi,
+ PaginatedUserGitHubIntegrationListResponseListApi,
PaginatedUserListApi,
- PatchedDashboardTemplateApi,
PatchedEnterprisePropertyDefinitionApi,
PatchedFileSystemApi,
PatchedOrganizationDomainApi,
@@ -59,9 +61,14 @@ import type {
SubscriptionsListParams,
SubscriptionsSummaryQuotaRetrieve200,
UserApi,
+ UserGitHubLinkStartRequestApi,
+ UserGitHubLinkStartResponseApi,
UserPushTokenItemApi,
UserPushTokenRegisterRequestApi,
UserPushTokenUnregisterRequestApi,
+ UsersIntegrationsGithubBranchesRetrieveParams,
+ UsersIntegrationsGithubReposRetrieveParams,
+ UsersIntegrationsListParams,
UsersListParams,
} from './api.schemas'
@@ -361,6 +368,21 @@ export const domainsDestroy = async (organizationId: string, id: string, options
})
}
+export const getDomainsScimLogsRetrieveUrl = (organizationId: string, id: string) => {
+ return `/api/organizations/${organizationId}/domains/${id}/scim/logs/`
+}
+
+export const domainsScimLogsRetrieve = async (
+ organizationId: string,
+ id: string,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getDomainsScimLogsRetrieveUrl(organizationId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
export const getDomainsScimTokenCreateUrl = (organizationId: string, id: string) => {
return `/api/organizations/${organizationId}/domains/${id}/scim/token/`
}
@@ -870,72 +892,76 @@ export const organizationsProjectsRotateSecretTokenPartialUpdate = async (
)
}
-export const getDashboardTemplatesRetrieveUrl = (projectId: string, id: string) => {
- return `/api/projects/${projectId}/dashboard_templates/${id}/`
+export const getDashboardsSharingListUrl = (projectId: string, dashboardId: number) => {
+ return `/api/projects/${projectId}/dashboards/${dashboardId}/sharing/`
}
-export const dashboardTemplatesRetrieve = async (
+export const dashboardsSharingList = async (
projectId: string,
- id: string,
+ dashboardId: number,
options?: RequestInit
-): Promise<DashboardTemplateApi> => {
- return apiMutator<DashboardTemplateApi>(getDashboardTemplatesRetrieveUrl(projectId, id), {
+): Promise<SharingConfigurationApi[]> => {
+ return apiMutator<SharingConfigurationApi[]>(getDashboardsSharingListUrl(projectId, dashboardId), {
...options,
method: 'GET',
})
}
-export const getDashboardTemplatesUpdateUrl = (projectId: string, id: string) => {
- return `/api/projects/${projectId}/dashboard_templates/${id}/`
+export const getDashboardsSharingPasswordsCreateUrl = (projectId: string, dashboardId: number) => {
+ return `/api/projects/${projectId}/dashboards/${dashboardId}/sharing/passwords/`
}
-export const dashboardTemplatesUpdate = async (
+/**
+ * Create a new password for the sharing configuration.
+ */
+export const dashboardsSharingPasswordsCreate = async (
projectId: string,
- id: string,
- dashboardTemplateApi?: NonReadonly<DashboardTemplateApi>,
+ dashboardId: number,
+ sharingConfigurationApi?: NonReadonly<SharingConfigurationApi>,
options?: RequestInit
-): Promise<DashboardTemplateApi> => {
- return apiMutator<DashboardTemplateApi>(getDashboardTemplatesUpdateUrl(projectId, id), {
+): Promise<SharingConfigurationApi> => {
+ return apiMutator<SharingConfigurationApi>(getDashboardsSharingPasswordsCreateUrl(projectId, dashboardId), {
...options,
- method: 'PUT',
+ method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(dashboardTemplateApi),
+ body: JSON.stringify(sharingConfigurationApi),
})
}
-export const getDashboardTemplatesPartialUpdateUrl = (projectId: string, id: string) => {
- return `/api/projects/${projectId}/dashboard_templates/${id}/`
+export const getDashboardsSharingPasswordsDestroyUrl = (projectId: string, dashboardId: number, passwordId: string) => {
+ return `/api/projects/${projectId}/dashboards/${dashboardId}/sharing/passwords/${passwordId}/`
}
-export const dashboardTemplatesPartialUpdate = async (
+/**
+ * Delete a password from the sharing configuration.
+ */
+export const dashboardsSharingPasswordsDestroy = async (
projectId: string,
- id: string,
- patchedDashboardTemplateApi?: NonReadonly<PatchedDashboardTemplateApi>,
+ dashboardId: number,
+ passwordId: string,
options?: RequestInit
-): Promise<DashboardTemplateApi> => {
- return apiMutator<DashboardTemplateApi>(getDashboardTemplatesPartialUpdateUrl(projectId, id), {
+): Promise<void> => {
+ return apiMutator<void>(getDashboardsSharingPasswordsDestroyUrl(projectId, dashboardId, passwordId), {
...options,
- method: 'PATCH',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(patchedDashboardTemplateApi),
+ method: 'DELETE',
})
}
-export const getDashboardTemplatesDestroyUrl = (projectId: string, id: string) => {
- return `/api/projects/${projectId}/dashboard_templates/${id}/`
+export const getDashboardsSharingRefreshCreateUrl = (projectId: string, dashboardId: number) => {
+ return `/api/projects/${projectId}/dashboards/${dashboardId}/sharing/refresh/`
}
-/**
- * Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
- */
-export const dashboardTemplatesDestroy = async (
+export const dashboardsSharingRefreshCreate = async (
projectId: string,
- id: string,
+ dashboardId: number,
+ sharingConfigurationApi?: NonReadonly<SharingConfigurationApi>,
options?: RequestInit
-): Promise<unknown> => {
- return apiMutator<unknown>(getDashboardTemplatesDestroyUrl(projectId, id), {
+): Promise<SharingConfigurationApi> => {
+ return apiMutator<SharingConfigurationApi>(getDashboardsSharingRefreshCreateUrl(projectId, dashboardId), {
...options,
- method: 'DELETE',
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(sharingConfigurationApi),
})
}
@@ -1321,6 +1347,79 @@ export const insightsSharingRefreshCreate = async (
})
}
+export const getNotebooksSharingListUrl = (projectId: string, notebookId: string) => {
+ return `/api/projects/${projectId}/notebooks/${notebookId}/sharing/`
+}
+
+export const notebooksSharingList = async (
+ projectId: string,
+ notebookId: string,
+ options?: RequestInit
+): Promise<SharingConfigurationApi[]> => {
+ return apiMutator<SharingConfigurationApi[]>(getNotebooksSharingListUrl(projectId, notebookId), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getNotebooksSharingPasswordsCreateUrl = (projectId: string, notebookId: string) => {
+ return `/api/projects/${projectId}/notebooks/${notebookId}/sharing/passwords/`
+}
+
+/**
+ * Create a new password for the sharing configuration.
+ */
+export const notebooksSharingPasswordsCreate = async (
+ projectId: string,
+ notebookId: string,
+ sharingConfigurationApi?: NonReadonly<SharingConfigurationApi>,
+ options?: RequestInit
+): Promise<SharingConfigurationApi> => {
+ return apiMutator<SharingConfigurationApi>(getNotebooksSharingPasswordsCreateUrl(projectId, notebookId), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(sharingConfigurationApi),
+ })
+}
+
+export const getNotebooksSharingPasswordsDestroyUrl = (projectId: string, notebookId: string, passwordId: string) => {
+ return `/api/projects/${projectId}/notebooks/${notebookId}/sharing/passwords/${passwordId}/`
+}
+
+/**
+ * Delete a password from the sharing configuration.
+ */
+export const notebooksSharingPasswordsDestroy = async (
+ projectId: string,
+ notebookId: string,
+ passwordId: string,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getNotebooksSharingPasswordsDestroyUrl(projectId, notebookId, passwordId), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
+export const getNotebooksSharingRefreshCreateUrl = (projectId: string, notebookId: string) => {
+ return `/api/projects/${projectId}/notebooks/${notebookId}/sharing/refresh/`
+}
+
+export const notebooksSharingRefreshCreate = async (
+ projectId: string,
+ notebookId: string,
+ sharingConfigurationApi?: NonReadonly<SharingConfigurationApi>,
+ options?: RequestInit
+): Promise<SharingConfigurationApi> => {
+ return apiMutator<SharingConfigurationApi>(getNotebooksSharingRefreshCreateUrl(projectId, notebookId), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(sharingConfigurationApi),
+ })
+}
+
export const getProjectSecretApiKeysListUrl = (projectId: string, params?: ProjectSecretApiKeysListParams) => {
const normalizedParams = new URLSearchParams()
@@ -1950,6 +2049,195 @@ export const usersHedgehogConfigPartialUpdate = async (
})
}
+export const getUsersIntegrationsListUrl = (uuid: string, params?: UsersIntegrationsListParams) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/users/${uuid}/integrations/?${stringifiedParams}`
+ : `/api/users/${uuid}/integrations/`
+}
+
+/**
+ * `/api/users/@me/integrations/` — manage the user's personal GitHub integrations.
+ * @summary List personal GitHub integrations
+ */
+export const usersIntegrationsList = async (
+ uuid: string,
+ params?: UsersIntegrationsListParams,
+ options?: RequestInit
+): Promise<PaginatedUserGitHubIntegrationListResponseListApi> => {
+ return apiMutator<PaginatedUserGitHubIntegrationListResponseListApi>(getUsersIntegrationsListUrl(uuid, params), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getUsersIntegrationsGithubDestroyUrl = (uuid: string, installationId: string) => {
+ return `/api/users/${uuid}/integrations/github/${installationId}/`
+}
+
+/**
+ * Remove a specific GitHub installation by its installation_id.
+ * @summary Disconnect a personal GitHub integration
+ */
+export const usersIntegrationsGithubDestroy = async (
+ uuid: string,
+ installationId: string,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getUsersIntegrationsGithubDestroyUrl(uuid, installationId), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
+export const getUsersIntegrationsGithubBranchesRetrieveUrl = (
+ uuid: string,
+ installationId: string,
+ params: UsersIntegrationsGithubBranchesRetrieveParams
+) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/users/${uuid}/integrations/github/${installationId}/branches/?${stringifiedParams}`
+ : `/api/users/${uuid}/integrations/github/${installationId}/branches/`
+}
+
+/**
+ * List branches for a repository accessible to a personal GitHub installation.
+ * @summary List branches for a personal GitHub installation repository
+ */
+export const usersIntegrationsGithubBranchesRetrieve = async (
+ uuid: string,
+ installationId: string,
+ params: UsersIntegrationsGithubBranchesRetrieveParams,
+ options?: RequestInit
+): Promise<GitHubBranchesResponseApi> => {
+ return apiMutator<GitHubBranchesResponseApi>(
+ getUsersIntegrationsGithubBranchesRetrieveUrl(uuid, installationId, params),
+ {
+ ...options,
+ method: 'GET',
+ }
+ )
+}
+
+export const getUsersIntegrationsGithubReposRetrieveUrl = (
+ uuid: string,
+ installationId: string,
+ params?: UsersIntegrationsGithubReposRetrieveParams
+) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/users/${uuid}/integrations/github/${installationId}/repos/?${stringifiedParams}`
+ : `/api/users/${uuid}/integrations/github/${installationId}/repos/`
+}
+
+/**
+ * List repositories accessible to a specific GitHub installation (paginated, cached).
+ * @summary List repositories for a personal GitHub installation
+ */
+export const usersIntegrationsGithubReposRetrieve = async (
+ uuid: string,
+ installationId: string,
+ params?: UsersIntegrationsGithubReposRetrieveParams,
+ options?: RequestInit
+): Promise<GitHubReposResponseApi> => {
+ return apiMutator<GitHubReposResponseApi>(
+ getUsersIntegrationsGithubReposRetrieveUrl(uuid, installationId, params),
+ {
+ ...options,
+ method: 'GET',
+ }
+ )
+}
+
+export const getUsersIntegrationsGithubReposRefreshCreateUrl = (uuid: string, installationId: string) => {
+ return `/api/users/${uuid}/integrations/github/${installationId}/repos/refresh/`
+}
+
+/**
+ * Refresh repositories accessible to a specific GitHub installation.
+ * @summary Refresh repositories for a personal GitHub installation
+ */
+export const usersIntegrationsGithubReposRefreshCreate = async (
+ uuid: string,
+ installationId: string,
+ options?: RequestInit
+): Promise<GitHubReposRefreshResponseApi> => {
+ return apiMutator<GitHubReposRefreshResponseApi>(
+ getUsersIntegrationsGithubReposRefreshCreateUrl(uuid, installationId),
+ {
+ ...options,
+ method: 'POST',
+ }
+ )
+}
+
+export const getUsersIntegrationsGithubStartCreateUrl = (uuid: string) => {
+ return `/api/users/${uuid}/integrations/github/start/`
+}
+
+/**
+ * Start GitHub linking: either full App install or OAuth-only (user-to-server).
+
+``**_kwargs`` absorbs ``parent_lookup_uuid`` from the nested
+``/api/users/{uuid}/integrations/`` router (same pattern as ``local_evaluation``
+under projects).
+
+Usually returns ``install_url`` pointing at ``/installations/new`` so the
+user can pick any GitHub org (new or already connected). GitHub's install
+page handles both cases: orgs where the app is installed show "Configure"
+(no admin needed), orgs where it isn't show "Install" (needs admin).
+
+**OAuth fast path:** when the current project already has a team-level
+GitHub installation, and the user has no ``UserIntegration`` for that
+installation yet, we skip the org picker and redirect straight to
+``/login/oauth/authorize`` so the user only authorizes themselves.
+``connect_from`` is preserved for first-party clients so they return to
+the originating client immediately.
+
+In both cases the response key is ``install_url`` for compatibility with callers.
+ * @summary Start GitHub personal integration linking
+ */
+export const usersIntegrationsGithubStartCreate = async (
+ uuid: string,
+ userGitHubLinkStartRequestApi?: UserGitHubLinkStartRequestApi,
+ options?: RequestInit
+): Promise<UserGitHubLinkStartResponseApi> => {
+ return apiMutator<UserGitHubLinkStartResponseApi>(getUsersIntegrationsGithubStartCreateUrl(uuid), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(userGitHubLinkStartRequestApi),
+ })
+}
+
export const getUsersOnboardingSkipCreateUrl = (uuid: string) => {
return `/api/users/${uuid}/onboarding/skip/`
}
diff --git a/frontend/src/generated/core/api.zod.ts b/frontend/src/generated/core/api.zod.ts
index 0af1fcaaae05..495921dbfd5a 100644
--- a/frontend/src/generated/core/api.zod.ts
+++ b/frontend/src/generated/core/api.zod.ts
@@ -2202,72 +2202,19 @@ export const OrganizationsProjectsRotateSecretTokenPartialUpdateBody = /* @__PUR
})
.describe('Mixin for serializers to add user access control fields')
-export const dashboardTemplatesUpdateBodyTemplateNameMax = 400
-
-export const dashboardTemplatesUpdateBodyDashboardDescriptionMax = 400
-
-export const dashboardTemplatesUpdateBodyTagsItemMax = 255
-
-export const dashboardTemplatesUpdateBodyImageUrlMax = 8201
-
-export const dashboardTemplatesUpdateBodyAvailabilityContextsItemMax = 255
-
-export const DashboardTemplatesUpdateBody = /* @__PURE__ */ zod.object({
- template_name: zod.string().max(dashboardTemplatesUpdateBodyTemplateNameMax).nullish(),
- dashboard_description: zod.string().max(dashboardTemplatesUpdateBodyDashboardDescriptionMax).nullish(),
- dashboard_filters: zod.unknown().optional(),
- tags: zod.array(zod.string().max(dashboardTemplatesUpdateBodyTagsItemMax)).nullish(),
- tiles: zod.unknown().optional(),
- variables: zod.unknown().optional(),
- deleted: zod.boolean().nullish(),
- image_url: zod.string().max(dashboardTemplatesUpdateBodyImageUrlMax).nullish(),
- scope: zod
- .union([
- zod
- .enum(['team', 'global', 'feature_flag'])
- .describe('\* `team` - Only team\n\* `global` - Global\n\* `feature_flag` - Feature Flag'),
- zod.enum(['']),
- zod.null(),
- ])
- .optional(),
- availability_contexts: zod
- .array(zod.string().max(dashboardTemplatesUpdateBodyAvailabilityContextsItemMax))
- .nullish(),
- is_featured: zod.boolean().optional().describe('Manually curated; used to highlight templates in the UI.'),
+/**
+ * Create a new password for the sharing configuration.
+ */
+export const DashboardsSharingPasswordsCreateBody = /* @__PURE__ */ zod.object({
+ enabled: zod.boolean().optional(),
+ settings: zod.unknown().optional(),
+ password_required: zod.boolean().optional(),
})
-export const dashboardTemplatesPartialUpdateBodyTemplateNameMax = 400
-
-export const dashboardTemplatesPartialUpdateBodyDashboardDescriptionMax = 400
-
-export const dashboardTemplatesPartialUpdateBodyTagsItemMax = 255
-
-export const dashboardTemplatesPartialUpdateBodyImageUrlMax = 8201
-
-export const dashboardTemplatesPartialUpdateBodyAvailabilityContextsItemMax = 255
-
-export const DashboardTemplatesPartialUpdateBody = /* @__PURE__ */ zod.object({
- template_name: zod.string().max(dashboardTemplatesPartialUpdateBodyTemplateNameMax).nullish(),
- dashboard_description: zod.string().max(dashboardTemplatesPartialUpdateBodyDashboardDescriptionMax).nullish(),
- dashboard_filters: zod.unknown().optional(),
- tags: zod.array(zod.string().max(dashboardTemplatesPartialUpdateBodyTagsItemMax)).nullish(),
- tiles: zod.unknown().optional(),
- variables: zod.unknown().optional(),
- deleted: zod.boolean().nullish(),
- image_url: zod.string().max(dashboardTemplatesPartialUpdateBodyImageUrlMax).nullish(),
- scope: zod
- .union([
- zod
- .enum(['team', 'global', 'feature_flag'])
- .describe('\* `team` - Only team\n\* `global` - Global\n\* `feature_flag` - Feature Flag'),
- zod.enum(['']),
- zod.null(),
- ])
- .optional(),
- availability_contexts: zod
- .array(zod.string().max(dashboardTemplatesPartialUpdateBodyAvailabilityContextsItemMax))
- .nullish(),
- is_featured: zod.boolean().optional().describe('Manually curated; used to highlight templates in the UI.'),
+export const DashboardsSharingRefreshCreateBody = /* @__PURE__ */ zod.object({
+ enabled: zod.boolean().optional(),
+ settings: zod.unknown().optional(),
+ password_required: zod.boolean().optional(),
})
export const ExportsCreateBody = /* @__PURE__ */ zod
@@ -2430,6 +2377,21 @@ export const InsightsSharingRefreshCreateBody = /* @__PURE__ */ zod.object({
password_required: zod.boolean().optional(),
})
+/**
+ * Create a new password for the sharing configuration.
+ */
+export const NotebooksSharingPasswordsCreateBody = /* @__PURE__ */ zod.object({
+ enabled: zod.boolean().optional(),
+ settings: zod.unknown().optional(),
+ password_required: zod.boolean().optional(),
+})
+
+export const NotebooksSharingRefreshCreateBody = /* @__PURE__ */ zod.object({
+ enabled: zod.boolean().optional(),
+ settings: zod.unknown().optional(),
+ password_required: zod.boolean().optional(),
+})
+
export const projectSecretApiKeysCreateBodyLabelMax = 40
export const ProjectSecretApiKeysCreateBody = /* @__PURE__ */ zod.object({
@@ -3117,6 +3079,39 @@ export const UsersHedgehogConfigPartialUpdateBody = /* @__PURE__ */ zod.object({
),
})
+/**
+ * Start GitHub linking: either full App install or OAuth-only (user-to-server).
+
+``**_kwargs`` absorbs ``parent_lookup_uuid`` from the nested
+``/api/users/{uuid}/integrations/`` router (same pattern as ``local_evaluation``
+under projects).
+
+Usually returns ``install_url`` pointing at ``/installations/new`` so the
+user can pick any GitHub org (new or already connected). GitHub's install
+page handles both cases: orgs where the app is installed show "Configure"
+(no admin needed), orgs where it isn't show "Install" (needs admin).
+
+**OAuth fast path:** when the current project already has a team-level
+GitHub installation, and the user has no ``UserIntegration`` for that
+installation yet, we skip the org picker and redirect straight to
+``/login/oauth/authorize`` so the user only authorizes themselves.
+``connect_from`` is preserved for first-party clients so they return to
+the originating client immediately.
+
+In both cases the response key is ``install_url`` for compatibility with callers.
+ * @summary Start GitHub personal integration linking
+ */
+export const UsersIntegrationsGithubStartCreateBody = /* @__PURE__ */ zod.object({
+ team_id: zod
+ .number()
+ .nullish()
+ .describe("Optional team\/project id (e.g. PostHog Code); web UI uses the session's current team."),
+ connect_from: zod
+ .string()
+ .optional()
+ .describe('Optional client hint (e.g. posthog_code) for return routing after OAuth.'),
+})
+
/**
* Mark the current user as having exited onboarding with a non-delegated reason.
Idempotent: the skip timestamp is only set on the first successful call.
diff --git a/frontend/src/scenes/user-research/UserInterviews.stories.tsx b/frontend/src/scenes/user-research/UserInterviews.stories.tsx
index 66958d67f360..ceec2253a7df 100644
--- a/frontend/src/scenes/user-research/UserInterviews.stories.tsx
+++ b/frontend/src/scenes/user-research/UserInterviews.stories.tsx
@@ -98,7 +98,7 @@ const meta: Meta<Empty> = {
decorators: [
mswDecorator({
get: {
- '/api/environments/:team_id/user_interview_topics/': toPaginatedResponse(MOCK_TOPICS),
+ '/api/projects/:team_id/user_interview_topics/': toPaginatedResponse(MOCK_TOPICS),
},
post: {
'/api/environments/:team_id/user_interviews/search/': MOCK_SEARCH_RESULTS,
@@ -127,7 +127,7 @@ export const SearchNoResults: Story = {
decorators: [
mswDecorator({
get: {
- '/api/environments/:team_id/user_interview_topics/': toPaginatedResponse(MOCK_TOPICS),
+ '/api/projects/:team_id/user_interview_topics/': toPaginatedResponse(MOCK_TOPICS),
},
post: {
'/api/environments/:team_id/user_interviews/search/': [] as UserInterviewSearchResultApi[],
diff --git a/posthog/api/advanced_activity_logs/viewset.py b/posthog/api/advanced_activity_logs/viewset.py
index 9283c87d88f7..f9a56113299d 100644
--- a/posthog/api/advanced_activity_logs/viewset.py
+++ b/posthog/api/advanced_activity_logs/viewset.py
@@ -144,7 +144,7 @@ class ActivityLogQueryParamsSerializer(serializers.Serializer):
)
-@extend_schema(tags=["activity_logs", "platform_features"])
+@extend_schema(tags=["activity_logs"], extensions={"x-product": "platform_features"})
class ActivityLogViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet, mixins.ListModelMixin):
scope_object = "activity_log"
queryset = ActivityLog.objects.all()
@@ -376,7 +376,7 @@ class AvailableFiltersResponseSerializer(serializers.Serializer):
detail_fields = serializers.DictField(help_text="Discovered detail fields and their value distributions.")
-@extend_schema(tags=["platform_features"])
+@extend_schema(extensions={"x-product": "platform_features"})
class AdvancedActivityLogsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet, mixins.ListModelMixin):
serializer_class = ActivityLogSerializer
pagination_class = ActivityLogPagination
@@ -572,7 +572,7 @@ class OrganizationActivityLogPermission(BasePermission):
return membership.level >= OrganizationMembership.Level.ADMIN
-@extend_schema(tags=["activity_logs", "platform_features"])
+@extend_schema(tags=["activity_logs"], extensions={"x-product": "platform_features"})
class OrganizationAdvancedActivityLogsViewSet(AdvancedActivityLogsViewSet):
"""
Organization-wide view of activity logs across every project in the organization.
diff --git a/posthog/api/annotation.py b/posthog/api/annotation.py
index 2434f47a26c7..a0951a7d020e 100644
--- a/posthog/api/annotation.py
+++ b/posthog/api/annotation.py
@@ -6,7 +6,6 @@ from django.db.models import Q, QuerySet
from django.db.models.signals import post_save
from django.dispatch import receiver
-from drf_spectacular.utils import extend_schema
from rest_framework import filters, pagination, serializers, viewsets
from posthog.api.forbid_destroy_model import ForbidDestroyModel
@@ -129,7 +128,6 @@ class AnnotationsLimitOffsetPagination(pagination.LimitOffsetPagination):
default_limit = 1000
-@extend_schema(tags=["core"])
class AnnotationsViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
"""
Create, Read, Update and Delete annotations. [See docs](https://posthog.com/docs/data/annotations) for more information on annotations.
diff --git a/posthog/api/cimd_verification_token.py b/posthog/api/cimd_verification_token.py
index a0cf129ebae0..96e2f6cdc33b 100644
--- a/posthog/api/cimd_verification_token.py
+++ b/posthog/api/cimd_verification_token.py
@@ -56,7 +56,7 @@ class CIMDVerificationTokenWithValueSerializer(CIMDVerificationTokenSerializer):
read_only_fields = [*CIMDVerificationTokenSerializer.Meta.read_only_fields, "value"]
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class CIMDVerificationTokenViewSet(
TeamAndOrgViewSetMixin,
mixins.CreateModelMixin,
diff --git a/posthog/api/cohort.py b/posthog/api/cohort.py
index b083b39893cb..d5215fcb8a06 100644
--- a/posthog/api/cohort.py
+++ b/posthog/api/cohort.py
@@ -1128,7 +1128,6 @@ class CohortSerializer(serializers.ModelSerializer):
return representation
-@extend_schema(tags=["core"])
class CohortViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
queryset = Cohort.objects.all()
serializer_class = CohortSerializer
diff --git a/posthog/api/column_configuration.py b/posthog/api/column_configuration.py
index 46ef4c134b2a..2b7882b1cc07 100644
--- a/posthog/api/column_configuration.py
+++ b/posthog/api/column_configuration.py
@@ -54,7 +54,7 @@ class ColumnConfigurationSerializer(serializers.ModelSerializer):
return values
-@extend_schema(tags=[ProductKey.PRODUCT_ANALYTICS])
+@extend_schema(extensions={"x-product": ProductKey.PRODUCT_ANALYTICS})
class ColumnConfigurationViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "INTERNAL"
queryset = ColumnConfiguration.objects.all()
diff --git a/posthog/api/comments.py b/posthog/api/comments.py
index d90796601a1e..448b78e0bdef 100644
--- a/posthog/api/comments.py
+++ b/posthog/api/comments.py
@@ -215,7 +215,7 @@ class CommentListQueryParamsSerializer(serializers.Serializer):
)
-@extend_schema(tags=["core", "platform_features"])
+@extend_schema(extensions={"x-product": "platform_features"})
class CommentViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
queryset = Comment.objects.all()
serializer_class = CommentSerializer
diff --git a/posthog/api/data_color_theme.py b/posthog/api/data_color_theme.py
index 4b95d27c2b11..b870627637d3 100644
--- a/posthog/api/data_color_theme.py
+++ b/posthog/api/data_color_theme.py
@@ -70,7 +70,7 @@ class DataColorThemeSerializer(PublicDataColorThemeSerializer, UserAccessControl
return super().create(validated_data, *args, **kwargs)
-@extend_schema(tags=["dashboards"])
+@extend_schema(extensions={"x-product": "dashboards"})
class DataColorThemeViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "project"
queryset = DataColorTheme.objects.all().order_by("-created_at")
diff --git a/posthog/api/documentation.py b/posthog/api/documentation.py
index 0c9ae08a0bac..915c0ab41e03 100644
--- a/posthog/api/documentation.py
+++ b/posthog/api/documentation.py
@@ -764,7 +764,8 @@ def preprocess_exclude_path_format(endpoints, **kwargs):
# Track product folder for auto-tagging
product = _get_product_from_module(callback.cls.__module__)
if product:
- _endpoint_product_mapping[(path, method)] = product
+ # Normalize {pk} → {id} so postprocessing lookup matches drf-spectacular's emission.
+ _endpoint_product_mapping[(path.replace("{pk}", "{id}"), method)] = product
result.append((path, path_regex, method, callback))
return result
@@ -1071,22 +1072,41 @@ def custom_postprocessing_hook(result, generator, request, public):
if is_deprecated_env:
definition["deprecated"] = True
- # Preserve explicit tags from @extend_schema before filtering/adding auto-derived ones
- # Exclude auto-derived URL structure tags (projects, environments) - these aren't real product tags
- explicit_tags = [d for d in definition.get("tags", []) if d not in ["projects", "environments"]]
-
- # Auto-add product tag for ViewSets in products/*/backend/
- product = _endpoint_product_mapping.get((path, method.upper()))
- if product and product not in explicit_tags:
- explicit_tags.append(product)
+ # Resolve x-product for codegen routing.
+ #
+ # Priority (highest first):
+ # 1. Explicit ``@extend_schema(extensions={"x-product": ...})`` — authoritative.
+ # Accepts a string, enum-like (e.g. ``ProductKey.X``, stringified), or a list.
+ # Kebab values are normalized to snake_case so output matches folder names.
+ # When present, NOTHING else is added — the dev intent wins. Use this to send
+ # an endpoint to the core bucket from inside ``products/<X>/backend/`` (e.g.
+ # ``extensions={"x-product": "core"}``).
+ # 2. ``@extend_schema(tags=[...])`` values matching a product folder — supported
+ # for legacy call sites; the explicit form above is preferred for new code.
+ # Non-folder tag values are dropped here (tags=[...] is for display, not routing).
+ # 3. Module-path auto-attribution: ViewSet in ``products/<name>/backend/`` → ``<name>``.
+ #
+ # The resulting list is read by ``generate-openapi-types.mjs`` and
+ # ``services/mcp/scripts/scaffold-yaml.ts``.
+ x_product_override = definition.pop("x-product", None)
+ if x_product_override is not None and not isinstance(x_product_override, list):
+ x_product_override = [x_product_override]
+
+ if x_product_override:
+ x_product = [str(v).replace("-", "_") for v in x_product_override]
+ else:
+ x_product = [d for d in definition.get("tags", []) if d not in ["projects", "environments"]]
+ module_product = _endpoint_product_mapping.get((path, method.upper()))
+ if module_product and module_product not in x_product:
+ x_product.append(module_product)
- definition["x-explicit-tags"] = explicit_tags
+ definition["x-product"] = x_product
definition["tags"] = [d for d in definition["tags"] if d not in ["projects", "environments"]]
# If a ViewSet sets x-swagger-tag via @extend_schema(extensions={"x-swagger-tag": "..."}),
# use that as the sole display tag instead of appending the URL-derived one.
- # This controls Swagger UI grouping without affecting x-explicit-tags (used for codegen).
+ # This controls Swagger UI grouping without affecting x-product (used for codegen).
swagger_tag = definition.pop("x-swagger-tag", None)
if swagger_tag:
definition["tags"] = [swagger_tag]
diff --git a/posthog/api/element.py b/posthog/api/element.py
index 69000fb46e2f..678275cb1b53 100644
--- a/posthog/api/element.py
+++ b/posthog/api/element.py
@@ -59,7 +59,7 @@ class ElementStatsSerializer(serializers.Serializer):
elements = ElementSerializer(many=True)
-@extend_schema(tags=[ProductKey.PRODUCT_ANALYTICS])
+@extend_schema(extensions={"x-product": ProductKey.PRODUCT_ANALYTICS})
class ElementViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "element"
scope_object_read_actions = ["list", "retrieve", "stats", "values"]
diff --git a/posthog/api/event_definition.py b/posthog/api/event_definition.py
index 3ac31e16ed37..3a31dfe830e2 100644
--- a/posthog/api/event_definition.py
+++ b/posthog/api/event_definition.py
@@ -218,7 +218,6 @@ class EventDefinitionSerializer(TaggedItemSerializerMixin, serializers.ModelSeri
return hasattr(obj, "action_id") and obj.action_id is not None
-@extend_schema(tags=["core"])
class EventDefinitionViewSet(
TeamAndOrgViewSetMixin,
TaggedItemViewSetMixin,
diff --git a/posthog/api/exports.py b/posthog/api/exports.py
index 88e8704269f2..9b5c6f66dfd8 100644
--- a/posthog/api/exports.py
+++ b/posthog/api/exports.py
@@ -377,7 +377,7 @@ class ExportedAssetSerializer(serializers.ModelSerializer):
)
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class ExportedAssetViewSet(
TeamAndOrgViewSetMixin,
mixins.ListModelMixin,
diff --git a/posthog/api/file_system/file_system.py b/posthog/api/file_system/file_system.py
index 559e6cf3f735..e69ba59e58f2 100644
--- a/posthog/api/file_system/file_system.py
+++ b/posthog/api/file_system/file_system.py
@@ -149,7 +149,7 @@ def tokenize_search(search: str) -> list[str]:
return search.split()
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class FileSystemViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "file_system"
queryset = FileSystem.objects.select_related("created_by")
diff --git a/posthog/api/integration.py b/posthog/api/integration.py
index 11e57663af7a..edc08720e9ae 100644
--- a/posthog/api/integration.py
+++ b/posthog/api/integration.py
@@ -564,7 +564,7 @@ class IntegrationSerializer(serializers.ModelSerializer, UserAccessControlSerial
raise ValidationError("Kind not supported")
-@extend_schema(tags=["integrations"])
+@extend_schema(extensions={"x-product": "integrations"})
class IntegrationViewSet(
TeamAndOrgViewSetMixin,
mixins.CreateModelMixin,
diff --git a/posthog/api/llm_prompt.py b/posthog/api/llm_prompt.py
index 001b340f743e..0e877e509fe0 100644
--- a/posthog/api/llm_prompt.py
+++ b/posthog/api/llm_prompt.py
@@ -105,7 +105,7 @@ class LLMPromptFeatureFlagPermission(BasePermission):
)
-@extend_schema(tags=["llm_analytics"])
+@extend_schema(extensions={"x-product": "llm_analytics"})
class LLMPromptViewSet(
TeamAndOrgViewSetMixin,
AccessControlViewSetMixin,
diff --git a/posthog/api/oauth/application.py b/posthog/api/oauth/application.py
index 5eab0dedce43..89b0ba398d75 100644
--- a/posthog/api/oauth/application.py
+++ b/posthog/api/oauth/application.py
@@ -27,7 +27,7 @@ class OrganizationOAuthApplicationSerializer(serializers.ModelSerializer):
return instance.redirect_uris.split() if instance.redirect_uris else []
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class OrganizationOAuthApplicationViewSet(
TeamAndOrgViewSetMixin,
mixins.ListModelMixin,
diff --git a/posthog/api/organization.py b/posthog/api/organization.py
index 5acfdc4566cf..6da940670113 100644
--- a/posthog/api/organization.py
+++ b/posthog/api/organization.py
@@ -441,7 +441,7 @@ class OrganizationSerializer(
return super().to_representation(instance)
-@extend_schema(tags=["platform_features"])
+@extend_schema(extensions={"x-product": "platform_features"})
class OrganizationViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "organization"
serializer_class = OrganizationSerializer
diff --git a/posthog/api/organization_domain.py b/posthog/api/organization_domain.py
index 251c6a8c488a..1ca920a6bf40 100644
--- a/posthog/api/organization_domain.py
+++ b/posthog/api/organization_domain.py
@@ -229,7 +229,7 @@ class SCIMRequestLogFilter(django_filters.FilterSet):
return _search_scim_logs(queryset, name, value)
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class OrganizationDomainViewset(TeamAndOrgViewSetMixin, ModelViewSet):
scope_object = "organization"
serializer_class = OrganizationDomainSerializer
diff --git a/posthog/api/organization_invite.py b/posthog/api/organization_invite.py
index e0003f5c6302..b343f01222c3 100644
--- a/posthog/api/organization_invite.py
+++ b/posthog/api/organization_invite.py
@@ -358,7 +358,7 @@ class OrganizationInviteDelegateSerializer(serializers.Serializer):
return validate_message_body(value)
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class OrganizationInviteViewSet(
TeamAndOrgViewSetMixin,
mixins.DestroyModelMixin,
diff --git a/posthog/api/organization_member.py b/posthog/api/organization_member.py
index 263bfda04ab9..588356cd5974 100644
--- a/posthog/api/organization_member.py
+++ b/posthog/api/organization_member.py
@@ -112,7 +112,7 @@ class OrganizationMemberSerializer(serializers.ModelSerializer):
return updated_membership
-@extend_schema(tags=["core", "platform_features"])
+@extend_schema(extensions={"x-product": "platform_features"})
@extend_schema_view(
list=extend_schema(
parameters=[
diff --git a/posthog/api/person.py b/posthog/api/person.py
index 6ca4ee71e45e..83b78c092191 100644
--- a/posthog/api/person.py
+++ b/posthog/api/person.py
@@ -393,7 +393,7 @@ _PERSON_ID_PARAMETER = OpenApiParameter(
_id_schema = extend_schema(parameters=[_PERSON_ID_PARAMETER])
-@extend_schema(tags=[ProductKey.PERSONS])
+@extend_schema(extensions={"x-product": ProductKey.PERSONS})
@extend_schema_view(
retrieve=_id_schema,
update=_id_schema,
diff --git a/posthog/api/personal_api_key.py b/posthog/api/personal_api_key.py
index eebe80c22c14..69a537d227fa 100644
--- a/posthog/api/personal_api_key.py
+++ b/posthog/api/personal_api_key.py
@@ -232,7 +232,7 @@ class PersonalApiKeySelfAccessPermission(BasePermission):
return request.successful_authenticator.personal_api_key == item
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class PersonalAPIKeyViewSet(viewsets.ModelViewSet):
lookup_field = "id"
serializer_class = PersonalAPIKeySerializer
diff --git a/posthog/api/project.py b/posthog/api/project.py
index d781f312a2d4..409de920846a 100644
--- a/posthog/api/project.py
+++ b/posthog/api/project.py
@@ -660,7 +660,7 @@ class ProjectBackwardCompatSerializer(
return instance
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
@extend_schema_view(
retrieve=extend_schema(
description=("Retrieve a project and its settings."),
diff --git a/posthog/api/project_secret_api_key.py b/posthog/api/project_secret_api_key.py
index b010217828ff..1efadf991824 100644
--- a/posthog/api/project_secret_api_key.py
+++ b/posthog/api/project_secret_api_key.py
@@ -136,7 +136,7 @@ class ProjectSecretAPIKeySerializer(serializers.ModelSerializer):
return project_secret_api_key
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class ProjectSecretAPIKeyViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "project"
lookup_field = "id"
diff --git a/posthog/api/role_external_reference.py b/posthog/api/role_external_reference.py
index 17960799c25d..fef5956fe05c 100644
--- a/posthog/api/role_external_reference.py
+++ b/posthog/api/role_external_reference.py
@@ -113,7 +113,7 @@ class RoleLookupResponseSerializer(serializers.Serializer):
)
-@extend_schema(tags=["integrations"])
+@extend_schema(extensions={"x-product": "integrations"})
class RoleExternalReferenceViewSet(
TeamAndOrgViewSetMixin,
mixins.ListModelMixin,
diff --git a/posthog/api/sharing.py b/posthog/api/sharing.py
index 173cf495e05d..0ea694b90d9a 100644
--- a/posthog/api/sharing.py
+++ b/posthog/api/sharing.py
@@ -289,7 +289,7 @@ class SharingConfigurationSerializer(serializers.ModelSerializer):
return SharePasswordSerializer(obj.share_passwords.filter(is_active=True), many=True).data
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class SharingConfigurationViewSet(TeamAndOrgViewSetMixin, mixins.ListModelMixin, viewsets.GenericViewSet):
scope_object = "sharing_configuration"
scope_object_write_actions = [
diff --git a/posthog/api/user.py b/posthog/api/user.py
index 1da2e03436e2..dbd7069af7f4 100644
--- a/posthog/api/user.py
+++ b/posthog/api/user.py
@@ -767,7 +767,7 @@ class ScenePersonalisationSerializer(serializers.ModelSerializer):
)
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
@extend_schema_view(
retrieve=extend_schema(
description=(
diff --git a/posthog/api/user_home_settings.py b/posthog/api/user_home_settings.py
index 0ba722ad8906..03aaafccdf16 100644
--- a/posthog/api/user_home_settings.py
+++ b/posthog/api/user_home_settings.py
@@ -93,7 +93,7 @@ class PinnedSceneTabsSerializer(serializers.Serializer):
)
-@extend_schema(tags=["platform_features"])
+@extend_schema(extensions={"x-product": "platform_features"})
@extend_schema_view(
retrieve=extend_schema(
description=(
diff --git a/posthog/api/user_integration.py b/posthog/api/user_integration.py
index 0b3711f19a1f..77310d970f5b 100644
--- a/posthog/api/user_integration.py
+++ b/posthog/api/user_integration.py
@@ -111,7 +111,7 @@ class UserGitHubLinkStartResponseSerializer(serializers.Serializer):
)
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class UserIntegrationViewSet(viewsets.GenericViewSet):
"""`/api/users/@me/integrations/` — manage the user's personal GitHub integrations."""
diff --git a/posthog/api/user_push_token.py b/posthog/api/user_push_token.py
index 74fbae14bc23..ee6f9cd0fedd 100644
--- a/posthog/api/user_push_token.py
+++ b/posthog/api/user_push_token.py
@@ -67,7 +67,7 @@ class UserPushTokenUnregisterRequestSerializer(serializers.Serializer):
)
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class UserPushTokenViewSet(viewsets.GenericViewSet):
"""`/api/users/@me/push_tokens/` — manage the authenticated user's push notification tokens."""
diff --git a/posthog/api/welcome.py b/posthog/api/welcome.py
index 003e1f883bef..94b21a9c76b7 100644
--- a/posthog/api/welcome.py
+++ b/posthog/api/welcome.py
@@ -114,7 +114,7 @@ class WelcomeResponseSerializer(serializers.Serializer):
# ------------- Viewset --------------------------------------------------------------------------------
-@extend_schema(tags=["platform_features"])
+@extend_schema(extensions={"x-product": "platform_features"})
class WelcomeViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
"""Aggregated payload for the invited-user welcome screen."""
diff --git a/posthog/taxonomy/property_definition_api.py b/posthog/taxonomy/property_definition_api.py
index 4b66589c5bfc..bacd966f4f8b 100644
--- a/posthog/taxonomy/property_definition_api.py
+++ b/posthog/taxonomy/property_definition_api.py
@@ -551,7 +551,7 @@ class NotCountingLimitOffsetPaginator(LimitOffsetPagination):
return list(queryset)
-@extend_schema(tags=["core"])
+@extend_schema(extensions={"x-product": "core"})
class PropertyDefinitionViewSet(
TeamAndOrgViewSetMixin,
TaggedItemViewSetMixin,
diff --git a/products/actions/backend/api/action.py b/products/actions/backend/api/action.py
index 7884f1dec0ee..e93a7242e5ce 100644
--- a/products/actions/backend/api/action.py
+++ b/products/actions/backend/api/action.py
@@ -14,8 +14,6 @@ from rest_framework.response import Response
from rest_framework.settings import api_settings
from rest_framework_csv import renderers as csvrenderers
-from posthog.schema import ProductKey
-
from posthog.api.documentation import (
ArrayPropertyFilterSerializer,
DatePropertyFilterSerializer,
@@ -531,7 +529,6 @@ def count_action_references_bulk(action_ids: list[int], team: Team) -> dict[int,
return dict(counts)
-@extend_schema(tags=[ProductKey.ACTIONS])
class ActionViewSet(
TeamAndOrgViewSetMixin,
AccessControlViewSetMixin,
diff --git a/products/ai_observability/backend/api/datasets.py b/products/ai_observability/backend/api/datasets.py
index 93b6ee7f0716..d3490c62ccbd 100644
--- a/products/ai_observability/backend/api/datasets.py
+++ b/products/ai_observability/backend/api/datasets.py
@@ -8,8 +8,6 @@ from drf_spectacular.utils import OpenApiExample, OpenApiParameter
from rest_framework import serializers
from rest_framework.viewsets import ModelViewSet
-from posthog.schema import ProductKey
-
from posthog.api.documentation import extend_schema
from posthog.api.forbid_destroy_model import ForbidDestroyModel
from posthog.api.monitoring import monitor
@@ -134,7 +132,6 @@ class DatasetFilter(django_filters.FilterSet):
return super().list(request, *args, **kwargs)
-@extend_schema(tags=[ProductKey.LLM_ANALYTICS])
class DatasetViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, ForbidDestroyModel, ModelViewSet):
scope_object = "dataset"
permission_classes = [AccessControlPermission]
@@ -266,7 +263,6 @@ class DatasetItemSerializer(serializers.ModelSerializer):
return super().create(validated_data, *args, **kwargs)
-@extend_schema(tags=[ProductKey.LLM_ANALYTICS])
class DatasetItemViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, ModelViewSet):
scope_object = "dataset"
permission_classes = [AccessControlPermission]
diff --git a/products/ai_observability/backend/api/evaluation_reports.py b/products/ai_observability/backend/api/evaluation_reports.py
index b46e359a20a6..e3d8220924a6 100644
--- a/products/ai_observability/backend/api/evaluation_reports.py
+++ b/products/ai_observability/backend/api/evaluation_reports.py
@@ -274,7 +274,6 @@ class EvaluationReportRunSerializer(serializers.ModelSerializer):
}
-@extend_schema(tags=["llm_analytics"])
class EvaluationReportViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
"""CRUD for evaluation report configurations + report run history."""
diff --git a/products/ai_observability/backend/api/evaluation_runs.py b/products/ai_observability/backend/api/evaluation_runs.py
index 0dc0884db989..5ae0083797ea 100644
--- a/products/ai_observability/backend/api/evaluation_runs.py
+++ b/products/ai_observability/backend/api/evaluation_runs.py
@@ -44,7 +44,6 @@ class EvaluationRunRequestSerializer(serializers.Serializer):
)
-@extend_schema(tags=["llm_analytics"])
class EvaluationRunViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
scope_object = "evaluation"
permission_classes = [IsAuthenticated, AccessControlPermission]
diff --git a/products/ai_observability/backend/api/evaluations.py b/products/ai_observability/backend/api/evaluations.py
index 2cbec3921ba2..376bfa83d014 100644
--- a/products/ai_observability/backend/api/evaluations.py
+++ b/products/ai_observability/backend/api/evaluations.py
@@ -399,7 +399,6 @@ class TestHogResponseSerializer(serializers.Serializer):
)
-@extend_schema(tags=["llm_analytics"])
class EvaluationViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
scope_object = "evaluation"
permission_classes = [IsAuthenticated, AccessControlPermission]
diff --git a/products/ai_observability/backend/api/review_queues.py b/products/ai_observability/backend/api/review_queues.py
index 976b0be5debd..0fd19affdb14 100644
--- a/products/ai_observability/backend/api/review_queues.py
+++ b/products/ai_observability/backend/api/review_queues.py
@@ -14,8 +14,6 @@ from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
-from posthog.schema import ProductKey
-
from posthog.api.documentation import extend_schema
from posthog.api.monitoring import monitor
from posthog.api.routing import TeamAndOrgViewSetMixin
@@ -301,7 +299,6 @@ class ReviewQueueItemFilter(django_filters.FilterSet):
return queryset
-@extend_schema(tags=[ProductKey.LLM_ANALYTICS])
class ReviewQueueViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, ModelViewSet):
scope_object = "llm_analytics"
permission_classes = [TraceReviewFeatureFlagPermission, AccessControlPermission]
@@ -424,7 +421,6 @@ class ReviewQueueViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, Mode
return Response(status=status.HTTP_204_NO_CONTENT)
-@extend_schema(tags=[ProductKey.LLM_ANALYTICS])
class ReviewQueueItemViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, ModelViewSet):
scope_object = "llm_analytics"
permission_classes = [TraceReviewFeatureFlagPermission, AccessControlPermission]
diff --git a/products/ai_observability/backend/api/score_definitions.py b/products/ai_observability/backend/api/score_definitions.py
index 5fd3e0b06515..7c4c963cbf78 100644
--- a/products/ai_observability/backend/api/score_definitions.py
+++ b/products/ai_observability/backend/api/score_definitions.py
@@ -16,8 +16,6 @@ from rest_framework.permissions import BasePermission
from rest_framework.request import Request
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.documentation import extend_schema
from posthog.api.mixins import ValidatedRequest, validated_request
from posthog.api.routing import TeamAndOrgViewSetMixin
@@ -193,7 +191,6 @@ class ScoreDefinitionFilter(django_filters.FilterSet):
return queryset
-@extend_schema(tags=[ProductKey.LLM_ANALYTICS])
class ScoreDefinitionViewSet(
TeamAndOrgViewSetMixin,
AccessControlViewSetMixin,
diff --git a/products/ai_observability/backend/api/skills.py b/products/ai_observability/backend/api/skills.py
index cb3b93456089..96feb8b4b056 100644
--- a/products/ai_observability/backend/api/skills.py
+++ b/products/ai_observability/backend/api/skills.py
@@ -147,7 +147,6 @@ ALLOWED_LIST_ORDERINGS = frozenset(
)
-@extend_schema(tags=["llm_analytics"])
class LLMSkillViewSet(
TeamAndOrgViewSetMixin,
AccessControlViewSetMixin,
diff --git a/products/ai_observability/backend/api/trace_reviews.py b/products/ai_observability/backend/api/trace_reviews.py
index 2afed4c471f4..0728f9deaa53 100644
--- a/products/ai_observability/backend/api/trace_reviews.py
+++ b/products/ai_observability/backend/api/trace_reviews.py
@@ -19,8 +19,6 @@ from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
-from posthog.schema import ProductKey
-
from posthog.api.documentation import extend_schema
from posthog.api.monitoring import monitor
from posthog.api.routing import TeamAndOrgViewSetMixin
@@ -589,7 +587,6 @@ class TraceReviewFilter(django_filters.FilterSet):
return queryset
-@extend_schema(tags=[ProductKey.LLM_ANALYTICS])
class TraceReviewViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, ModelViewSet):
scope_object = "llm_analytics"
permission_classes = [TraceReviewFeatureFlagPermission, AccessControlPermission]
diff --git a/products/ai_observability/frontend/generated/api.schemas.ts b/products/ai_observability/frontend/generated/api.schemas.ts
index d812669aed0e..846268b9e789 100644
--- a/products/ai_observability/frontend/generated/api.schemas.ts
+++ b/products/ai_observability/frontend/generated/api.schemas.ts
@@ -2417,6 +2417,34 @@ export interface TaggerCreateApi {
model_configuration?: TaggerModelConfigurationWriteApi | null
}
+export interface TaggerUpdateApi {
+ /** @maxLength 400 */
+ name: string
+ description?: string
+ enabled?: boolean
+ tagger_type?: TaggerTypeEnumApi
+ /** Tagger configuration. For tagger_type 'llm': {prompt, tags, min_tags?, max_tags?}. For tagger_type 'hog': {source, tags?}. */
+ tagger_config: TaggerConfigApi
+ /** Conditions that scope when the tagger runs */
+ conditions?: TaggerConditionApi[]
+ model_configuration?: TaggerModelConfigurationWriteApi | null
+ deleted?: boolean
+}
+
+export interface PatchedTaggerUpdateApi {
+ /** @maxLength 400 */
+ name?: string
+ description?: string
+ enabled?: boolean
+ tagger_type?: TaggerTypeEnumApi
+ /** Tagger configuration. For tagger_type 'llm': {prompt, tags, min_tags?, max_tags?}. For tagger_type 'hog': {source, tags?}. */
+ tagger_config?: TaggerConfigApi
+ /** Conditions that scope when the tagger runs */
+ conditions?: TaggerConditionApi[]
+ model_configuration?: TaggerModelConfigurationWriteApi | null
+ deleted?: boolean
+}
+
export interface TestHogTaggerTagApi {
/**
* Tag identifier to allow in Hog test results.
diff --git a/products/ai_observability/frontend/generated/api.ts b/products/ai_observability/frontend/generated/api.ts
index dd81ade15cdc..7ba11f61140a 100644
--- a/products/ai_observability/frontend/generated/api.ts
+++ b/products/ai_observability/frontend/generated/api.ts
@@ -88,6 +88,7 @@ import type {
PatchedReviewQueueItemUpdateApi,
PatchedReviewQueueUpdateApi,
PatchedScoreDefinitionMetadataApi,
+ PatchedTaggerUpdateApi,
PatchedTraceReviewUpdateApi,
PersonalSpendAnalysisResponseApi,
ReviewQueueApi,
@@ -105,6 +106,7 @@ import type {
SummarizeResponseApi,
TaggerApi,
TaggerCreateApi,
+ TaggerUpdateApi,
TaggersListParams,
TestHogRequestApi,
TestHogResponseApi,
@@ -2256,6 +2258,67 @@ export const taggersCreate = async (
})
}
+export const getTaggersRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/taggers/${id}/`
+}
+
+export const taggersRetrieve = async (projectId: string, id: string, options?: RequestInit): Promise<TaggerApi> => {
+ return apiMutator<TaggerApi>(getTaggersRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getTaggersUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/taggers/${id}/`
+}
+
+export const taggersUpdate = async (
+ projectId: string,
+ id: string,
+ taggerUpdateApi: TaggerUpdateApi,
+ options?: RequestInit
+): Promise<TaggerApi> => {
+ return apiMutator<TaggerApi>(getTaggersUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(taggerUpdateApi),
+ })
+}
+
+export const getTaggersPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/taggers/${id}/`
+}
+
+export const taggersPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedTaggerUpdateApi?: PatchedTaggerUpdateApi,
+ options?: RequestInit
+): Promise<TaggerApi> => {
+ return apiMutator<TaggerApi>(getTaggersPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedTaggerUpdateApi),
+ })
+}
+
+export const getTaggersDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/taggers/${id}/`
+}
+
+/**
+ * Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
+ */
+export const taggersDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<unknown> => {
+ return apiMutator<unknown>(getTaggersDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getTaggersTestHogCreateUrl = (projectId: string) => {
return `/api/projects/${projectId}/taggers/test_hog/`
}
diff --git a/products/ai_observability/frontend/generated/api.zod.ts b/products/ai_observability/frontend/generated/api.zod.ts
index 26b71e365c2e..73a97ae38d87 100644
--- a/products/ai_observability/frontend/generated/api.zod.ts
+++ b/products/ai_observability/frontend/generated/api.zod.ts
@@ -1914,6 +1914,267 @@ export const TaggersCreateBody = /* @__PURE__ */ zod.object({
.optional(),
})
+export const taggersUpdateBodyNameMax = 400
+
+export const taggersUpdateBodyTaggerTypeDefault = `llm`
+export const taggersUpdateBodyTaggerConfigOneOneTagsItemNameMax = 100
+
+export const taggersUpdateBodyTaggerConfigOneOneTagsItemDescriptionDefault = ``
+export const taggersUpdateBodyTaggerConfigOneOneTagsItemDescriptionMax = 500
+
+export const taggersUpdateBodyTaggerConfigOneOneMinTagsDefault = 0
+export const taggersUpdateBodyTaggerConfigOneOneMinTagsMin = 0
+
+export const taggersUpdateBodyTaggerConfigOneTwoTagsItemNameMax = 100
+
+export const taggersUpdateBodyTaggerConfigOneTwoTagsItemDescriptionDefault = ``
+export const taggersUpdateBodyTaggerConfigOneTwoTagsItemDescriptionMax = 500
+
+export const taggersUpdateBodyConditionsItemIdMax = 100
+
+export const taggersUpdateBodyConditionsItemRolloutPercentageDefault = 100
+export const taggersUpdateBodyConditionsItemRolloutPercentageMin = 0
+export const taggersUpdateBodyConditionsItemRolloutPercentageMax = 100
+
+export const taggersUpdateBodyModelConfigurationOneModelMax = 100
+
+export const TaggersUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(taggersUpdateBodyNameMax),
+ description: zod.string().optional(),
+ enabled: zod.boolean().optional(),
+ tagger_type: zod
+ .enum(['llm', 'hog'])
+ .describe('\* `llm` - LLM\n\* `hog` - Hog')
+ .default(taggersUpdateBodyTaggerTypeDefault),
+ tagger_config: zod
+ .union([
+ zod.object({
+ prompt: zod.string().min(1).describe('Prompt instructing the LLM how to tag generations'),
+ tags: zod
+ .array(
+ zod.object({
+ name: zod
+ .string()
+ .max(taggersUpdateBodyTaggerConfigOneOneTagsItemNameMax)
+ .describe('Tag identifier'),
+ description: zod
+ .string()
+ .max(taggersUpdateBodyTaggerConfigOneOneTagsItemDescriptionMax)
+ .default(taggersUpdateBodyTaggerConfigOneOneTagsItemDescriptionDefault)
+ .describe('Description to help the LLM classify'),
+ })
+ )
+ .describe('Available tags the LLM can assign'),
+ min_tags: zod
+ .number()
+ .min(taggersUpdateBodyTaggerConfigOneOneMinTagsMin)
+ .default(taggersUpdateBodyTaggerConfigOneOneMinTagsDefault)
+ .describe('Minimum number of tags to apply'),
+ max_tags: zod.number().min(1).nullish().describe('Maximum number of tags to apply (null = no limit)'),
+ }),
+ zod.object({
+ source: zod.string().min(1).describe('Hog source code to classify a generation into tags.'),
+ tags: zod
+ .array(
+ zod.object({
+ name: zod
+ .string()
+ .max(taggersUpdateBodyTaggerConfigOneTwoTagsItemNameMax)
+ .describe('Tag identifier'),
+ description: zod
+ .string()
+ .max(taggersUpdateBodyTaggerConfigOneTwoTagsItemDescriptionMax)
+ .default(taggersUpdateBodyTaggerConfigOneTwoTagsItemDescriptionDefault)
+ .describe('Description to help the LLM classify'),
+ })
+ )
+ .optional()
+ .describe('Optional tag whitelist. Leave empty to allow any tag returned by the Hog code.'),
+ }),
+ ])
+ .describe(
+ "Tagger configuration. For tagger_type 'llm': {prompt, tags, min_tags?, max_tags?}. For tagger_type 'hog': {source, tags?}."
+ ),
+ conditions: zod
+ .array(
+ zod.object({
+ id: zod
+ .string()
+ .max(taggersUpdateBodyConditionsItemIdMax)
+ .describe('Stable identifier for this condition'),
+ rollout_percentage: zod
+ .number()
+ .min(taggersUpdateBodyConditionsItemRolloutPercentageMin)
+ .max(taggersUpdateBodyConditionsItemRolloutPercentageMax)
+ .default(taggersUpdateBodyConditionsItemRolloutPercentageDefault)
+ .describe('Percentage of matching events to apply this condition to'),
+ properties: zod
+ .array(zod.record(zod.string(), zod.unknown()))
+ .optional()
+ .describe('Property filters that scope when this condition fires'),
+ })
+ )
+ .optional()
+ .describe('Conditions that scope when the tagger runs'),
+ model_configuration: zod
+ .union([
+ zod.object({
+ provider: zod
+ .enum(['openai', 'anthropic', 'gemini', 'openrouter', 'fireworks', 'azure_openai', 'together_ai'])
+ .describe(
+ '\* `openai` - Openai\n\* `anthropic` - Anthropic\n\* `gemini` - Gemini\n\* `openrouter` - Openrouter\n\* `fireworks` - Fireworks\n\* `azure_openai` - Azure OpenAI\n\* `together_ai` - Together AI'
+ )
+ .describe(
+ 'LLM provider to use for this tagger.\n\n\* `openai` - Openai\n\* `anthropic` - Anthropic\n\* `gemini` - Gemini\n\* `openrouter` - Openrouter\n\* `fireworks` - Fireworks\n\* `azure_openai` - Azure OpenAI\n\* `together_ai` - Together AI'
+ ),
+ model: zod
+ .string()
+ .max(taggersUpdateBodyModelConfigurationOneModelMax)
+ .describe('Provider model identifier to use for this tagger.'),
+ provider_key_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'Existing LLM provider key UUID for the current project. Do not invent this value; use a real provider key ID returned by PostHog, or omit\/null when no provider key should be pinned.'
+ ),
+ }),
+ zod.null(),
+ ])
+ .optional(),
+ deleted: zod.boolean().optional(),
+})
+
+export const taggersPartialUpdateBodyNameMax = 400
+
+export const taggersPartialUpdateBodyTaggerTypeDefault = `llm`
+export const taggersPartialUpdateBodyTaggerConfigOneOneTagsItemNameMax = 100
+
+export const taggersPartialUpdateBodyTaggerConfigOneOneTagsItemDescriptionDefault = ``
+export const taggersPartialUpdateBodyTaggerConfigOneOneTagsItemDescriptionMax = 500
+
+export const taggersPartialUpdateBodyTaggerConfigOneOneMinTagsDefault = 0
+export const taggersPartialUpdateBodyTaggerConfigOneOneMinTagsMin = 0
+
+export const taggersPartialUpdateBodyTaggerConfigOneTwoTagsItemNameMax = 100
+
+export const taggersPartialUpdateBodyTaggerConfigOneTwoTagsItemDescriptionDefault = ``
+export const taggersPartialUpdateBodyTaggerConfigOneTwoTagsItemDescriptionMax = 500
+
+export const taggersPartialUpdateBodyConditionsItemIdMax = 100
+
+export const taggersPartialUpdateBodyConditionsItemRolloutPercentageDefault = 100
+export const taggersPartialUpdateBodyConditionsItemRolloutPercentageMin = 0
+export const taggersPartialUpdateBodyConditionsItemRolloutPercentageMax = 100
+
+export const taggersPartialUpdateBodyModelConfigurationOneModelMax = 100
+
+export const TaggersPartialUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(taggersPartialUpdateBodyNameMax).optional(),
+ description: zod.string().optional(),
+ enabled: zod.boolean().optional(),
+ tagger_type: zod
+ .enum(['llm', 'hog'])
+ .describe('\* `llm` - LLM\n\* `hog` - Hog')
+ .default(taggersPartialUpdateBodyTaggerTypeDefault),
+ tagger_config: zod
+ .union([
+ zod.object({
+ prompt: zod.string().min(1).describe('Prompt instructing the LLM how to tag generations'),
+ tags: zod
+ .array(
+ zod.object({
+ name: zod
+ .string()
+ .max(taggersPartialUpdateBodyTaggerConfigOneOneTagsItemNameMax)
+ .describe('Tag identifier'),
+ description: zod
+ .string()
+ .max(taggersPartialUpdateBodyTaggerConfigOneOneTagsItemDescriptionMax)
+ .default(taggersPartialUpdateBodyTaggerConfigOneOneTagsItemDescriptionDefault)
+ .describe('Description to help the LLM classify'),
+ })
+ )
+ .describe('Available tags the LLM can assign'),
+ min_tags: zod
+ .number()
+ .min(taggersPartialUpdateBodyTaggerConfigOneOneMinTagsMin)
+ .default(taggersPartialUpdateBodyTaggerConfigOneOneMinTagsDefault)
+ .describe('Minimum number of tags to apply'),
+ max_tags: zod.number().min(1).nullish().describe('Maximum number of tags to apply (null = no limit)'),
+ }),
+ zod.object({
+ source: zod.string().min(1).describe('Hog source code to classify a generation into tags.'),
+ tags: zod
+ .array(
+ zod.object({
+ name: zod
+ .string()
+ .max(taggersPartialUpdateBodyTaggerConfigOneTwoTagsItemNameMax)
+ .describe('Tag identifier'),
+ description: zod
+ .string()
+ .max(taggersPartialUpdateBodyTaggerConfigOneTwoTagsItemDescriptionMax)
+ .default(taggersPartialUpdateBodyTaggerConfigOneTwoTagsItemDescriptionDefault)
+ .describe('Description to help the LLM classify'),
+ })
+ )
+ .optional()
+ .describe('Optional tag whitelist. Leave empty to allow any tag returned by the Hog code.'),
+ }),
+ ])
+ .optional()
+ .describe(
+ "Tagger configuration. For tagger_type 'llm': {prompt, tags, min_tags?, max_tags?}. For tagger_type 'hog': {source, tags?}."
+ ),
+ conditions: zod
+ .array(
+ zod.object({
+ id: zod
+ .string()
+ .max(taggersPartialUpdateBodyConditionsItemIdMax)
+ .describe('Stable identifier for this condition'),
+ rollout_percentage: zod
+ .number()
+ .min(taggersPartialUpdateBodyConditionsItemRolloutPercentageMin)
+ .max(taggersPartialUpdateBodyConditionsItemRolloutPercentageMax)
+ .default(taggersPartialUpdateBodyConditionsItemRolloutPercentageDefault)
+ .describe('Percentage of matching events to apply this condition to'),
+ properties: zod
+ .array(zod.record(zod.string(), zod.unknown()))
+ .optional()
+ .describe('Property filters that scope when this condition fires'),
+ })
+ )
+ .optional()
+ .describe('Conditions that scope when the tagger runs'),
+ model_configuration: zod
+ .union([
+ zod.object({
+ provider: zod
+ .enum(['openai', 'anthropic', 'gemini', 'openrouter', 'fireworks', 'azure_openai', 'together_ai'])
+ .describe(
+ '\* `openai` - Openai\n\* `anthropic` - Anthropic\n\* `gemini` - Gemini\n\* `openrouter` - Openrouter\n\* `fireworks` - Fireworks\n\* `azure_openai` - Azure OpenAI\n\* `together_ai` - Together AI'
+ )
+ .describe(
+ 'LLM provider to use for this tagger.\n\n\* `openai` - Openai\n\* `anthropic` - Anthropic\n\* `gemini` - Gemini\n\* `openrouter` - Openrouter\n\* `fireworks` - Fireworks\n\* `azure_openai` - Azure OpenAI\n\* `together_ai` - Together AI'
+ ),
+ model: zod
+ .string()
+ .max(taggersPartialUpdateBodyModelConfigurationOneModelMax)
+ .describe('Provider model identifier to use for this tagger.'),
+ provider_key_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'Existing LLM provider key UUID for the current project. Do not invent this value; use a real provider key ID returned by PostHog, or omit\/null when no provider key should be pinned.'
+ ),
+ }),
+ zod.null(),
+ ])
+ .optional(),
+ deleted: zod.boolean().optional(),
+})
+
/**
* Test Hog tagger code against sample events without saving.
*/
diff --git a/products/ai_observability/frontend/skills/LLMSkillScene.stories.tsx b/products/ai_observability/frontend/skills/LLMSkillScene.stories.tsx
index aa1e12d78a28..c02ca8cb50a7 100644
--- a/products/ai_observability/frontend/skills/LLMSkillScene.stories.tsx
+++ b/products/ai_observability/frontend/skills/LLMSkillScene.stories.tsx
@@ -128,8 +128,8 @@ const meta: Meta = {
decorators: [
mswDecorator({
get: {
- '/api/environments/:team_id/llm_skills/': toPaginatedResponse([SKILL_LIST_ENTRY]),
- '/api/environments/:team_id/llm_skills/resolve/name/:name/': RESOLVE_RESPONSE,
+ '/api/projects/:team_id/llm_skills/': toPaginatedResponse([SKILL_LIST_ENTRY]),
+ '/api/projects/:team_id/llm_skills/resolve/name/:name/': RESOLVE_RESPONSE,
},
}),
],
diff --git a/products/ai_observability/mcp/tools.yaml b/products/ai_observability/mcp/tools.yaml
index 2e635a975159..5bcfb33f2cbf 100644
--- a/products/ai_observability/mcp/tools.yaml
+++ b/products/ai_observability/mcp/tools.yaml
@@ -1113,3 +1113,15 @@ tools:
llma-translate-create:
operation: llm_analytics_translate_create
enabled: false
+ taggers-destroy:
+ operation: taggers_destroy
+ enabled: false
+ taggers-partial-update:
+ operation: taggers_partial_update
+ enabled: false
+ taggers-retrieve:
+ operation: taggers_retrieve
+ enabled: false
+ taggers-update:
+ operation: taggers_update
+ enabled: false
diff --git a/products/alerts/frontend/generated/api.ts b/products/alerts/frontend/generated/api.ts
index afa6d57d0295..c18da865a557 100644
--- a/products/alerts/frontend/generated/api.ts
+++ b/products/alerts/frontend/generated/api.ts
@@ -18,6 +18,7 @@ import type {
PaginatedAlertListApi,
PaginatedThresholdWithAlertListApi,
PatchedAlertApi,
+ ThresholdWithAlertApi,
} from './api.schemas'
// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
@@ -207,3 +208,19 @@ export const insightsThresholdsList = async (
method: 'GET',
})
}
+
+export const getInsightsThresholdsRetrieveUrl = (projectId: string, insightId: number, id: string) => {
+ return `/api/projects/${projectId}/insights/${insightId}/thresholds/${id}/`
+}
+
+export const insightsThresholdsRetrieve = async (
+ projectId: string,
+ insightId: number,
+ id: string,
+ options?: RequestInit
+): Promise<ThresholdWithAlertApi> => {
+ return apiMutator<ThresholdWithAlertApi>(getInsightsThresholdsRetrieveUrl(projectId, insightId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
diff --git a/products/alerts/mcp/tools.yaml b/products/alerts/mcp/tools.yaml
index ba255be00e0e..034bcadc4c9f 100644
--- a/products/alerts/mcp/tools.yaml
+++ b/products/alerts/mcp/tools.yaml
@@ -134,6 +134,9 @@ tools:
insights-thresholds-list:
operation: insights_thresholds_list
enabled: false
+ insights-thresholds-retrieve:
+ operation: insights_thresholds_retrieve
+ enabled: false
logs-alerts-create:
operation: logs_alerts_create
enabled: false
diff --git a/products/business_knowledge/backend/api/views.py b/products/business_knowledge/backend/api/views.py
index 4ac990c539b7..e21470a799df 100644
--- a/products/business_knowledge/backend/api/views.py
+++ b/products/business_knowledge/backend/api/views.py
@@ -43,7 +43,6 @@ class _ConflictError(exceptions.APIException):
default_code = "conflict"
-@extend_schema(tags=["business_knowledge"])
class KnowledgeSourceViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
scope_object = "business_knowledge"
queryset = KnowledgeSource.objects.unscoped()
diff --git a/products/cdp/backend/api/hog_function.py b/products/cdp/backend/api/hog_function.py
index fc7b3f2996a1..349965869217 100644
--- a/products/cdp/backend/api/hog_function.py
+++ b/products/cdp/backend/api/hog_function.py
@@ -466,7 +466,7 @@ class HogFunctionFilterSet(FilterSet):
fields = ["type", "enabled", "id", "created_by", "created_at", "updated_at"]
-@extend_schema(tags=["hog_functions", "cdp"])
+@extend_schema(tags=["hog_functions"], extensions={"x-product": "cdp"})
class HogFunctionViewSet(
TeamAndOrgViewSetMixin,
LogEntryMixin,
diff --git a/products/cdp/backend/api/hog_function_template.py b/products/cdp/backend/api/hog_function_template.py
index 7a5ec9063329..0f170163f8f7 100644
--- a/products/cdp/backend/api/hog_function_template.py
+++ b/products/cdp/backend/api/hog_function_template.py
@@ -77,7 +77,7 @@ class HogFunctionTemplateSerializer(serializers.ModelSerializer):
# NOTE: There is nothing currently private about these values
-@extend_schema(tags=["hog_function_templates", "cdp"])
+@extend_schema(tags=["hog_function_templates"], extensions={"x-product": "cdp"})
class PublicHogFunctionTemplateViewSet(
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
diff --git a/products/cdp/backend/api/plugin.py b/products/cdp/backend/api/plugin.py
index 82720a36ccc2..e868b2f28c70 100644
--- a/products/cdp/backend/api/plugin.py
+++ b/products/cdp/backend/api/plugin.py
@@ -12,7 +12,6 @@ from django.utils.timezone import now
import requests
from dateutil.relativedelta import relativedelta
-from drf_spectacular.utils import extend_schema
from loginas.utils import is_impersonated_session
from posthoganalytics import capture_exception
from rest_framework import renderers, request, serializers, status, viewsets
@@ -341,7 +340,6 @@ class PluginSerializer(serializers.ModelSerializer):
return cast(Plugin, super().update(plugin, validated_data))
-@extend_schema(tags=["core"])
class PluginViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "plugin"
queryset = Plugin.objects.all()
@@ -786,7 +784,6 @@ class PluginConfigSerializer(serializers.ModelSerializer):
return response
-@extend_schema(tags=["core"])
class PluginConfigViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "plugin"
queryset = PluginConfig.objects.all()
diff --git a/products/conversations/backend/api/ticket_views.py b/products/conversations/backend/api/ticket_views.py
index d71143b20b14..e08ac9dfa82e 100644
--- a/products/conversations/backend/api/ticket_views.py
+++ b/products/conversations/backend/api/ticket_views.py
@@ -1,7 +1,6 @@
import json
from typing import Any
-from drf_spectacular.utils import extend_schema
from rest_framework import mixins, serializers, viewsets
from posthog.api.routing import TeamAndOrgViewSetMixin
@@ -49,7 +48,6 @@ class TicketViewSerializer(serializers.ModelSerializer):
return super().create(validated_data)
-@extend_schema(tags=["conversations"])
class TicketViewViewSet(
TeamAndOrgViewSetMixin,
mixins.CreateModelMixin,
diff --git a/products/customer_analytics/backend/api/views.py b/products/customer_analytics/backend/api/views.py
index 995535422357..1a112fd81c59 100644
--- a/products/customer_analytics/backend/api/views.py
+++ b/products/customer_analytics/backend/api/views.py
@@ -76,7 +76,6 @@ class CustomerJourneyViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin,
super().perform_destroy(instance)
-@extend_schema(tags=["customer_analytics"])
class AccountViewSet(TaggedItemViewSetMixin, TeamAndOrgViewSetMixin, AccessControlViewSetMixin, viewsets.ModelViewSet):
scope_object = "account"
queryset = Account.objects.unscoped().order_by("-created_at")
diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx
index ab82ab1b0b98..0e0378c08235 100644
--- a/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx
+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx
@@ -9,7 +9,7 @@ import { urls } from 'scenes/urls'
import { mswDecorator } from '~/mocks/browser'
const QUERY_ENDPOINT = '/api/environments/:team_id/query/:kind/'
-const ACCOUNT_NOTEBOOKS_ENDPOINT = 'api/environments/:team_id/accounts/:account_id/notebooks/'
+const ACCOUNT_NOTEBOOKS_ENDPOINT = 'api/projects/:team_id/accounts/:account_id/notebooks/'
const WAREHOUSE_VIEW_LINK_ENDPOINT = 'api/environments/:team_id/warehouse_view_link/'
type AccountNameCell = { name: string; external_id: string | null; id: string }
diff --git a/products/customer_analytics/frontend/generated/api.schemas.ts b/products/customer_analytics/frontend/generated/api.schemas.ts
index 1229abac559b..b6781a680e40 100644
--- a/products/customer_analytics/frontend/generated/api.schemas.ts
+++ b/products/customer_analytics/frontend/generated/api.schemas.ts
@@ -253,6 +253,20 @@ export interface PaginatedCustomerJourneyListApi {
results: CustomerJourneyApi[]
}
+export interface PatchedCustomerJourneyApi {
+ readonly id?: string
+ insight?: number
+ /** @maxLength 400 */
+ name?: string
+ /** @nullable */
+ description?: string | null
+ readonly created_at?: string
+ /** @nullable */
+ readonly created_by?: number | null
+ /** @nullable */
+ readonly updated_at?: string | null
+}
+
/**
* * `person` - Person
* `group_0` - Group 0
@@ -292,6 +306,16 @@ export interface PaginatedCustomerProfileConfigListApi {
results: CustomerProfileConfigApi[]
}
+export interface PatchedCustomerProfileConfigApi {
+ readonly id?: string
+ scope?: CustomerProfileConfigScopeEnumApi
+ content?: unknown
+ sidebar?: unknown
+ readonly created_at?: string
+ /** @nullable */
+ readonly updated_at?: string | null
+}
+
/**
* * `numeric` - numeric
* `currency` - currency
diff --git a/products/customer_analytics/frontend/generated/api.ts b/products/customer_analytics/frontend/generated/api.ts
index 08f7e02f9ab9..d396c3a91aae 100644
--- a/products/customer_analytics/frontend/generated/api.ts
+++ b/products/customer_analytics/frontend/generated/api.ts
@@ -25,6 +25,8 @@ import type {
PaginatedCustomerProfileConfigListApi,
PaginatedGroupUsageMetricListApi,
PatchedAccountApi,
+ PatchedCustomerJourneyApi,
+ PatchedCustomerProfileConfigApi,
PatchedGroupUsageMetricApi,
} from './api.schemas'
@@ -273,6 +275,68 @@ export const customerJourneysCreate = async (
})
}
+export const getCustomerJourneysRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/customer_journeys/${id}/`
+}
+
+export const customerJourneysRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<CustomerJourneyApi> => {
+ return apiMutator<CustomerJourneyApi>(getCustomerJourneysRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getCustomerJourneysUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/customer_journeys/${id}/`
+}
+
+export const customerJourneysUpdate = async (
+ projectId: string,
+ id: string,
+ customerJourneyApi: NonReadonly<CustomerJourneyApi>,
+ options?: RequestInit
+): Promise<CustomerJourneyApi> => {
+ return apiMutator<CustomerJourneyApi>(getCustomerJourneysUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(customerJourneyApi),
+ })
+}
+
+export const getCustomerJourneysPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/customer_journeys/${id}/`
+}
+
+export const customerJourneysPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedCustomerJourneyApi?: NonReadonly<PatchedCustomerJourneyApi>,
+ options?: RequestInit
+): Promise<CustomerJourneyApi> => {
+ return apiMutator<CustomerJourneyApi>(getCustomerJourneysPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedCustomerJourneyApi),
+ })
+}
+
+export const getCustomerJourneysDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/customer_journeys/${id}/`
+}
+
+export const customerJourneysDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getCustomerJourneysDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getCustomerProfileConfigsListUrl = (projectId: string, params?: CustomerProfileConfigsListParams) => {
const normalizedParams = new URLSearchParams()
@@ -317,6 +381,72 @@ export const customerProfileConfigsCreate = async (
})
}
+export const getCustomerProfileConfigsRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/customer_profile_configs/${id}/`
+}
+
+export const customerProfileConfigsRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<CustomerProfileConfigApi> => {
+ return apiMutator<CustomerProfileConfigApi>(getCustomerProfileConfigsRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getCustomerProfileConfigsUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/customer_profile_configs/${id}/`
+}
+
+export const customerProfileConfigsUpdate = async (
+ projectId: string,
+ id: string,
+ customerProfileConfigApi: NonReadonly<CustomerProfileConfigApi>,
+ options?: RequestInit
+): Promise<CustomerProfileConfigApi> => {
+ return apiMutator<CustomerProfileConfigApi>(getCustomerProfileConfigsUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(customerProfileConfigApi),
+ })
+}
+
+export const getCustomerProfileConfigsPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/customer_profile_configs/${id}/`
+}
+
+export const customerProfileConfigsPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedCustomerProfileConfigApi?: NonReadonly<PatchedCustomerProfileConfigApi>,
+ options?: RequestInit
+): Promise<CustomerProfileConfigApi> => {
+ return apiMutator<CustomerProfileConfigApi>(getCustomerProfileConfigsPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedCustomerProfileConfigApi),
+ })
+}
+
+export const getCustomerProfileConfigsDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/customer_profile_configs/${id}/`
+}
+
+export const customerProfileConfigsDestroy = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getCustomerProfileConfigsDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getGroupsTypesMetricsListUrl = (
projectId: string,
groupTypeIndex: number,
diff --git a/products/customer_analytics/frontend/generated/api.zod.ts b/products/customer_analytics/frontend/generated/api.zod.ts
index 7cd71d6ac61f..3865ec584588 100644
--- a/products/customer_analytics/frontend/generated/api.zod.ts
+++ b/products/customer_analytics/frontend/generated/api.zod.ts
@@ -180,6 +180,22 @@ export const CustomerJourneysCreateBody = /* @__PURE__ */ zod.object({
description: zod.string().nullish(),
})
+export const customerJourneysUpdateBodyNameMax = 400
+
+export const CustomerJourneysUpdateBody = /* @__PURE__ */ zod.object({
+ insight: zod.number(),
+ name: zod.string().max(customerJourneysUpdateBodyNameMax),
+ description: zod.string().nullish(),
+})
+
+export const customerJourneysPartialUpdateBodyNameMax = 400
+
+export const CustomerJourneysPartialUpdateBody = /* @__PURE__ */ zod.object({
+ insight: zod.number().optional(),
+ name: zod.string().max(customerJourneysPartialUpdateBodyNameMax).optional(),
+ description: zod.string().nullish(),
+})
+
export const CustomerProfileConfigsCreateBody = /* @__PURE__ */ zod.object({
scope: zod
.enum(['person', 'group_0', 'group_1', 'group_2', 'group_3', 'group_4'])
@@ -190,6 +206,27 @@ export const CustomerProfileConfigsCreateBody = /* @__PURE__ */ zod.object({
sidebar: zod.unknown().optional(),
})
+export const CustomerProfileConfigsUpdateBody = /* @__PURE__ */ zod.object({
+ scope: zod
+ .enum(['person', 'group_0', 'group_1', 'group_2', 'group_3', 'group_4'])
+ .describe(
+ '\* `person` - Person\n\* `group_0` - Group 0\n\* `group_1` - Group 1\n\* `group_2` - Group 2\n\* `group_3` - Group 3\n\* `group_4` - Group 4'
+ ),
+ content: zod.unknown().optional(),
+ sidebar: zod.unknown().optional(),
+})
+
+export const CustomerProfileConfigsPartialUpdateBody = /* @__PURE__ */ zod.object({
+ scope: zod
+ .enum(['person', 'group_0', 'group_1', 'group_2', 'group_3', 'group_4'])
+ .optional()
+ .describe(
+ '\* `person` - Person\n\* `group_0` - Group 0\n\* `group_1` - Group 1\n\* `group_2` - Group 2\n\* `group_3` - Group 3\n\* `group_4` - Group 4'
+ ),
+ content: zod.unknown().optional(),
+ sidebar: zod.unknown().optional(),
+})
+
export const groupsTypesMetricsCreateBodyNameMax = 255
export const groupsTypesMetricsCreateBodyFormatDefault = `numeric`
diff --git a/products/customer_analytics/mcp/tools.yaml b/products/customer_analytics/mcp/tools.yaml
index b1808ed3417c..010b73fda3bb 100644
--- a/products/customer_analytics/mcp/tools.yaml
+++ b/products/customer_analytics/mcp/tools.yaml
@@ -185,15 +185,39 @@ tools:
customer-journeys-create:
operation: customer_journeys_create
enabled: false
+ customer-journeys-destroy:
+ operation: customer_journeys_destroy
+ enabled: false
customer-journeys-list:
operation: customer_journeys_list
enabled: false
+ customer-journeys-partial-update:
+ operation: customer_journeys_partial_update
+ enabled: false
+ customer-journeys-retrieve:
+ operation: customer_journeys_retrieve
+ enabled: false
+ customer-journeys-update:
+ operation: customer_journeys_update
+ enabled: false
customer-profile-configs-create:
operation: customer_profile_configs_create
enabled: false
+ customer-profile-configs-destroy:
+ operation: customer_profile_configs_destroy
+ enabled: false
customer-profile-configs-list:
operation: customer_profile_configs_list
enabled: false
+ customer-profile-configs-partial-update:
+ operation: customer_profile_configs_partial_update
+ enabled: false
+ customer-profile-configs-retrieve:
+ operation: customer_profile_configs_retrieve
+ enabled: false
+ customer-profile-configs-update:
+ operation: customer_profile_configs_update
+ enabled: false
usage-metrics-create:
operation: groups_types_metrics_create
enabled: true
diff --git a/products/dashboards/backend/api/dashboard.py b/products/dashboards/backend/api/dashboard.py
index fe9bbf1c7011..3081a2d559c5 100644
--- a/products/dashboards/backend/api/dashboard.py
+++ b/products/dashboards/backend/api/dashboard.py
@@ -1253,7 +1253,6 @@ class DashboardSerializer(DashboardMetadataSerializer):
],
),
)
-@extend_schema(tags=["core"])
class DashboardsViewSet(
TeamAndOrgViewSetMixin,
AccessControlViewSetMixin,
diff --git a/products/dashboards/backend/api/dashboard_templates.py b/products/dashboards/backend/api/dashboard_templates.py
index a7f39a0bdb3e..68683ea82ab2 100644
--- a/products/dashboards/backend/api/dashboard_templates.py
+++ b/products/dashboards/backend/api/dashboard_templates.py
@@ -316,7 +316,6 @@ def _assert_user_can_read_source_for_copy(*, user: User, source_team: Team) -> N
],
),
)
-@extend_schema(tags=["core"])
class DashboardTemplateViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
scope_object = "dashboard_template"
permission_classes = [CustomerDashboardTemplateWritePermission]
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index 665c514a880c..d8a9a58702bb 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -121,6 +121,42 @@ export interface PaginatedDashboardTemplateListApi {
results: DashboardTemplateApi[]
}
+export interface PatchedDashboardTemplateApi {
+ readonly id?: string
+ /**
+ * @maxLength 400
+ * @nullable
+ */
+ template_name?: string | null
+ /**
+ * @maxLength 400
+ * @nullable
+ */
+ dashboard_description?: string | null
+ dashboard_filters?: unknown
+ /** @nullable */
+ tags?: string[] | null
+ tiles?: unknown
+ variables?: unknown
+ /** @nullable */
+ deleted?: boolean | null
+ /** @nullable */
+ readonly created_at?: string | null
+ readonly created_by?: UserBasicApi
+ /**
+ * @maxLength 8201
+ * @nullable
+ */
+ image_url?: string | null
+ /** @nullable */
+ readonly team_id?: number | null
+ scope?: DashboardTemplateScopeEnumApi | BlankEnumApi | null
+ /** @nullable */
+ availability_contexts?: string[] | null
+ /** Manually curated; used to highlight templates in the UI. */
+ is_featured?: boolean
+}
+
export interface CopyDashboardTemplateApi {
/** UUID of a team-scoped template in the same organization. Global and feature-flag templates cannot be copied with this endpoint. */
source_template_id: string
@@ -307,28 +343,6 @@ export interface DashboardCollaboratorApi {
user_uuid: string
}
-export interface SharePasswordApi {
- readonly id: number
- readonly created_at: string
- /**
- * @maxLength 100
- * @nullable
- */
- note?: string | null
- readonly created_by_email: string
- readonly is_active: boolean
-}
-
-export interface SharingConfigurationApi {
- readonly created_at: string
- enabled?: boolean
- /** @nullable */
- readonly access_token: string | null
- settings?: unknown
- password_required?: boolean
- readonly share_passwords: readonly SharePasswordApi[]
-}
-
export type PatchedDashboardApiFilters = { [key: string]: unknown }
/**
diff --git a/products/dashboards/frontend/generated/api.ts b/products/dashboards/frontend/generated/api.ts
index e7e1e580c80a..ed2dc764e5e0 100644
--- a/products/dashboards/frontend/generated/api.ts
+++ b/products/dashboards/frontend/generated/api.ts
@@ -43,10 +43,10 @@ import type {
PaginatedDashboardTemplateListApi,
PaginatedDataColorThemeListApi,
PatchedDashboardApi,
+ PatchedDashboardTemplateApi,
PatchedDataColorThemeApi,
ReorderTilesRequestApi,
RunInsightsResponseApi,
- SharingConfigurationApi,
UpdateTextTileRequestApi,
} from './api.schemas'
@@ -111,6 +111,75 @@ export const dashboardTemplatesCreate = async (
})
}
+export const getDashboardTemplatesRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/dashboard_templates/${id}/`
+}
+
+export const dashboardTemplatesRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<DashboardTemplateApi> => {
+ return apiMutator<DashboardTemplateApi>(getDashboardTemplatesRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getDashboardTemplatesUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/dashboard_templates/${id}/`
+}
+
+export const dashboardTemplatesUpdate = async (
+ projectId: string,
+ id: string,
+ dashboardTemplateApi?: NonReadonly<DashboardTemplateApi>,
+ options?: RequestInit
+): Promise<DashboardTemplateApi> => {
+ return apiMutator<DashboardTemplateApi>(getDashboardTemplatesUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(dashboardTemplateApi),
+ })
+}
+
+export const getDashboardTemplatesPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/dashboard_templates/${id}/`
+}
+
+export const dashboardTemplatesPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedDashboardTemplateApi?: NonReadonly<PatchedDashboardTemplateApi>,
+ options?: RequestInit
+): Promise<DashboardTemplateApi> => {
+ return apiMutator<DashboardTemplateApi>(getDashboardTemplatesPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedDashboardTemplateApi),
+ })
+}
+
+export const getDashboardTemplatesDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/dashboard_templates/${id}/`
+}
+
+/**
+ * Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
+ */
+export const dashboardTemplatesDestroy = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<unknown> => {
+ return apiMutator<unknown>(getDashboardTemplatesDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getDashboardTemplatesCopyBetweenProjectsCreateUrl = (projectId: string) => {
return `/api/projects/${projectId}/dashboard_templates/copy_between_projects/`
}
@@ -249,79 +318,6 @@ export const dashboardsCollaboratorsDestroy = async (
})
}
-export const getDashboardsSharingListUrl = (projectId: string, dashboardId: number) => {
- return `/api/projects/${projectId}/dashboards/${dashboardId}/sharing/`
-}
-
-export const dashboardsSharingList = async (
- projectId: string,
- dashboardId: number,
- options?: RequestInit
-): Promise<SharingConfigurationApi[]> => {
- return apiMutator<SharingConfigurationApi[]>(getDashboardsSharingListUrl(projectId, dashboardId), {
- ...options,
- method: 'GET',
- })
-}
-
-export const getDashboardsSharingPasswordsCreateUrl = (projectId: string, dashboardId: number) => {
- return `/api/projects/${projectId}/dashboards/${dashboardId}/sharing/passwords/`
-}
-
-/**
- * Create a new password for the sharing configuration.
- */
-export const dashboardsSharingPasswordsCreate = async (
- projectId: string,
- dashboardId: number,
- sharingConfigurationApi?: NonReadonly<SharingConfigurationApi>,
- options?: RequestInit
-): Promise<SharingConfigurationApi> => {
- return apiMutator<SharingConfigurationApi>(getDashboardsSharingPasswordsCreateUrl(projectId, dashboardId), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(sharingConfigurationApi),
- })
-}
-
-export const getDashboardsSharingPasswordsDestroyUrl = (projectId: string, dashboardId: number, passwordId: string) => {
- return `/api/projects/${projectId}/dashboards/${dashboardId}/sharing/passwords/${passwordId}/`
-}
-
-/**
- * Delete a password from the sharing configuration.
- */
-export const dashboardsSharingPasswordsDestroy = async (
- projectId: string,
- dashboardId: number,
- passwordId: string,
- options?: RequestInit
-): Promise<void> => {
- return apiMutator<void>(getDashboardsSharingPasswordsDestroyUrl(projectId, dashboardId, passwordId), {
- ...options,
- method: 'DELETE',
- })
-}
-
-export const getDashboardsSharingRefreshCreateUrl = (projectId: string, dashboardId: number) => {
- return `/api/projects/${projectId}/dashboards/${dashboardId}/sharing/refresh/`
-}
-
-export const dashboardsSharingRefreshCreate = async (
- projectId: string,
- dashboardId: number,
- sharingConfigurationApi?: NonReadonly<SharingConfigurationApi>,
- options?: RequestInit
-): Promise<SharingConfigurationApi> => {
- return apiMutator<SharingConfigurationApi>(getDashboardsSharingRefreshCreateUrl(projectId, dashboardId), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(sharingConfigurationApi),
- })
-}
-
export const getDashboardsRetrieveUrl = (projectId: string, id: number, params?: DashboardsRetrieveParams) => {
const normalizedParams = new URLSearchParams()
diff --git a/products/dashboards/frontend/generated/api.zod.ts b/products/dashboards/frontend/generated/api.zod.ts
index ad447961d836..be22722ebe35 100644
--- a/products/dashboards/frontend/generated/api.zod.ts
+++ b/products/dashboards/frontend/generated/api.zod.ts
@@ -43,6 +43,74 @@ export const DashboardTemplatesCreateBody = /* @__PURE__ */ zod.object({
is_featured: zod.boolean().optional().describe('Manually curated; used to highlight templates in the UI.'),
})
+export const dashboardTemplatesUpdateBodyTemplateNameMax = 400
+
+export const dashboardTemplatesUpdateBodyDashboardDescriptionMax = 400
+
+export const dashboardTemplatesUpdateBodyTagsItemMax = 255
+
+export const dashboardTemplatesUpdateBodyImageUrlMax = 8201
+
+export const dashboardTemplatesUpdateBodyAvailabilityContextsItemMax = 255
+
+export const DashboardTemplatesUpdateBody = /* @__PURE__ */ zod.object({
+ template_name: zod.string().max(dashboardTemplatesUpdateBodyTemplateNameMax).nullish(),
+ dashboard_description: zod.string().max(dashboardTemplatesUpdateBodyDashboardDescriptionMax).nullish(),
+ dashboard_filters: zod.unknown().optional(),
+ tags: zod.array(zod.string().max(dashboardTemplatesUpdateBodyTagsItemMax)).nullish(),
+ tiles: zod.unknown().optional(),
+ variables: zod.unknown().optional(),
+ deleted: zod.boolean().nullish(),
+ image_url: zod.string().max(dashboardTemplatesUpdateBodyImageUrlMax).nullish(),
+ scope: zod
+ .union([
+ zod
+ .enum(['team', 'global', 'feature_flag'])
+ .describe('\* `team` - Only team\n\* `global` - Global\n\* `feature_flag` - Feature Flag'),
+ zod.enum(['']),
+ zod.null(),
+ ])
+ .optional(),
+ availability_contexts: zod
+ .array(zod.string().max(dashboardTemplatesUpdateBodyAvailabilityContextsItemMax))
+ .nullish(),
+ is_featured: zod.boolean().optional().describe('Manually curated; used to highlight templates in the UI.'),
+})
+
+export const dashboardTemplatesPartialUpdateBodyTemplateNameMax = 400
+
+export const dashboardTemplatesPartialUpdateBodyDashboardDescriptionMax = 400
+
+export const dashboardTemplatesPartialUpdateBodyTagsItemMax = 255
+
+export const dashboardTemplatesPartialUpdateBodyImageUrlMax = 8201
+
+export const dashboardTemplatesPartialUpdateBodyAvailabilityContextsItemMax = 255
+
+export const DashboardTemplatesPartialUpdateBody = /* @__PURE__ */ zod.object({
+ template_name: zod.string().max(dashboardTemplatesPartialUpdateBodyTemplateNameMax).nullish(),
+ dashboard_description: zod.string().max(dashboardTemplatesPartialUpdateBodyDashboardDescriptionMax).nullish(),
+ dashboard_filters: zod.unknown().optional(),
+ tags: zod.array(zod.string().max(dashboardTemplatesPartialUpdateBodyTagsItemMax)).nullish(),
+ tiles: zod.unknown().optional(),
+ variables: zod.unknown().optional(),
+ deleted: zod.boolean().nullish(),
+ image_url: zod.string().max(dashboardTemplatesPartialUpdateBodyImageUrlMax).nullish(),
+ scope: zod
+ .union([
+ zod
+ .enum(['team', 'global', 'feature_flag'])
+ .describe('\* `team` - Only team\n\* `global` - Global\n\* `feature_flag` - Feature Flag'),
+ zod.enum(['']),
+ zod.null(),
+ ])
+ .optional(),
+ availability_contexts: zod
+ .array(zod.string().max(dashboardTemplatesPartialUpdateBodyAvailabilityContextsItemMax))
+ .nullish(),
+ is_featured: zod.boolean().optional().describe('Manually curated; used to highlight templates in the UI.'),
+})
+
/**
* Creates a new team-scoped template in the **target** project (URL) from a **team-scoped** source template in the same organization. Global and feature-flag templates return 400. Cross-organization or inaccessible sources return 404. Source and destination projects must differ (400 if equal). Conflicting `template_name` values on the destination are auto-suffixed with `(copy)`, `(copy 2)`, …
* @summary Copy a team template to this project
@@ -102,21 +170,6 @@ export const DashboardsCollaboratorsCreateBody = /* @__PURE__ */ zod.object({
user_uuid: zod.uuid(),
})
-/**
- * Create a new password for the sharing configuration.
- */
-export const DashboardsSharingPasswordsCreateBody = /* @__PURE__ */ zod.object({
- enabled: zod.boolean().optional(),
- settings: zod.unknown().optional(),
- password_required: zod.boolean().optional(),
-})
-
-export const DashboardsSharingRefreshCreateBody = /* @__PURE__ */ zod.object({
- enabled: zod.boolean().optional(),
- settings: zod.unknown().optional(),
- password_required: zod.boolean().optional(),
-})
-
export const dashboardsUpdateBodyNameMax = 400
export const dashboardsUpdateBodyDeleteInsightsDefault = false
diff --git a/products/dashboards/mcp/tools.yaml b/products/dashboards/mcp/tools.yaml
index eea51b06ca67..7d029dcdb1bf 100644
--- a/products/dashboards/mcp/tools.yaml
+++ b/products/dashboards/mcp/tools.yaml
@@ -209,12 +209,24 @@ tools:
dashboard-templates-create:
operation: dashboard_templates_create
enabled: false
+ dashboard-templates-destroy:
+ operation: dashboard_templates_destroy
+ enabled: false
dashboard-templates-json-schema-retrieve:
operation: dashboard_templates_json_schema_retrieve
enabled: false
dashboard-templates-list:
operation: dashboard_templates_list
enabled: false
+ dashboard-templates-partial-update:
+ operation: dashboard_templates_partial_update
+ enabled: false
+ dashboard-templates-retrieve:
+ operation: dashboard_templates_retrieve
+ enabled: false
+ dashboard-templates-update:
+ operation: dashboard_templates_update
+ enabled: false
dashboard-update:
operation: dashboards_partial_update
enabled: true
diff --git a/products/data_modeling/frontend/generated/api.schemas.ts b/products/data_modeling/frontend/generated/api.schemas.ts
index b40362b78fe9..612770083e4c 100644
--- a/products/data_modeling/frontend/generated/api.schemas.ts
+++ b/products/data_modeling/frontend/generated/api.schemas.ts
@@ -36,6 +36,26 @@ export interface PaginatedDAGListApi {
results: DagApi[]
}
+export interface PatchedDAGApi {
+ readonly id?: string
+ /**
+ * Human-readable name for this DAG
+ * @maxLength 2048
+ */
+ name?: string
+ /** Optional description of the DAG's purpose */
+ description?: string
+ /**
+ * Sync frequency string (e.g. '24hour', '7day')
+ * @nullable
+ */
+ sync_frequency?: string | null
+ readonly node_count?: number
+ readonly created_at?: string
+ /** @nullable */
+ readonly updated_at?: string | null
+}
+
export interface EdgeApi {
readonly id: string
readonly source_id: string
@@ -57,6 +77,18 @@ export interface PaginatedEdgeListApi {
results: EdgeApi[]
}
+export interface PatchedEdgeApi {
+ readonly id?: string
+ readonly source_id?: string
+ readonly target_id?: string
+ dag?: string
+ readonly dag_name?: string
+ properties?: unknown
+ readonly created_at?: string
+ /** @nullable */
+ readonly updated_at?: string | null
+}
+
/**
* * `table` - Table
* `view` - View
@@ -107,6 +139,32 @@ export interface PaginatedNodeListApi {
results: NodeApi[]
}
+export interface PatchedNodeApi {
+ readonly id?: string
+ /** @maxLength 2048 */
+ name?: string
+ type?: NodeTypeEnumApi
+ dag?: string
+ readonly dag_name?: string
+ /** @maxLength 1024 */
+ description?: string
+ /** @nullable */
+ readonly saved_query_id?: string | null
+ readonly created_at?: string
+ /** @nullable */
+ readonly updated_at?: string | null
+ readonly upstream_count?: number
+ readonly downstream_count?: number
+ /** @nullable */
+ readonly last_run_at?: string | null
+ /** @nullable */
+ readonly last_run_status?: string | null
+ /** @nullable */
+ readonly user_tag?: string | null
+ /** @nullable */
+ readonly sync_interval?: string | null
+}
+
export type DataModelingDagsListParams = {
/**
* Number of results to return per page.
diff --git a/products/data_modeling/frontend/generated/api.ts b/products/data_modeling/frontend/generated/api.ts
index c4e1b9a46890..ec4115bf0089 100644
--- a/products/data_modeling/frontend/generated/api.ts
+++ b/products/data_modeling/frontend/generated/api.ts
@@ -18,6 +18,9 @@ import type {
PaginatedDAGListApi,
PaginatedEdgeListApi,
PaginatedNodeListApi,
+ PatchedDAGApi,
+ PatchedEdgeApi,
+ PatchedNodeApi,
} from './api.schemas'
// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
@@ -81,6 +84,50 @@ export const dataModelingDagsCreate = async (
})
}
+export const getDataModelingDagsRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_dags/${id}/`
+}
+
+export const dataModelingDagsRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<DagApi> => {
+ return apiMutator<DagApi>(getDataModelingDagsRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getDataModelingDagsPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_dags/${id}/`
+}
+
+export const dataModelingDagsPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedDAGApi?: NonReadonly<PatchedDAGApi>,
+ options?: RequestInit
+): Promise<DagApi> => {
+ return apiMutator<DagApi>(getDataModelingDagsPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedDAGApi),
+ })
+}
+
+export const getDataModelingDagsDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_dags/${id}/`
+}
+
+export const dataModelingDagsDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getDataModelingDagsDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getDataModelingEdgesListUrl = (projectId: string, params?: DataModelingEdgesListParams) => {
const normalizedParams = new URLSearchParams()
@@ -125,6 +172,68 @@ export const dataModelingEdgesCreate = async (
})
}
+export const getDataModelingEdgesRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_edges/${id}/`
+}
+
+export const dataModelingEdgesRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<EdgeApi> => {
+ return apiMutator<EdgeApi>(getDataModelingEdgesRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getDataModelingEdgesUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_edges/${id}/`
+}
+
+export const dataModelingEdgesUpdate = async (
+ projectId: string,
+ id: string,
+ edgeApi: NonReadonly<EdgeApi>,
+ options?: RequestInit
+): Promise<EdgeApi> => {
+ return apiMutator<EdgeApi>(getDataModelingEdgesUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(edgeApi),
+ })
+}
+
+export const getDataModelingEdgesPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_edges/${id}/`
+}
+
+export const dataModelingEdgesPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedEdgeApi?: NonReadonly<PatchedEdgeApi>,
+ options?: RequestInit
+): Promise<EdgeApi> => {
+ return apiMutator<EdgeApi>(getDataModelingEdgesPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedEdgeApi),
+ })
+}
+
+export const getDataModelingEdgesDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_edges/${id}/`
+}
+
+export const dataModelingEdgesDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getDataModelingEdgesDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getDataModelingNodesListUrl = (projectId: string, params?: DataModelingNodesListParams) => {
const normalizedParams = new URLSearchParams()
@@ -169,6 +278,133 @@ export const dataModelingNodesCreate = async (
})
}
+export const getDataModelingNodesRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_nodes/${id}/`
+}
+
+export const dataModelingNodesRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<NodeApi> => {
+ return apiMutator<NodeApi>(getDataModelingNodesRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getDataModelingNodesUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_nodes/${id}/`
+}
+
+export const dataModelingNodesUpdate = async (
+ projectId: string,
+ id: string,
+ nodeApi: NonReadonly<NodeApi>,
+ options?: RequestInit
+): Promise<NodeApi> => {
+ return apiMutator<NodeApi>(getDataModelingNodesUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(nodeApi),
+ })
+}
+
+export const getDataModelingNodesPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_nodes/${id}/`
+}
+
+export const dataModelingNodesPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedNodeApi?: NonReadonly<PatchedNodeApi>,
+ options?: RequestInit
+): Promise<NodeApi> => {
+ return apiMutator<NodeApi>(getDataModelingNodesPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedNodeApi),
+ })
+}
+
+export const getDataModelingNodesDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_nodes/${id}/`
+}
+
+export const dataModelingNodesDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getDataModelingNodesDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
+export const getDataModelingNodesLineageRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_nodes/${id}/lineage/`
+}
+
+/**
+ * Return the subgraph of nodes and edges reachable from this node (upstream + downstream).
+ */
+export const dataModelingNodesLineageRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<NodeApi> => {
+ return apiMutator<NodeApi>(getDataModelingNodesLineageRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getDataModelingNodesMaterializeCreateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_nodes/${id}/materialize/`
+}
+
+/**
+ * Materialize just this single node.
+ */
+export const dataModelingNodesMaterializeCreate = async (
+ projectId: string,
+ id: string,
+ nodeApi: NonReadonly<NodeApi>,
+ options?: RequestInit
+): Promise<NodeApi> => {
+ return apiMutator<NodeApi>(getDataModelingNodesMaterializeCreateUrl(projectId, id), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(nodeApi),
+ })
+}
+
+export const getDataModelingNodesRunCreateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/data_modeling_nodes/${id}/run/`
+}
+
+/**
+ * Run this node and its upstream or downstream dependencies.
+
+Request body:
+ direction: "upstream" | "downstream" (required)
+ - "upstream": Run all ancestors of this node, plus this node
+ - "downstream": Run this node and all its descendants
+ */
+export const dataModelingNodesRunCreate = async (
+ projectId: string,
+ id: string,
+ nodeApi: NonReadonly<NodeApi>,
+ options?: RequestInit
+): Promise<NodeApi> => {
+ return apiMutator<NodeApi>(getDataModelingNodesRunCreateUrl(projectId, id), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(nodeApi),
+ })
+}
+
export const getDataModelingNodesDagIdsRetrieveUrl = (projectId: string) => {
return `/api/projects/${projectId}/data_modeling_nodes/dag_ids/`
}
diff --git a/products/data_modeling/frontend/generated/api.zod.ts b/products/data_modeling/frontend/generated/api.zod.ts
index bb06abdc6721..cdaf13c0d0cf 100644
--- a/products/data_modeling/frontend/generated/api.zod.ts
+++ b/products/data_modeling/frontend/generated/api.zod.ts
@@ -17,11 +17,33 @@ export const DataModelingDagsCreateBody = /* @__PURE__ */ zod.object({
sync_frequency: zod.string().nullish().describe("Sync frequency string (e.g. '24hour', '7day')"),
})
+export const dataModelingDagsPartialUpdateBodyNameMax = 2048
+
+export const DataModelingDagsPartialUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod
+ .string()
+ .max(dataModelingDagsPartialUpdateBodyNameMax)
+ .optional()
+ .describe('Human-readable name for this DAG'),
+ description: zod.string().optional().describe("Optional description of the DAG's purpose"),
+ sync_frequency: zod.string().nullish().describe("Sync frequency string (e.g. '24hour', '7day')"),
+})
+
export const DataModelingEdgesCreateBody = /* @__PURE__ */ zod.object({
dag: zod.uuid(),
properties: zod.unknown().optional(),
})
+export const DataModelingEdgesUpdateBody = /* @__PURE__ */ zod.object({
+ dag: zod.uuid(),
+ properties: zod.unknown().optional(),
+})
+
+export const DataModelingEdgesPartialUpdateBody = /* @__PURE__ */ zod.object({
+ dag: zod.uuid().optional(),
+ properties: zod.unknown().optional(),
+})
+
export const dataModelingNodesCreateBodyNameMax = 2048
export const dataModelingNodesCreateBodyDescriptionMax = 1024
@@ -35,3 +57,70 @@ export const DataModelingNodesCreateBody = /* @__PURE__ */ zod.object({
dag: zod.uuid(),
description: zod.string().max(dataModelingNodesCreateBodyDescriptionMax).optional(),
})
+
+export const dataModelingNodesUpdateBodyNameMax = 2048
+
+export const dataModelingNodesUpdateBodyDescriptionMax = 1024
+
+export const DataModelingNodesUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(dataModelingNodesUpdateBodyNameMax),
+ type: zod
+ .enum(['table', 'view', 'matview', 'endpoint'])
+ .optional()
+ .describe('\* `table` - Table\n\* `view` - View\n\* `matview` - Mat View\n\* `endpoint` - Endpoint'),
+ dag: zod.uuid(),
+ description: zod.string().max(dataModelingNodesUpdateBodyDescriptionMax).optional(),
+})
+
+export const dataModelingNodesPartialUpdateBodyNameMax = 2048
+
+export const dataModelingNodesPartialUpdateBodyDescriptionMax = 1024
+
+export const DataModelingNodesPartialUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(dataModelingNodesPartialUpdateBodyNameMax).optional(),
+ type: zod
+ .enum(['table', 'view', 'matview', 'endpoint'])
+ .optional()
+ .describe('\* `table` - Table\n\* `view` - View\n\* `matview` - Mat View\n\* `endpoint` - Endpoint'),
+ dag: zod.uuid().optional(),
+ description: zod.string().max(dataModelingNodesPartialUpdateBodyDescriptionMax).optional(),
+})
+
+/**
+ * Materialize just this single node.
+ */
+export const dataModelingNodesMaterializeCreateBodyNameMax = 2048
+
+export const dataModelingNodesMaterializeCreateBodyDescriptionMax = 1024
+
+export const DataModelingNodesMaterializeCreateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(dataModelingNodesMaterializeCreateBodyNameMax),
+ type: zod
+ .enum(['table', 'view', 'matview', 'endpoint'])
+ .optional()
+ .describe('\* `table` - Table\n\* `view` - View\n\* `matview` - Mat View\n\* `endpoint` - Endpoint'),
+ dag: zod.uuid(),
+ description: zod.string().max(dataModelingNodesMaterializeCreateBodyDescriptionMax).optional(),
+})
+
+/**
+ * Run this node and its upstream or downstream dependencies.
+
+Request body:
+ direction: "upstream" | "downstream" (required)
+ - "upstream": Run all ancestors of this node, plus this node
+ - "downstream": Run this node and all its descendants
+ */
+export const dataModelingNodesRunCreateBodyNameMax = 2048
+
+export const dataModelingNodesRunCreateBodyDescriptionMax = 1024
+
+export const DataModelingNodesRunCreateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(dataModelingNodesRunCreateBodyNameMax),
+ type: zod
+ .enum(['table', 'view', 'matview', 'endpoint'])
+ .optional()
+ .describe('\* `table` - Table\n\* `view` - View\n\* `matview` - Mat View\n\* `endpoint` - Endpoint'),
+ dag: zod.uuid(),
+ description: zod.string().max(dataModelingNodesRunCreateBodyDescriptionMax).optional(),
+})
diff --git a/products/data_warehouse/backend/api/data_modeling_job.py b/products/data_warehouse/backend/api/data_modeling_job.py
index ebb47f0c98d5..dda59dd73c53 100644
--- a/products/data_warehouse/backend/api/data_modeling_job.py
+++ b/products/data_warehouse/backend/api/data_modeling_job.py
@@ -1,12 +1,9 @@
import posthoganalytics
from django_filters.rest_framework import DjangoFilterBackend
-from drf_spectacular.utils import extend_schema
from rest_framework import pagination, serializers, viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from products.data_modeling.backend.models.data_modeling_job import DataModelingJob, DataModelingJobEngine
@@ -37,7 +34,6 @@ class DataModelingJobPagination(pagination.CursorPagination):
page_size_query_param = "limit"
-@extend_schema(tags=[ProductKey.DATA_WAREHOUSE])
class DataModelingJobViewSet(TeamAndOrgViewSetMixin, viewsets.ReadOnlyModelViewSet):
"""
List data modeling jobs which are "runs" for our saved queries.
diff --git a/products/data_warehouse/backend/api/external_data_schema.py b/products/data_warehouse/backend/api/external_data_schema.py
index 9929360f6890..0aadab41a12f 100644
--- a/products/data_warehouse/backend/api/external_data_schema.py
+++ b/products/data_warehouse/backend/api/external_data_schema.py
@@ -5,7 +5,7 @@ from typing import Any, Optional
import structlog
import temporalio
-from drf_spectacular.utils import extend_schema, extend_schema_field
+from drf_spectacular.utils import extend_schema_field
from rest_framework import filters, serializers, status, viewsets
from rest_framework.exceptions import ValidationError
from rest_framework.request import Request
@@ -730,7 +730,6 @@ class SimpleExternalDataSchemaSerializer(serializers.ModelSerializer):
fields = ["id", "name", "label", "should_sync", "last_synced_at", "sync_type"]
-@extend_schema(tags=["data_warehouse"])
class ExternalDataSchemaViewset(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "external_data_source"
scope_object_write_actions = [
diff --git a/products/data_warehouse/backend/api/external_data_source.py b/products/data_warehouse/backend/api/external_data_source.py
index 93d218a50e1b..d5658fe6a40e 100644
--- a/products/data_warehouse/backend/api/external_data_source.py
+++ b/products/data_warehouse/backend/api/external_data_source.py
@@ -19,7 +19,6 @@ from rest_framework.request import Request
from rest_framework.response import Response
from posthog.schema import (
- ProductKey,
SourceFieldFileUploadConfig,
SourceFieldInputConfig,
SourceFieldInputConfigType,
@@ -922,7 +921,6 @@ class SimpleExternalDataSourceSerializers(serializers.ModelSerializer):
read_only_fields = ["id", "created_by", "created_at", "status", "source_type"]
-@extend_schema(tags=[ProductKey.DATA_WAREHOUSE])
class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, viewsets.ModelViewSet):
"""
Create, Read, Update and Delete External data Sources.
diff --git a/products/data_warehouse/backend/api/public_source_configs.py b/products/data_warehouse/backend/api/public_source_configs.py
index d113ddd6ffe4..68819696b0f5 100644
--- a/products/data_warehouse/backend/api/public_source_configs.py
+++ b/products/data_warehouse/backend/api/public_source_configs.py
@@ -8,7 +8,6 @@ from posthog.schema import SourceConfig
from posthog.temporal.data_imports.sources import SourceRegistry
-@extend_schema(tags=["data_warehouse"])
class PublicSourceConfigViewSet(viewsets.ViewSet):
"""
Public (unauthenticated) endpoint that returns the full SourceConfig
diff --git a/products/data_warehouse/backend/api/query_tab_state.py b/products/data_warehouse/backend/api/query_tab_state.py
index 18102a5ab9de..be9bf55b21bb 100644
--- a/products/data_warehouse/backend/api/query_tab_state.py
+++ b/products/data_warehouse/backend/api/query_tab_state.py
@@ -1,10 +1,7 @@
-from drf_spectacular.utils import extend_schema
from rest_framework import serializers, viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.models.user import User
@@ -25,7 +22,6 @@ class QueryTabStateSerializer(serializers.ModelSerializer):
return query_tab_state
-@extend_schema(tags=[ProductKey.DATA_WAREHOUSE])
class QueryTabStateViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
"""
Create, Read, Update and Delete Query Tab State.
diff --git a/products/data_warehouse/backend/api/saved_query.py b/products/data_warehouse/backend/api/saved_query.py
index 1f7730cc8306..8e54e778e137 100644
--- a/products/data_warehouse/backend/api/saved_query.py
+++ b/products/data_warehouse/backend/api/saved_query.py
@@ -10,7 +10,7 @@ from django.db.models.functions import Cast
import structlog
import posthoganalytics
from asgiref.sync import async_to_sync
-from drf_spectacular.utils import extend_schema, extend_schema_field
+from drf_spectacular.utils import extend_schema_field
from loginas.utils import is_impersonated_session
from rest_framework import exceptions, filters, request, response, serializers, status, viewsets
from rest_framework.decorators import action
@@ -18,7 +18,7 @@ from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
from temporalio.client import ScheduleActionExecutionStartWorkflow
-from posthog.schema import DataWarehouseManagedViewsetKind, ProductKey
+from posthog.schema import DataWarehouseManagedViewsetKind
from posthog.hogql.context import HogQLContext
from posthog.hogql.database.database import Database, SerializedField, serialize_fields
@@ -646,7 +646,6 @@ class DataWarehouseSavedQueryFolderSerializer(UserAccessControlSerializerMixin,
return normalized_name
-@extend_schema(tags=[ProductKey.DATA_WAREHOUSE])
class DataWarehouseSavedQueryFolderViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, viewsets.ModelViewSet):
scope_object = "warehouse_view"
queryset = DataWarehouseSavedQueryFolder.objects.all()
@@ -698,7 +697,6 @@ class DataWarehouseSavedQueryFolderViewSet(TeamAndOrgViewSetMixin, AccessControl
return response.Response(status=status.HTTP_204_NO_CONTENT)
-@extend_schema(tags=[ProductKey.DATA_WAREHOUSE])
class DataWarehouseSavedQueryViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, viewsets.ModelViewSet):
"""
Create, Read, Update and Delete Warehouse Tables.
diff --git a/products/data_warehouse/backend/api/saved_query_draft.py b/products/data_warehouse/backend/api/saved_query_draft.py
index 6da869b1e6e5..b4d866672ccb 100644
--- a/products/data_warehouse/backend/api/saved_query_draft.py
+++ b/products/data_warehouse/backend/api/saved_query_draft.py
@@ -1,8 +1,5 @@
-from drf_spectacular.utils import extend_schema
from rest_framework import pagination, serializers, viewsets
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from products.data_modeling.backend.models.datawarehouse_saved_query import DataWarehouseSavedQuery
@@ -48,7 +45,6 @@ class DataWarehouseSavedQueryDraftSerializer(serializers.ModelSerializer):
return draft
-@extend_schema(tags=[ProductKey.DATA_WAREHOUSE])
class DataWarehouseSavedQueryDraftViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "INTERNAL"
queryset = DataWarehouseSavedQueryDraft.objects.all()
diff --git a/products/data_warehouse/frontend/generated/api.schemas.ts b/products/data_warehouse/frontend/generated/api.schemas.ts
index ecb61ee9c88b..a899ead309a3 100644
--- a/products/data_warehouse/frontend/generated/api.schemas.ts
+++ b/products/data_warehouse/frontend/generated/api.schemas.ts
@@ -1914,6 +1914,42 @@ export interface PaginatedTableListApi {
results: TableApi[]
}
+export type PatchedTableApiColumnsItem = { [key: string]: unknown }
+
+/**
+ * @nullable
+ */
+export type PatchedTableApiExternalSchema = { [key: string]: unknown } | null
+
+export type PatchedTableApiOptions = { [key: string]: unknown }
+
+/**
+ * Mixin for serializers to add user access control fields
+ */
+export interface PatchedTableApi {
+ readonly id?: string
+ /** @nullable */
+ deleted?: boolean | null
+ /** @maxLength 128 */
+ name?: string
+ format?: TableFormatEnumApi
+ readonly created_by?: UserBasicApi
+ readonly created_at?: string
+ /** @maxLength 500 */
+ url_pattern?: string
+ credential?: CredentialApi
+ readonly columns?: readonly PatchedTableApiColumnsItem[]
+ readonly external_data_source?: SimpleExternalDataSourceSerializersApi
+ /** @nullable */
+ readonly external_schema?: PatchedTableApiExternalSchema
+ options?: PatchedTableApiOptions
+ /**
+ * The effective access level the user has for this object
+ * @nullable
+ */
+ readonly user_access_level?: string | null
+}
+
export interface ViewLinkApi {
readonly id: string
/** @nullable */
@@ -1942,6 +1978,25 @@ export interface PaginatedViewLinkListApi {
results: ViewLinkApi[]
}
+export interface PatchedViewLinkApi {
+ readonly id?: string
+ /** @nullable */
+ deleted?: boolean | null
+ readonly created_by?: UserBasicApi
+ readonly created_at?: string
+ /** @maxLength 400 */
+ source_table_name?: string
+ /** @maxLength 400 */
+ source_table_key?: string
+ /** @maxLength 400 */
+ joining_table_name?: string
+ /** @maxLength 400 */
+ joining_table_key?: string
+ /** @maxLength 400 */
+ field_name?: string
+ configuration?: unknown
+}
+
export interface ViewLinkValidationApi {
/** @maxLength 255 */
joining_table_name: string
diff --git a/products/data_warehouse/frontend/generated/api.ts b/products/data_warehouse/frontend/generated/api.ts
index 03a80063b1ad..831aacbddeab 100644
--- a/products/data_warehouse/frontend/generated/api.ts
+++ b/products/data_warehouse/frontend/generated/api.ts
@@ -13,6 +13,7 @@ import type {
DataModelingJobApi,
DataModelingJobsListParams,
DataWarehouseCheckDatabaseNameRetrieveParams,
+ DataWarehouseModelPathApi,
DataWarehouseSavedQueryApi,
DataWarehouseSavedQueryDraftApi,
DataWarehouseSavedQueryFolderApi,
@@ -48,6 +49,8 @@ import type {
PatchedExternalDataSourceSerializersApi,
PatchedInsightVariableApi,
PatchedQueryTabStateApi,
+ PatchedTableApi,
+ PatchedViewLinkApi,
ProvisionWarehouseRequestApi,
ProvisionWarehouseResponseApi,
QueryTabStateApi,
@@ -1059,6 +1062,50 @@ export const fixHogqlCreate = async (projectId: string, options?: RequestInit):
})
}
+export const getFixHogqlRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/fix_hogql/${id}/`
+}
+
+export const fixHogqlRetrieve = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getFixHogqlRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getFixHogqlUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/fix_hogql/${id}/`
+}
+
+export const fixHogqlUpdate = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getFixHogqlUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ })
+}
+
+export const getFixHogqlPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/fix_hogql/${id}/`
+}
+
+export const fixHogqlPartialUpdate = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getFixHogqlPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ })
+}
+
+export const getFixHogqlDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/fix_hogql/${id}/`
+}
+
+export const fixHogqlDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getFixHogqlDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getInsightVariablesListUrl = (projectId: string, params?: InsightVariablesListParams) => {
const normalizedParams = new URLSearchParams()
@@ -1396,6 +1443,21 @@ export const warehouseModelPathsList = async (
})
}
+export const getWarehouseModelPathsRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_model_paths/${id}/`
+}
+
+export const warehouseModelPathsRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<DataWarehouseModelPathApi> => {
+ return apiMutator<DataWarehouseModelPathApi>(getWarehouseModelPathsRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
export const getWarehouseSavedQueriesListUrl = (projectId: string, params?: WarehouseSavedQueriesListParams) => {
const normalizedParams = new URLSearchParams()
@@ -1987,6 +2049,122 @@ export const warehouseTablesCreate = async (
})
}
+export const getWarehouseTablesRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_tables/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<TableApi> => {
+ return apiMutator<TableApi>(getWarehouseTablesRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getWarehouseTablesUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_tables/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesUpdate = async (
+ projectId: string,
+ id: string,
+ tableApi: NonReadonly<TableApi>,
+ options?: RequestInit
+): Promise<TableApi> => {
+ return apiMutator<TableApi>(getWarehouseTablesUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(tableApi),
+ })
+}
+
+export const getWarehouseTablesPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_tables/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedTableApi?: NonReadonly<PatchedTableApi>,
+ options?: RequestInit
+): Promise<TableApi> => {
+ return apiMutator<TableApi>(getWarehouseTablesPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedTableApi),
+ })
+}
+
+export const getWarehouseTablesDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_tables/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getWarehouseTablesDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
+export const getWarehouseTablesRefreshSchemaCreateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_tables/${id}/refresh_schema/`
+}
+
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesRefreshSchemaCreate = async (
+ projectId: string,
+ id: string,
+ tableApi: NonReadonly<TableApi>,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getWarehouseTablesRefreshSchemaCreateUrl(projectId, id), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(tableApi),
+ })
+}
+
+export const getWarehouseTablesUpdateSchemaCreateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_tables/${id}/update_schema/`
+}
+
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesUpdateSchemaCreate = async (
+ projectId: string,
+ id: string,
+ tableApi: NonReadonly<TableApi>,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getWarehouseTablesUpdateSchemaCreateUrl(projectId, id), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(tableApi),
+ })
+}
+
export const getWarehouseTablesFileCreateUrl = (projectId: string) => {
return `/api/projects/${projectId}/warehouse_tables/file/`
}
@@ -2068,6 +2246,80 @@ export const warehouseViewLinkCreate = async (
})
}
+export const getWarehouseViewLinkRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_view_link/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinkRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<ViewLinkApi> => {
+ return apiMutator<ViewLinkApi>(getWarehouseViewLinkRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getWarehouseViewLinkUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_view_link/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinkUpdate = async (
+ projectId: string,
+ id: string,
+ viewLinkApi: NonReadonly<ViewLinkApi>,
+ options?: RequestInit
+): Promise<ViewLinkApi> => {
+ return apiMutator<ViewLinkApi>(getWarehouseViewLinkUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(viewLinkApi),
+ })
+}
+
+export const getWarehouseViewLinkPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_view_link/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinkPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedViewLinkApi?: NonReadonly<PatchedViewLinkApi>,
+ options?: RequestInit
+): Promise<ViewLinkApi> => {
+ return apiMutator<ViewLinkApi>(getWarehouseViewLinkPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedViewLinkApi),
+ })
+}
+
+export const getWarehouseViewLinkDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_view_link/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinkDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getWarehouseViewLinkDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getWarehouseViewLinkValidateCreateUrl = (projectId: string) => {
return `/api/projects/${projectId}/warehouse_view_link/validate/`
}
@@ -2138,6 +2390,84 @@ export const warehouseViewLinksCreate = async (
})
}
+export const getWarehouseViewLinksRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_view_links/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinksRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<ViewLinkApi> => {
+ return apiMutator<ViewLinkApi>(getWarehouseViewLinksRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getWarehouseViewLinksUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_view_links/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinksUpdate = async (
+ projectId: string,
+ id: string,
+ viewLinkApi: NonReadonly<ViewLinkApi>,
+ options?: RequestInit
+): Promise<ViewLinkApi> => {
+ return apiMutator<ViewLinkApi>(getWarehouseViewLinksUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(viewLinkApi),
+ })
+}
+
+export const getWarehouseViewLinksPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_view_links/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinksPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedViewLinkApi?: NonReadonly<PatchedViewLinkApi>,
+ options?: RequestInit
+): Promise<ViewLinkApi> => {
+ return apiMutator<ViewLinkApi>(getWarehouseViewLinksPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedViewLinkApi),
+ })
+}
+
+export const getWarehouseViewLinksDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/warehouse_view_links/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinksDestroy = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getWarehouseViewLinksDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getWarehouseViewLinksValidateCreateUrl = (projectId: string) => {
return `/api/projects/${projectId}/warehouse_view_links/validate/`
}
diff --git a/products/data_warehouse/frontend/generated/api.zod.ts b/products/data_warehouse/frontend/generated/api.zod.ts
index 943183d1f557..6350fdf89450 100644
--- a/products/data_warehouse/frontend/generated/api.zod.ts
+++ b/products/data_warehouse/frontend/generated/api.zod.ts
@@ -1848,6 +1848,312 @@ export const WarehouseTablesCreateBody = /* @__PURE__ */ zod
})
.describe('Mixin for serializers to add user access control fields')
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesUpdateBodyNameMax = 128
+
+export const warehouseTablesUpdateBodyUrlPatternMax = 500
+
+export const warehouseTablesUpdateBodyCredentialCreatedByOneDistinctIdMax = 200
+
+export const warehouseTablesUpdateBodyCredentialCreatedByOneFirstNameMax = 150
+
+export const warehouseTablesUpdateBodyCredentialCreatedByOneLastNameMax = 150
+
+export const warehouseTablesUpdateBodyCredentialCreatedByOneEmailMax = 254
+
+export const warehouseTablesUpdateBodyCredentialAccessKeyMax = 500
+
+export const warehouseTablesUpdateBodyCredentialAccessSecretMax = 500
+
+export const WarehouseTablesUpdateBody = /* @__PURE__ */ zod
+ .object({
+ deleted: zod.boolean().nullish(),
+ name: zod.string().max(warehouseTablesUpdateBodyNameMax),
+ format: zod
+ .enum(['CSV', 'CSVWithNames', 'Parquet', 'JSONEachRow', 'Delta', 'DeltaS3Wrapper'])
+ .describe(
+ '\* `CSV` - CSV\n\* `CSVWithNames` - CSVWithNames\n\* `Parquet` - Parquet\n\* `JSONEachRow` - JSON\n\* `Delta` - Delta\n\* `DeltaS3Wrapper` - DeltaS3Wrapper'
+ ),
+ url_pattern: zod.string().max(warehouseTablesUpdateBodyUrlPatternMax),
+ credential: zod.object({
+ id: zod.uuid(),
+ created_by: zod.object({
+ id: zod.number(),
+ uuid: zod.uuid(),
+ distinct_id: zod.string().max(warehouseTablesUpdateBodyCredentialCreatedByOneDistinctIdMax).nullish(),
+ first_name: zod.string().max(warehouseTablesUpdateBodyCredentialCreatedByOneFirstNameMax).optional(),
+ last_name: zod.string().max(warehouseTablesUpdateBodyCredentialCreatedByOneLastNameMax).optional(),
+ email: zod.email().max(warehouseTablesUpdateBodyCredentialCreatedByOneEmailMax),
+ is_email_verified: zod.boolean().nullish(),
+ hedgehog_config: zod.record(zod.string(), zod.unknown()).nullable(),
+ role_at_organization: zod
+ .union([
+ zod
+ .enum([
+ 'engineering',
+ 'data',
+ 'product',
+ 'founder',
+ 'leadership',
+ 'marketing',
+ 'sales',
+ 'other',
+ ])
+ .describe(
+ '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `other` - Other'
+ ),
+ zod.enum(['']),
+ zod.null(),
+ ])
+ .optional(),
+ }),
+ created_at: zod.iso.datetime({ offset: true }),
+ access_key: zod.string().max(warehouseTablesUpdateBodyCredentialAccessKeyMax),
+ access_secret: zod.string().max(warehouseTablesUpdateBodyCredentialAccessSecretMax),
+ }),
+ options: zod.record(zod.string(), zod.unknown()).optional(),
+ })
+ .describe('Mixin for serializers to add user access control fields')
+
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesPartialUpdateBodyNameMax = 128
+
+export const warehouseTablesPartialUpdateBodyUrlPatternMax = 500
+
+export const warehouseTablesPartialUpdateBodyCredentialCreatedByOneDistinctIdMax = 200
+
+export const warehouseTablesPartialUpdateBodyCredentialCreatedByOneFirstNameMax = 150
+
+export const warehouseTablesPartialUpdateBodyCredentialCreatedByOneLastNameMax = 150
+
+export const warehouseTablesPartialUpdateBodyCredentialCreatedByOneEmailMax = 254
+
+export const warehouseTablesPartialUpdateBodyCredentialAccessKeyMax = 500
+
+export const warehouseTablesPartialUpdateBodyCredentialAccessSecretMax = 500
+
+export const WarehouseTablesPartialUpdateBody = /* @__PURE__ */ zod
+ .object({
+ deleted: zod.boolean().nullish(),
+ name: zod.string().max(warehouseTablesPartialUpdateBodyNameMax).optional(),
+ format: zod
+ .enum(['CSV', 'CSVWithNames', 'Parquet', 'JSONEachRow', 'Delta', 'DeltaS3Wrapper'])
+ .optional()
+ .describe(
+ '\* `CSV` - CSV\n\* `CSVWithNames` - CSVWithNames\n\* `Parquet` - Parquet\n\* `JSONEachRow` - JSON\n\* `Delta` - Delta\n\* `DeltaS3Wrapper` - DeltaS3Wrapper'
+ ),
+ url_pattern: zod.string().max(warehouseTablesPartialUpdateBodyUrlPatternMax).optional(),
+ credential: zod
+ .object({
+ id: zod.uuid(),
+ created_by: zod.object({
+ id: zod.number(),
+ uuid: zod.uuid(),
+ distinct_id: zod
+ .string()
+ .max(warehouseTablesPartialUpdateBodyCredentialCreatedByOneDistinctIdMax)
+ .nullish(),
+ first_name: zod
+ .string()
+ .max(warehouseTablesPartialUpdateBodyCredentialCreatedByOneFirstNameMax)
+ .optional(),
+ last_name: zod
+ .string()
+ .max(warehouseTablesPartialUpdateBodyCredentialCreatedByOneLastNameMax)
+ .optional(),
+ email: zod.email().max(warehouseTablesPartialUpdateBodyCredentialCreatedByOneEmailMax),
+ is_email_verified: zod.boolean().nullish(),
+ hedgehog_config: zod.record(zod.string(), zod.unknown()).nullable(),
+ role_at_organization: zod
+ .union([
+ zod
+ .enum([
+ 'engineering',
+ 'data',
+ 'product',
+ 'founder',
+ 'leadership',
+ 'marketing',
+ 'sales',
+ 'other',
+ ])
+ .describe(
+ '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `other` - Other'
+ ),
+ zod.enum(['']),
+ zod.null(),
+ ])
+ .optional(),
+ }),
+ created_at: zod.iso.datetime({ offset: true }),
+ access_key: zod.string().max(warehouseTablesPartialUpdateBodyCredentialAccessKeyMax),
+ access_secret: zod.string().max(warehouseTablesPartialUpdateBodyCredentialAccessSecretMax),
+ })
+ .optional(),
+ options: zod.record(zod.string(), zod.unknown()).optional(),
+ })
+ .describe('Mixin for serializers to add user access control fields')
+
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesRefreshSchemaCreateBodyNameMax = 128
+
+export const warehouseTablesRefreshSchemaCreateBodyUrlPatternMax = 500
+
+export const warehouseTablesRefreshSchemaCreateBodyCredentialCreatedByOneDistinctIdMax = 200
+
+export const warehouseTablesRefreshSchemaCreateBodyCredentialCreatedByOneFirstNameMax = 150
+
+export const warehouseTablesRefreshSchemaCreateBodyCredentialCreatedByOneLastNameMax = 150
+
+export const warehouseTablesRefreshSchemaCreateBodyCredentialCreatedByOneEmailMax = 254
+
+export const warehouseTablesRefreshSchemaCreateBodyCredentialAccessKeyMax = 500
+
+export const warehouseTablesRefreshSchemaCreateBodyCredentialAccessSecretMax = 500
+
+export const WarehouseTablesRefreshSchemaCreateBody = /* @__PURE__ */ zod
+ .object({
+ deleted: zod.boolean().nullish(),
+ name: zod.string().max(warehouseTablesRefreshSchemaCreateBodyNameMax),
+ format: zod
+ .enum(['CSV', 'CSVWithNames', 'Parquet', 'JSONEachRow', 'Delta', 'DeltaS3Wrapper'])
+ .describe(
+ '\* `CSV` - CSV\n\* `CSVWithNames` - CSVWithNames\n\* `Parquet` - Parquet\n\* `JSONEachRow` - JSON\n\* `Delta` - Delta\n\* `DeltaS3Wrapper` - DeltaS3Wrapper'
+ ),
+ url_pattern: zod.string().max(warehouseTablesRefreshSchemaCreateBodyUrlPatternMax),
+ credential: zod.object({
+ id: zod.uuid(),
+ created_by: zod.object({
+ id: zod.number(),
+ uuid: zod.uuid(),
+ distinct_id: zod
+ .string()
+ .max(warehouseTablesRefreshSchemaCreateBodyCredentialCreatedByOneDistinctIdMax)
+ .nullish(),
+ first_name: zod
+ .string()
+ .max(warehouseTablesRefreshSchemaCreateBodyCredentialCreatedByOneFirstNameMax)
+ .optional(),
+ last_name: zod
+ .string()
+ .max(warehouseTablesRefreshSchemaCreateBodyCredentialCreatedByOneLastNameMax)
+ .optional(),
+ email: zod.email().max(warehouseTablesRefreshSchemaCreateBodyCredentialCreatedByOneEmailMax),
+ is_email_verified: zod.boolean().nullish(),
+ hedgehog_config: zod.record(zod.string(), zod.unknown()).nullable(),
+ role_at_organization: zod
+ .union([
+ zod
+ .enum([
+ 'engineering',
+ 'data',
+ 'product',
+ 'founder',
+ 'leadership',
+ 'marketing',
+ 'sales',
+ 'other',
+ ])
+ .describe(
+ '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `other` - Other'
+ ),
+ zod.enum(['']),
+ zod.null(),
+ ])
+ .optional(),
+ }),
+ created_at: zod.iso.datetime({ offset: true }),
+ access_key: zod.string().max(warehouseTablesRefreshSchemaCreateBodyCredentialAccessKeyMax),
+ access_secret: zod.string().max(warehouseTablesRefreshSchemaCreateBodyCredentialAccessSecretMax),
+ }),
+ options: zod.record(zod.string(), zod.unknown()).optional(),
+ })
+ .describe('Mixin for serializers to add user access control fields')
+
+/**
+ * Create, Read, Update and Delete Warehouse Tables.
+ */
+export const warehouseTablesUpdateSchemaCreateBodyNameMax = 128
+
+export const warehouseTablesUpdateSchemaCreateBodyUrlPatternMax = 500
+
+export const warehouseTablesUpdateSchemaCreateBodyCredentialCreatedByOneDistinctIdMax = 200
+
+export const warehouseTablesUpdateSchemaCreateBodyCredentialCreatedByOneFirstNameMax = 150
+
+export const warehouseTablesUpdateSchemaCreateBodyCredentialCreatedByOneLastNameMax = 150
+
+export const warehouseTablesUpdateSchemaCreateBodyCredentialCreatedByOneEmailMax = 254
+
+export const warehouseTablesUpdateSchemaCreateBodyCredentialAccessKeyMax = 500
+
+export const warehouseTablesUpdateSchemaCreateBodyCredentialAccessSecretMax = 500
+
+export const WarehouseTablesUpdateSchemaCreateBody = /* @__PURE__ */ zod
+ .object({
+ deleted: zod.boolean().nullish(),
+ name: zod.string().max(warehouseTablesUpdateSchemaCreateBodyNameMax),
+ format: zod
+ .enum(['CSV', 'CSVWithNames', 'Parquet', 'JSONEachRow', 'Delta', 'DeltaS3Wrapper'])
+ .describe(
+ '\* `CSV` - CSV\n\* `CSVWithNames` - CSVWithNames\n\* `Parquet` - Parquet\n\* `JSONEachRow` - JSON\n\* `Delta` - Delta\n\* `DeltaS3Wrapper` - DeltaS3Wrapper'
+ ),
+ url_pattern: zod.string().max(warehouseTablesUpdateSchemaCreateBodyUrlPatternMax),
+ credential: zod.object({
+ id: zod.uuid(),
+ created_by: zod.object({
+ id: zod.number(),
+ uuid: zod.uuid(),
+ distinct_id: zod
+ .string()
+ .max(warehouseTablesUpdateSchemaCreateBodyCredentialCreatedByOneDistinctIdMax)
+ .nullish(),
+ first_name: zod
+ .string()
+ .max(warehouseTablesUpdateSchemaCreateBodyCredentialCreatedByOneFirstNameMax)
+ .optional(),
+ last_name: zod
+ .string()
+ .max(warehouseTablesUpdateSchemaCreateBodyCredentialCreatedByOneLastNameMax)
+ .optional(),
+ email: zod.email().max(warehouseTablesUpdateSchemaCreateBodyCredentialCreatedByOneEmailMax),
+ is_email_verified: zod.boolean().nullish(),
+ hedgehog_config: zod.record(zod.string(), zod.unknown()).nullable(),
+ role_at_organization: zod
+ .union([
+ zod
+ .enum([
+ 'engineering',
+ 'data',
+ 'product',
+ 'founder',
+ 'leadership',
+ 'marketing',
+ 'sales',
+ 'other',
+ ])
+ .describe(
+ '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `other` - Other'
+ ),
+ zod.enum(['']),
+ zod.null(),
+ ])
+ .optional(),
+ }),
+ created_at: zod.iso.datetime({ offset: true }),
+ access_key: zod.string().max(warehouseTablesUpdateSchemaCreateBodyCredentialAccessKeyMax),
+ access_secret: zod.string().max(warehouseTablesUpdateSchemaCreateBodyCredentialAccessSecretMax),
+ }),
+ options: zod.record(zod.string(), zod.unknown()).optional(),
+ })
+ .describe('Mixin for serializers to add user access control fields')
+
/**
* Create, Read, Update and Delete Warehouse Tables.
*/
@@ -1946,6 +2252,52 @@ export const WarehouseViewLinkCreateBody = /* @__PURE__ */ zod.object({
configuration: zod.unknown().optional(),
})
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinkUpdateBodySourceTableNameMax = 400
+
+export const warehouseViewLinkUpdateBodySourceTableKeyMax = 400
+
+export const warehouseViewLinkUpdateBodyJoiningTableNameMax = 400
+
+export const warehouseViewLinkUpdateBodyJoiningTableKeyMax = 400
+
+export const warehouseViewLinkUpdateBodyFieldNameMax = 400
+
+export const WarehouseViewLinkUpdateBody = /* @__PURE__ */ zod.object({
+ deleted: zod.boolean().nullish(),
+ source_table_name: zod.string().max(warehouseViewLinkUpdateBodySourceTableNameMax),
+ source_table_key: zod.string().max(warehouseViewLinkUpdateBodySourceTableKeyMax),
+ joining_table_name: zod.string().max(warehouseViewLinkUpdateBodyJoiningTableNameMax),
+ joining_table_key: zod.string().max(warehouseViewLinkUpdateBodyJoiningTableKeyMax),
+ field_name: zod.string().max(warehouseViewLinkUpdateBodyFieldNameMax),
+ configuration: zod.unknown().optional(),
+})
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinkPartialUpdateBodySourceTableNameMax = 400
+
+export const warehouseViewLinkPartialUpdateBodySourceTableKeyMax = 400
+
+export const warehouseViewLinkPartialUpdateBodyJoiningTableNameMax = 400
+
+export const warehouseViewLinkPartialUpdateBodyJoiningTableKeyMax = 400
+
+export const warehouseViewLinkPartialUpdateBodyFieldNameMax = 400
+
+export const WarehouseViewLinkPartialUpdateBody = /* @__PURE__ */ zod.object({
+ deleted: zod.boolean().nullish(),
+ source_table_name: zod.string().max(warehouseViewLinkPartialUpdateBodySourceTableNameMax).optional(),
+ source_table_key: zod.string().max(warehouseViewLinkPartialUpdateBodySourceTableKeyMax).optional(),
+ joining_table_name: zod.string().max(warehouseViewLinkPartialUpdateBodyJoiningTableNameMax).optional(),
+ joining_table_key: zod.string().max(warehouseViewLinkPartialUpdateBodyJoiningTableKeyMax).optional(),
+ field_name: zod.string().max(warehouseViewLinkPartialUpdateBodyFieldNameMax).optional(),
+ configuration: zod.unknown().optional(),
+})
+
/**
* Create, Read, Update and Delete View Columns.
*/
@@ -1987,6 +2339,52 @@ export const WarehouseViewLinksCreateBody = /* @__PURE__ */ zod.object({
configuration: zod.unknown().optional(),
})
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinksUpdateBodySourceTableNameMax = 400
+
+export const warehouseViewLinksUpdateBodySourceTableKeyMax = 400
+
+export const warehouseViewLinksUpdateBodyJoiningTableNameMax = 400
+
+export const warehouseViewLinksUpdateBodyJoiningTableKeyMax = 400
+
+export const warehouseViewLinksUpdateBodyFieldNameMax = 400
+
+export const WarehouseViewLinksUpdateBody = /* @__PURE__ */ zod.object({
+ deleted: zod.boolean().nullish(),
+ source_table_name: zod.string().max(warehouseViewLinksUpdateBodySourceTableNameMax),
+ source_table_key: zod.string().max(warehouseViewLinksUpdateBodySourceTableKeyMax),
+ joining_table_name: zod.string().max(warehouseViewLinksUpdateBodyJoiningTableNameMax),
+ joining_table_key: zod.string().max(warehouseViewLinksUpdateBodyJoiningTableKeyMax),
+ field_name: zod.string().max(warehouseViewLinksUpdateBodyFieldNameMax),
+ configuration: zod.unknown().optional(),
+})
+
+/**
+ * Create, Read, Update and Delete View Columns.
+ */
+export const warehouseViewLinksPartialUpdateBodySourceTableNameMax = 400
+
+export const warehouseViewLinksPartialUpdateBodySourceTableKeyMax = 400
+
+export const warehouseViewLinksPartialUpdateBodyJoiningTableNameMax = 400
+
+export const warehouseViewLinksPartialUpdateBodyJoiningTableKeyMax = 400
+
+export const warehouseViewLinksPartialUpdateBodyFieldNameMax = 400
+
+export const WarehouseViewLinksPartialUpdateBody = /* @__PURE__ */ zod.object({
+ deleted: zod.boolean().nullish(),
+ source_table_name: zod.string().max(warehouseViewLinksPartialUpdateBodySourceTableNameMax).optional(),
+ source_table_key: zod.string().max(warehouseViewLinksPartialUpdateBodySourceTableKeyMax).optional(),
+ joining_table_name: zod.string().max(warehouseViewLinksPartialUpdateBodyJoiningTableNameMax).optional(),
+ joining_table_key: zod.string().max(warehouseViewLinksPartialUpdateBodyJoiningTableKeyMax).optional(),
+ field_name: zod.string().max(warehouseViewLinksPartialUpdateBodyFieldNameMax).optional(),
+ configuration: zod.unknown().optional(),
+})
+
/**
* Create, Read, Update and Delete View Columns.
*/
diff --git a/products/data_warehouse/mcp/tools.yaml b/products/data_warehouse/mcp/tools.yaml
index ab83c230a467..3d493c3354a5 100644
--- a/products/data_warehouse/mcp/tools.yaml
+++ b/products/data_warehouse/mcp/tools.yaml
@@ -458,9 +458,21 @@ tools:
fix-hogql-create:
operation: fix_hogql_create
enabled: false
+ fix-hogql-destroy:
+ operation: fix_hogql_destroy
+ enabled: false
fix-hogql-list:
operation: fix_hogql_list
enabled: false
+ fix-hogql-partial-update:
+ operation: fix_hogql_partial_update
+ enabled: false
+ fix-hogql-retrieve:
+ operation: fix_hogql_retrieve
+ enabled: false
+ fix-hogql-update:
+ operation: fix_hogql_update
+ enabled: false
insight-variables-list:
operation: insight_variables_list
enabled: false
@@ -723,6 +735,9 @@ tools:
warehouse-model-paths-list:
operation: warehouse_model_paths_list
enabled: false
+ warehouse-model-paths-retrieve:
+ operation: warehouse_model_paths_retrieve
+ enabled: false
warehouse-saved-queries-activity-retrieve:
operation: warehouse_saved_queries_activity_retrieve
enabled: false
@@ -780,27 +795,69 @@ tools:
warehouse-tables-create:
operation: warehouse_tables_create
enabled: false
+ warehouse-tables-destroy:
+ operation: warehouse_tables_destroy
+ enabled: false
warehouse-tables-file-create:
operation: warehouse_tables_file_create
enabled: false
warehouse-tables-list:
operation: warehouse_tables_list
enabled: false
+ warehouse-tables-partial-update:
+ operation: warehouse_tables_partial_update
+ enabled: false
+ warehouse-tables-refresh-schema-create:
+ operation: warehouse_tables_refresh_schema_create
+ enabled: false
+ warehouse-tables-retrieve:
+ operation: warehouse_tables_retrieve
+ enabled: false
+ warehouse-tables-update:
+ operation: warehouse_tables_update
+ enabled: false
+ warehouse-tables-update-schema-create:
+ operation: warehouse_tables_update_schema_create
+ enabled: false
warehouse-view-link-create:
operation: warehouse_view_link_create
enabled: false
+ warehouse-view-link-destroy:
+ operation: warehouse_view_link_destroy
+ enabled: false
warehouse-view-link-list:
operation: warehouse_view_link_list
enabled: false
+ warehouse-view-link-partial-update:
+ operation: warehouse_view_link_partial_update
+ enabled: false
+ warehouse-view-link-retrieve:
+ operation: warehouse_view_link_retrieve
+ enabled: false
+ warehouse-view-link-update:
+ operation: warehouse_view_link_update
+ enabled: false
warehouse-view-link-validate-create:
operation: warehouse_view_link_validate_create
enabled: false
warehouse-view-links-create:
operation: warehouse_view_links_create
enabled: false
+ warehouse-view-links-destroy:
+ operation: warehouse_view_links_destroy
+ enabled: false
warehouse-view-links-list:
operation: warehouse_view_links_list
enabled: false
+ warehouse-view-links-partial-update:
+ operation: warehouse_view_links_partial_update
+ enabled: false
+ warehouse-view-links-retrieve:
+ operation: warehouse_view_links_retrieve
+ enabled: false
+ warehouse-view-links-update:
+ operation: warehouse_view_links_update
+ enabled: false
warehouse-view-links-validate-create:
operation: warehouse_view_links_validate_create
enabled: false
diff --git a/products/deployments/backend/api/deployment_projects.py b/products/deployments/backend/api/deployment_projects.py
index 95c864ba18d5..57f938591696 100644
--- a/products/deployments/backend/api/deployment_projects.py
+++ b/products/deployments/backend/api/deployment_projects.py
@@ -230,7 +230,6 @@ def _refresh_project_repository_state(
)
-@extend_schema(tags=["deployments"])
class DeploymentProjectViewSet(
TeamAndOrgViewSetMixin,
AccessControlViewSetMixin,
diff --git a/products/desktop_recordings/backend/api.py b/products/desktop_recordings/backend/api.py
index 1574427e0c9e..9176b0f74f53 100644
--- a/products/desktop_recordings/backend/api.py
+++ b/products/desktop_recordings/backend/api.py
@@ -26,7 +26,6 @@ from .serializers import (
from .services.recall_client import RecallAIClient
-@extend_schema(tags=["desktop_recordings"])
class DesktopRecordingViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
"""
RESTful API for managing desktop meeting recordings.
diff --git a/products/early_access_features/backend/api.py b/products/early_access_features/backend/api.py
index c2cfdb1872fc..749f663a24b3 100644
--- a/products/early_access_features/backend/api.py
+++ b/products/early_access_features/backend/api.py
@@ -5,13 +5,11 @@ from django.utils.text import slugify
from django.views.decorators.csrf import csrf_exempt
import structlog
-from drf_spectacular.utils import extend_schema, extend_schema_field
+from drf_spectacular.utils import extend_schema_field
from rest_framework import serializers, status, viewsets
from rest_framework.request import Request
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.shared import UserBasicSerializer
from posthog.api.utils import get_token
@@ -310,7 +308,6 @@ class EarlyAccessFeatureSerializerCreateOnly(EarlyAccessFeatureSerializer):
return feature
-@extend_schema(tags=[ProductKey.EARLY_ACCESS_FEATURES])
class EarlyAccessFeatureViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "early_access_feature"
queryset = EarlyAccessFeature.objects.select_related("feature_flag").all()
diff --git a/products/endpoints/backend/api.py b/products/endpoints/backend/api.py
index fc2cf6c952ef..07a9a31d181f 100644
--- a/products/endpoints/backend/api.py
+++ b/products/endpoints/backend/api.py
@@ -32,7 +32,6 @@ from posthog.schema import (
HogQLQuery,
HogQLQueryModifiers,
HogQLVariable,
- ProductKey,
PropertyOperator,
QueryRequest,
QueryStatus,
@@ -142,7 +141,6 @@ DATA_FRESHNESS_BUCKETS: dict[int, str] = {
VALID_DATA_FRESHNESS_SECONDS: frozenset[int] = frozenset(DATA_FRESHNESS_BUCKETS)
DEFAULT_DATA_FRESHNESS_SECONDS = 86400
-
ENDPOINT_NAME_REGEX = r"^[a-zA-Z][a-zA-Z0-9_-]{0,127}$"
logger = structlog.get_logger(__name__)
@@ -390,7 +388,6 @@ class MaterializationPreviewRequestSerializer(serializers.Serializer):
description="Update an existing endpoint.",
),
)
-@extend_schema(tags=[ProductKey.ENDPOINTS])
class EndpointViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, TaggedItemViewSetMixin, viewsets.ModelViewSet):
# NOTE: Do we need to override the scopes for the "create"
scope_object = "endpoint"
diff --git a/products/error_tracking/backend/api/issues.py b/products/error_tracking/backend/api/issues.py
index 809c85049c69..be0fbbf3f7c6 100644
--- a/products/error_tracking/backend/api/issues.py
+++ b/products/error_tracking/backend/api/issues.py
@@ -12,8 +12,6 @@ from rest_framework import request, serializers, status, viewsets
from rest_framework.exceptions import NotFound, ValidationError
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.documentation import extend_schema, extend_schema_field
from posthog.api.forbid_destroy_model import ForbidDestroyModel
from posthog.api.mixins import ValidatedRequest, validated_request
@@ -192,7 +190,6 @@ class ErrorTrackingIssueSplitResponseSerializer(serializers.Serializer):
)
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingIssueViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
scope_object = "error_tracking"
# These override the base defaults, so keep the standard DRF actions too.
diff --git a/products/error_tracking/backend/api/query.py b/products/error_tracking/backend/api/query.py
index 5d51e29ef10c..6583e12870b8 100644
--- a/products/error_tracking/backend/api/query.py
+++ b/products/error_tracking/backend/api/query.py
@@ -8,9 +8,8 @@ from drf_spectacular.utils import OpenApiResponse
from rest_framework import status, viewsets
from rest_framework.response import Response
-from posthog.schema import DateRange, ErrorTrackingIssueAssignee, ErrorTrackingQuery, EventsQuery, ProductKey
+from posthog.schema import DateRange, ErrorTrackingIssueAssignee, ErrorTrackingQuery, EventsQuery
-from posthog.api.documentation import extend_schema
from posthog.api.mixins import ValidatedRequest, validated_request
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.utils import action
@@ -88,7 +87,6 @@ def build_fingerprint_filter_group(fingerprints: list[str]) -> dict[str, object]
return filter_group
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingQueryViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
scope_object = "error_tracking"
diff --git a/products/error_tracking/backend/api/recommendations.py b/products/error_tracking/backend/api/recommendations.py
index 1ae421d1cfaa..c3e3526773d9 100644
--- a/products/error_tracking/backend/api/recommendations.py
+++ b/products/error_tracking/backend/api/recommendations.py
@@ -13,8 +13,6 @@ from rest_framework.decorators import action
from rest_framework.request import Request
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from products.error_tracking.backend.models import ErrorTrackingRecommendation
@@ -165,7 +163,6 @@ def _kick_off_stale_computations(team_id: int) -> None:
)
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingRecommendationViewSet(
TeamAndOrgViewSetMixin,
mixins.ListModelMixin,
diff --git a/products/error_tracking/backend/api/releases.py b/products/error_tracking/backend/api/releases.py
index d31bcc47cd7b..0826327fbcaf 100644
--- a/products/error_tracking/backend/api/releases.py
+++ b/products/error_tracking/backend/api/releases.py
@@ -1,13 +1,10 @@
from django.shortcuts import get_object_or_404
import structlog
-from drf_spectacular.utils import extend_schema
from rest_framework import serializers, status, viewsets
from rest_framework.exceptions import ValidationError
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.utils import action
from posthog.models.utils import UUIDT
@@ -24,7 +21,6 @@ class ErrorTrackingReleaseSerializer(serializers.ModelSerializer):
read_only_fields = ["team_id"]
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingReleaseViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "error_tracking"
queryset = ErrorTrackingRelease.objects.all()
diff --git a/products/error_tracking/backend/api/settings.py b/products/error_tracking/backend/api/settings.py
index 14f140b8284f..de5d41247c98 100644
--- a/products/error_tracking/backend/api/settings.py
+++ b/products/error_tracking/backend/api/settings.py
@@ -3,8 +3,6 @@ from rest_framework import serializers, status, viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from products.error_tracking.backend.models import ErrorTrackingSettings
@@ -46,7 +44,6 @@ class ErrorTrackingSettingsSerializer(serializers.ModelSerializer):
]
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingSettingsViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
scope_object = "error_tracking"
diff --git a/products/error_tracking/backend/api/spike_detection_config.py b/products/error_tracking/backend/api/spike_detection_config.py
index 9adaa17b17eb..150deaf38b9b 100644
--- a/products/error_tracking/backend/api/spike_detection_config.py
+++ b/products/error_tracking/backend/api/spike_detection_config.py
@@ -4,8 +4,6 @@ from rest_framework import serializers, status, viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from products.error_tracking.backend.models import ErrorTrackingSpikeDetectionConfig
@@ -32,7 +30,6 @@ class ErrorTrackingSpikeDetectionConfigSerializer(serializers.ModelSerializer):
fields = ["snooze_duration_minutes", "multiplier", "threshold"]
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingSpikeDetectionConfigViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
scope_object = "error_tracking"
diff --git a/products/error_tracking/backend/api/spike_events.py b/products/error_tracking/backend/api/spike_events.py
index b0528e979835..d64c33d85703 100644
--- a/products/error_tracking/backend/api/spike_events.py
+++ b/products/error_tracking/backend/api/spike_events.py
@@ -1,8 +1,5 @@
-from drf_spectacular.utils import extend_schema
from rest_framework import mixins, serializers, viewsets
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from products.error_tracking.backend.models import ErrorTrackingIssue, ErrorTrackingSpikeEvent
@@ -30,7 +27,6 @@ class ErrorTrackingSpikeEventSerializer(serializers.ModelSerializer):
read_only_fields = fields
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingSpikeEventViewSet(TeamAndOrgViewSetMixin, mixins.ListModelMixin, viewsets.GenericViewSet):
scope_object = "error_tracking"
serializer_class = ErrorTrackingSpikeEventSerializer
diff --git a/products/error_tracking/backend/api/stack_frames.py b/products/error_tracking/backend/api/stack_frames.py
index f1ad90bbbfbb..ed423697aa80 100644
--- a/products/error_tracking/backend/api/stack_frames.py
+++ b/products/error_tracking/backend/api/stack_frames.py
@@ -1,12 +1,10 @@
from django.db.models import Q
import structlog
-from drf_spectacular.utils import extend_schema, extend_schema_field
+from drf_spectacular.utils import extend_schema_field
from rest_framework import serializers, viewsets
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.forbid_destroy_model import ForbidDestroyModel
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.utils import action
@@ -32,7 +30,6 @@ class ErrorTrackingStackFrameSerializer(serializers.ModelSerializer):
return obj.raw_id + "/" + str(obj.part)
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingStackFrameViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ReadOnlyModelViewSet):
scope_object = "error_tracking"
scope_object_read_actions = ["list", "retrieve", "batch_get"]
diff --git a/products/error_tracking/backend/api/symbol_sets.py b/products/error_tracking/backend/api/symbol_sets.py
index c1dd49866958..024bf7d5839f 100644
--- a/products/error_tracking/backend/api/symbol_sets.py
+++ b/products/error_tracking/backend/api/symbol_sets.py
@@ -13,8 +13,6 @@ from rest_framework.parsers import FileUploadParser, JSONParser, MultiPartParser
from rest_framework.request import Request
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.utils import action
from posthog.event_usage import groups
@@ -199,7 +197,6 @@ class ErrorTrackingSymbolSetPagination(pagination.LimitOffsetPagination):
max_limit = 100
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingSymbolSetViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "error_tracking"
queryset = ErrorTrackingSymbolSet.objects.all()
diff --git a/products/error_tracking/backend/presentation/external_references.py b/products/error_tracking/backend/presentation/external_references.py
index 1c845f66914d..7f7fe568cefa 100644
--- a/products/error_tracking/backend/presentation/external_references.py
+++ b/products/error_tracking/backend/presentation/external_references.py
@@ -1,13 +1,11 @@
import logging
from uuid import UUID
-from drf_spectacular.utils import extend_schema, extend_schema_serializer
+from drf_spectacular.utils import extend_schema_serializer
from rest_framework import serializers, status, viewsets
from rest_framework.exceptions import NotFound, ValidationError
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.forbid_destroy_model import ForbidDestroyModel
from posthog.api.routing import TeamAndOrgViewSetMixin
@@ -49,7 +47,6 @@ class ErrorTrackingExternalReferenceSerializer(serializers.Serializer):
raise ValidationError("Provider not supported")
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingExternalReferenceViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.GenericViewSet):
scope_object = "INTERNAL"
serializer_class = ErrorTrackingExternalReferenceSerializer
diff --git a/products/error_tracking/backend/presentation/fingerprints.py b/products/error_tracking/backend/presentation/fingerprints.py
index fe39ab1f2330..d53243ead48f 100644
--- a/products/error_tracking/backend/presentation/fingerprints.py
+++ b/products/error_tracking/backend/presentation/fingerprints.py
@@ -5,8 +5,6 @@ from rest_framework import serializers, viewsets
from rest_framework.exceptions import NotFound, ValidationError
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.forbid_destroy_model import ForbidDestroyModel
from posthog.api.routing import TeamAndOrgViewSetMixin
@@ -20,7 +18,6 @@ class ErrorTrackingFingerprintSerializer(serializers.Serializer):
created_at = serializers.DateTimeField(read_only=True)
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class ErrorTrackingFingerprintViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.GenericViewSet):
scope_object = "error_tracking"
scope_object_read_actions = ["list", "retrieve"]
diff --git a/products/error_tracking/backend/presentation/git_provider_file_link_resolver.py b/products/error_tracking/backend/presentation/git_provider_file_link_resolver.py
index 3c84cac5f6be..763118fcc0ce 100644
--- a/products/error_tracking/backend/presentation/git_provider_file_link_resolver.py
+++ b/products/error_tracking/backend/presentation/git_provider_file_link_resolver.py
@@ -9,8 +9,6 @@ from drf_spectacular.utils import OpenApiResponse, extend_schema
from rest_framework import serializers, viewsets
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.utils import action
from posthog.models.integration import GitHubIntegration, GitLabIntegration, Integration
@@ -162,7 +160,6 @@ def get_gitlab_file_url(
return None
-@extend_schema(tags=[ProductKey.ERROR_TRACKING])
class GitProviderFileLinksViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
scope_object = "error_tracking"
diff --git a/products/experiments/backend/presentation/views.py b/products/experiments/backend/presentation/views.py
index 27529770599d..7422822f58ab 100644
--- a/products/experiments/backend/presentation/views.py
+++ b/products/experiments/backend/presentation/views.py
@@ -201,7 +201,6 @@ def _slugify_feature_flag_key(name: str, *, team_id: int) -> str:
# DELETE /experiments/{id}/
# Logic and API docs defined in posthog/api/forbid_destroy_model.py (hard delete not allowed)
)
-@extend_schema(tags=["experiments"])
class EnterpriseExperimentsViewSet(
# ApprovalHandlingMixin converts ApprovalRequired exceptions (raised by
# FeatureFlagSerializer in ship_variant) into 409 HTTP responses. The
diff --git a/products/feature_flags/backend/api/feature_flag.py b/products/feature_flags/backend/api/feature_flag.py
index 83a1c7d0b55d..063689eaa848 100644
--- a/products/feature_flags/backend/api/feature_flag.py
+++ b/products/feature_flags/backend/api/feature_flag.py
@@ -2471,7 +2471,7 @@ class BulkDeleteResponseSerializer(serializers.Serializer):
# action on this viewset, wrap it with tag_queries(product=Product.FEATURE_FLAGS,
# feature=Feature.QUERY, team_id=self.team_id) so query_log attribution stays correct.
# See posthog/models/feature_flag/user_blast_radius.py for the pattern.
-@extend_schema(tags=[ProductKey.FEATURE_FLAGS])
+@extend_schema(extensions={"x-product": ProductKey.FEATURE_FLAGS})
class FeatureFlagViewSet(
ApprovalHandlingMixin,
TeamAndOrgViewSetMixin,
diff --git a/products/feature_flags/backend/api/scheduled_change.py b/products/feature_flags/backend/api/scheduled_change.py
index e73b2f742cac..384ac3220e54 100644
--- a/products/feature_flags/backend/api/scheduled_change.py
+++ b/products/feature_flags/backend/api/scheduled_change.py
@@ -221,7 +221,7 @@ class ScheduledChangeSerializer(serializers.ModelSerializer):
return super().update(instance, validated_data)
-@extend_schema(tags=["feature_flags"])
+@extend_schema(extensions={"x-product": "feature_flags"})
class ScheduledChangeViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
"""
Create, read, update and delete scheduled changes.
diff --git a/products/integrations/frontend/generated/api.schemas.ts b/products/integrations/frontend/generated/api.schemas.ts
index 50c86d5c41f8..3aefa115ceaa 100644
--- a/products/integrations/frontend/generated/api.schemas.ts
+++ b/products/integrations/frontend/generated/api.schemas.ts
@@ -332,70 +332,6 @@ export interface GitHubTeamsResponseApi {
has_more: boolean
}
-export interface UserGitHubAccountApi {
- /**
- * GitHub account type for the installation (e.g. User or Organization).
- * @nullable
- */
- type?: string | null
- /**
- * GitHub login or organization name tied to the installation.
- * @nullable
- */
- name?: string | null
-}
-
-export interface UserGitHubIntegrationItemApi {
- /** PostHog UserIntegration row id. */
- id: string
- /** Integration kind; always `github` for this API. */
- kind: string
- /** GitHub App installation id. */
- installation_id: string
- /**
- * Repository selection mode from GitHub (e.g. selected or all).
- * @nullable
- */
- repository_selection?: string | null
- /** Installation account metadata from GitHub. */
- account?: UserGitHubAccountApi | null
- /** True when this installation id matches a team-level GitHub integration on the active project. */
- uses_shared_installation: boolean
- /** When this integration row was created. */
- created_at: string
-}
-
-export interface UserGitHubIntegrationListResponseApi {
- /** GitHub personal integrations for the authenticated user. */
- results: UserGitHubIntegrationItemApi[]
-}
-
-export interface PaginatedUserGitHubIntegrationListResponseListApi {
- count: number
- /** @nullable */
- next?: string | null
- /** @nullable */
- previous?: string | null
- results: UserGitHubIntegrationListResponseApi[]
-}
-
-export interface UserGitHubLinkStartRequestApi {
- /**
- * Optional team/project id (e.g. PostHog Code); web UI uses the session's current team.
- * @nullable
- */
- team_id?: number | null
- /** Optional client hint (e.g. posthog_code) for return routing after OAuth. */
- connect_from?: string
-}
-
-export interface UserGitHubLinkStartResponseApi {
- /** URL to open in the browser to install or authorize the GitHub App for this user. */
- install_url: string
- /** OAuth or install flow used for this GitHub connection. */
- connect_flow: string
-}
-
export type RoleExternalReferencesListParams = {
/**
* Number of results to return per page.
@@ -595,55 +531,3 @@ export type IntegrationsGithubTeamsRetrieveParams = {
*/
search?: string
}
-
-export type UsersIntegrationsListParams = {
- /**
- * Number of results to return per page.
- */
- limit?: number
- /**
- * The initial index from which to return the results.
- */
- offset?: number
-}
-
-export type UsersIntegrationsGithubBranchesRetrieveParams = {
- /**
- * Maximum number of branches to return
- * @minimum 1
- * @maximum 1000
- */
- limit?: number
- /**
- * Number of branches to skip
- * @minimum 0
- */
- offset?: number
- /**
- * Repository in owner/repo format
- * @minLength 1
- */
- repo: string
- /**
- * Optional case-insensitive branch name search query.
- */
- search?: string
-}
-
-export type UsersIntegrationsGithubReposRetrieveParams = {
- /**
- * Maximum number of repositories to return per request (max 500).
- * @minimum 1
- * @maximum 500
- */
- limit?: number
- /**
- * Number of repositories to skip before returning results.
- * @minimum 0
- */
- offset?: number
- /**
- * Optional case-insensitive repository name search query.
- */
- search?: string
-}
diff --git a/products/integrations/frontend/generated/api.ts b/products/integrations/frontend/generated/api.ts
index 4315496b9c11..d02ef668fedd 100644
--- a/products/integrations/frontend/generated/api.ts
+++ b/products/integrations/frontend/generated/api.ts
@@ -22,7 +22,6 @@ import type {
OrganizationIntegrationApi,
PaginatedIntegrationConfigListApi,
PaginatedRoleExternalReferenceListApi,
- PaginatedUserGitHubIntegrationListResponseListApi,
PatchedIntegrationConfigApi,
PatchedOrganizationIntegrationApi,
RoleExternalReferenceApi,
@@ -30,11 +29,6 @@ import type {
RoleExternalReferencesLookupRetrieveParams,
RoleLookupResponseApi,
SlackChannelsResponseApi,
- UserGitHubLinkStartRequestApi,
- UserGitHubLinkStartResponseApi,
- UsersIntegrationsGithubBranchesRetrieveParams,
- UsersIntegrationsGithubReposRetrieveParams,
- UsersIntegrationsListParams,
} from './api.schemas'
// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
@@ -706,192 +700,3 @@ export const integrationsGithubOauthAuthorizeCreate = async (
body: JSON.stringify(integrationConfigApi),
})
}
-
-export const getUsersIntegrationsListUrl = (uuid: string, params?: UsersIntegrationsListParams) => {
- const normalizedParams = new URLSearchParams()
-
- Object.entries(params || {}).forEach(([key, value]) => {
- if (value !== undefined) {
- normalizedParams.append(key, value === null ? 'null' : value.toString())
- }
- })
-
- const stringifiedParams = normalizedParams.toString()
-
- return stringifiedParams.length > 0
- ? `/api/users/${uuid}/integrations/?${stringifiedParams}`
- : `/api/users/${uuid}/integrations/`
-}
-
-/**
- * `/api/users/@me/integrations/` — manage the user's personal GitHub integrations.
- * @summary List personal GitHub integrations
- */
-export const usersIntegrationsList = async (
- uuid: string,
- params?: UsersIntegrationsListParams,
- options?: RequestInit
-): Promise<PaginatedUserGitHubIntegrationListResponseListApi> => {
- return apiMutator<PaginatedUserGitHubIntegrationListResponseListApi>(getUsersIntegrationsListUrl(uuid, params), {
- ...options,
- method: 'GET',
- })
-}
-
-export const getUsersIntegrationsGithubDestroyUrl = (uuid: string, installationId: string) => {
- return `/api/users/${uuid}/integrations/github/${installationId}/`
-}
-
-/**
- * Remove a specific GitHub installation by its installation_id.
- * @summary Disconnect a personal GitHub integration
- */
-export const usersIntegrationsGithubDestroy = async (
- uuid: string,
- installationId: string,
- options?: RequestInit
-): Promise<void> => {
- return apiMutator<void>(getUsersIntegrationsGithubDestroyUrl(uuid, installationId), {
- ...options,
- method: 'DELETE',
- })
-}
-
-export const getUsersIntegrationsGithubBranchesRetrieveUrl = (
- uuid: string,
- installationId: string,
- params: UsersIntegrationsGithubBranchesRetrieveParams
-) => {
- const normalizedParams = new URLSearchParams()
-
- Object.entries(params || {}).forEach(([key, value]) => {
- if (value !== undefined) {
- normalizedParams.append(key, value === null ? 'null' : value.toString())
- }
- })
-
- const stringifiedParams = normalizedParams.toString()
-
- return stringifiedParams.length > 0
- ? `/api/users/${uuid}/integrations/github/${installationId}/branches/?${stringifiedParams}`
- : `/api/users/${uuid}/integrations/github/${installationId}/branches/`
-}
-
-/**
- * List branches for a repository accessible to a personal GitHub installation.
- * @summary List branches for a personal GitHub installation repository
- */
-export const usersIntegrationsGithubBranchesRetrieve = async (
- uuid: string,
- installationId: string,
- params: UsersIntegrationsGithubBranchesRetrieveParams,
- options?: RequestInit
-): Promise<GitHubBranchesResponseApi> => {
- return apiMutator<GitHubBranchesResponseApi>(
- getUsersIntegrationsGithubBranchesRetrieveUrl(uuid, installationId, params),
- {
- ...options,
- method: 'GET',
- }
- )
-}
-
-export const getUsersIntegrationsGithubReposRetrieveUrl = (
- uuid: string,
- installationId: string,
- params?: UsersIntegrationsGithubReposRetrieveParams
-) => {
- const normalizedParams = new URLSearchParams()
-
- Object.entries(params || {}).forEach(([key, value]) => {
- if (value !== undefined) {
- normalizedParams.append(key, value === null ? 'null' : value.toString())
- }
- })
-
- const stringifiedParams = normalizedParams.toString()
-
- return stringifiedParams.length > 0
- ? `/api/users/${uuid}/integrations/github/${installationId}/repos/?${stringifiedParams}`
- : `/api/users/${uuid}/integrations/github/${installationId}/repos/`
-}
-
-/**
- * List repositories accessible to a specific GitHub installation (paginated, cached).
- * @summary List repositories for a personal GitHub installation
- */
-export const usersIntegrationsGithubReposRetrieve = async (
- uuid: string,
- installationId: string,
- params?: UsersIntegrationsGithubReposRetrieveParams,
- options?: RequestInit
-): Promise<GitHubReposResponseApi> => {
- return apiMutator<GitHubReposResponseApi>(
- getUsersIntegrationsGithubReposRetrieveUrl(uuid, installationId, params),
- {
- ...options,
- method: 'GET',
- }
- )
-}
-
-export const getUsersIntegrationsGithubReposRefreshCreateUrl = (uuid: string, installationId: string) => {
- return `/api/users/${uuid}/integrations/github/${installationId}/repos/refresh/`
-}
-
-/**
- * Refresh repositories accessible to a specific GitHub installation.
- * @summary Refresh repositories for a personal GitHub installation
- */
-export const usersIntegrationsGithubReposRefreshCreate = async (
- uuid: string,
- installationId: string,
- options?: RequestInit
-): Promise<GitHubReposRefreshResponseApi> => {
- return apiMutator<GitHubReposRefreshResponseApi>(
- getUsersIntegrationsGithubReposRefreshCreateUrl(uuid, installationId),
- {
- ...options,
- method: 'POST',
- }
- )
-}
-
-export const getUsersIntegrationsGithubStartCreateUrl = (uuid: string) => {
- return `/api/users/${uuid}/integrations/github/start/`
-}
-
-/**
- * Start GitHub linking: either full App install or OAuth-only (user-to-server).
-
-``**_kwargs`` absorbs ``parent_lookup_uuid`` from the nested
-``/api/users/{uuid}/integrations/`` router (same pattern as ``local_evaluation``
-under projects).
-
-Usually returns ``install_url`` pointing at ``/installations/new`` so the
-user can pick any GitHub org (new or already connected). GitHub's install
-page handles both cases: orgs where the app is installed show "Configure"
-(no admin needed), orgs where it isn't show "Install" (needs admin).
-
-**OAuth fast path:** when the current project already has a team-level
-GitHub installation, and the user has no ``UserIntegration`` for that
-installation yet, we skip the org picker and redirect straight to
-``/login/oauth/authorize`` so the user only authorizes themselves.
-``connect_from`` is preserved for first-party clients so they return to
-the originating client immediately.
-
-In both cases the response key is ``install_url`` for compatibility with callers.
- * @summary Start GitHub personal integration linking
- */
-export const usersIntegrationsGithubStartCreate = async (
- uuid: string,
- userGitHubLinkStartRequestApi?: UserGitHubLinkStartRequestApi,
- options?: RequestInit
-): Promise<UserGitHubLinkStartResponseApi> => {
- return apiMutator<UserGitHubLinkStartResponseApi>(getUsersIntegrationsGithubStartCreateUrl(uuid), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(userGitHubLinkStartRequestApi),
- })
-}
diff --git a/products/integrations/frontend/generated/api.zod.ts b/products/integrations/frontend/generated/api.zod.ts
index 81e90e4b8814..fdc8d7908c2c 100644
--- a/products/integrations/frontend/generated/api.zod.ts
+++ b/products/integrations/frontend/generated/api.zod.ts
@@ -353,36 +353,3 @@ export const IntegrationsGithubOauthAuthorizeCreateBody = /* @__PURE__ */ zod
config: zod.unknown().optional(),
})
.describe('Standard Integration serializer.')
-
-/**
- * Start GitHub linking: either full App install or OAuth-only (user-to-server).
-
-``**_kwargs`` absorbs ``parent_lookup_uuid`` from the nested
-``/api/users/{uuid}/integrations/`` router (same pattern as ``local_evaluation``
-under projects).
-
-Usually returns ``install_url`` pointing at ``/installations/new`` so the
-user can pick any GitHub org (new or already connected). GitHub's install
-page handles both cases: orgs where the app is installed show "Configure"
-(no admin needed), orgs where it isn't show "Install" (needs admin).
-
-**OAuth fast path:** when the current project already has a team-level
-GitHub installation, and the user has no ``UserIntegration`` for that
-installation yet, we skip the org picker and redirect straight to
-``/login/oauth/authorize`` so the user only authorizes themselves.
-``connect_from`` is preserved for first-party clients so they return to
-the originating client immediately.
-
-In both cases the response key is ``install_url`` for compatibility with callers.
- * @summary Start GitHub personal integration linking
- */
-export const UsersIntegrationsGithubStartCreateBody = /* @__PURE__ */ zod.object({
- team_id: zod
- .number()
- .nullish()
- .describe("Optional team\/project id (e.g. PostHog Code); web UI uses the session's current team."),
- connect_from: zod
- .string()
- .optional()
- .describe('Optional client hint (e.g. posthog_code) for return routing after OAuth.'),
-})
diff --git a/products/legal_documents/backend/presentation/views.py b/products/legal_documents/backend/presentation/views.py
index c34de4cd45c2..286bae9193db 100644
--- a/products/legal_documents/backend/presentation/views.py
+++ b/products/legal_documents/backend/presentation/views.py
@@ -18,7 +18,6 @@ from .permissions import IsCloudOrDevDeployment, IsOrganizationAdminOrOwner
from .serializers import CreateLegalDocumentSerializer, LegalDocumentSerializer
-@extend_schema(tags=["core"])
class LegalDocumentViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
scope_object = "legal_document"
permission_classes = [IsCloudOrDevDeployment, permissions.IsAuthenticated, IsOrganizationAdminOrOwner]
diff --git a/products/links/backend/api.py b/products/links/backend/api.py
index ab1ee683ad45..5bd30e237be8 100644
--- a/products/links/backend/api.py
+++ b/products/links/backend/api.py
@@ -3,14 +3,11 @@ from typing import Any
from django.db.models import QuerySet
import structlog
-from drf_spectacular.utils import extend_schema
from rest_framework import serializers, viewsets
from rest_framework.permissions import IsAuthenticated
from rest_framework.request import Request
from rest_framework.response import Response
-from posthog.schema import ProductKey
-
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.shared import UserBasicSerializer
from posthog.models.team.team import Team
@@ -56,7 +53,6 @@ class LinkSerializer(serializers.ModelSerializer):
return link
-@extend_schema(tags=[ProductKey.LINKS])
class LinkViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
"""
Create, read, update, and delete links.
diff --git a/products/live_debugger/frontend/generated/api.schemas.ts b/products/live_debugger/frontend/generated/api.schemas.ts
index 4b4e47ac8aac..540a08f48967 100644
--- a/products/live_debugger/frontend/generated/api.schemas.ts
+++ b/products/live_debugger/frontend/generated/api.schemas.ts
@@ -33,6 +33,23 @@ export interface PaginatedLiveDebuggerBreakpointListApi {
results: LiveDebuggerBreakpointApi[]
}
+export interface PatchedLiveDebuggerBreakpointApi {
+ readonly id?: string
+ /** @nullable */
+ repository?: string | null
+ filename?: string
+ /**
+ * @minimum 0
+ * @maximum 2147483647
+ */
+ line_number?: number
+ enabled?: boolean
+ /** @nullable */
+ condition?: string | null
+ readonly created_at?: string
+ readonly updated_at?: string
+}
+
/**
* Schema for a single active breakpoint
*/
diff --git a/products/live_debugger/frontend/generated/api.ts b/products/live_debugger/frontend/generated/api.ts
index 971eb2c20c90..f70b2e61a4dd 100644
--- a/products/live_debugger/frontend/generated/api.ts
+++ b/products/live_debugger/frontend/generated/api.ts
@@ -16,6 +16,7 @@ import type {
LiveDebuggerBreakpointsBreakpointHitsRetrieveParams,
LiveDebuggerBreakpointsListParams,
PaginatedLiveDebuggerBreakpointListApi,
+ PatchedLiveDebuggerBreakpointApi,
} from './api.schemas'
// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
@@ -85,6 +86,84 @@ export const liveDebuggerBreakpointsCreate = async (
})
}
+export const getLiveDebuggerBreakpointsRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/live_debugger_breakpoints/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete breakpoints for live debugging.
+ */
+export const liveDebuggerBreakpointsRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<LiveDebuggerBreakpointApi> => {
+ return apiMutator<LiveDebuggerBreakpointApi>(getLiveDebuggerBreakpointsRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getLiveDebuggerBreakpointsUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/live_debugger_breakpoints/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete breakpoints for live debugging.
+ */
+export const liveDebuggerBreakpointsUpdate = async (
+ projectId: string,
+ id: string,
+ liveDebuggerBreakpointApi: NonReadonly<LiveDebuggerBreakpointApi>,
+ options?: RequestInit
+): Promise<LiveDebuggerBreakpointApi> => {
+ return apiMutator<LiveDebuggerBreakpointApi>(getLiveDebuggerBreakpointsUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(liveDebuggerBreakpointApi),
+ })
+}
+
+export const getLiveDebuggerBreakpointsPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/live_debugger_breakpoints/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete breakpoints for live debugging.
+ */
+export const liveDebuggerBreakpointsPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedLiveDebuggerBreakpointApi?: NonReadonly<PatchedLiveDebuggerBreakpointApi>,
+ options?: RequestInit
+): Promise<LiveDebuggerBreakpointApi> => {
+ return apiMutator<LiveDebuggerBreakpointApi>(getLiveDebuggerBreakpointsPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedLiveDebuggerBreakpointApi),
+ })
+}
+
+export const getLiveDebuggerBreakpointsDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/live_debugger_breakpoints/${id}/`
+}
+
+/**
+ * Create, Read, Update and Delete breakpoints for live debugging.
+ */
+export const liveDebuggerBreakpointsDestroy = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getLiveDebuggerBreakpointsDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getLiveDebuggerBreakpointsActiveRetrieveUrl = (
projectId: string,
params?: LiveDebuggerBreakpointsActiveRetrieveParams
diff --git a/products/live_debugger/frontend/generated/api.zod.ts b/products/live_debugger/frontend/generated/api.zod.ts
index d86be1706c5b..a6ed6dd94108 100644
--- a/products/live_debugger/frontend/generated/api.zod.ts
+++ b/products/live_debugger/frontend/generated/api.zod.ts
@@ -25,3 +25,38 @@ export const LiveDebuggerBreakpointsCreateBody = /* @__PURE__ */ zod.object({
enabled: zod.boolean().optional(),
condition: zod.string().nullish(),
})
+
+/**
+ * Create, Read, Update and Delete breakpoints for live debugging.
+ */
+export const liveDebuggerBreakpointsUpdateBodyLineNumberMin = 0
+export const liveDebuggerBreakpointsUpdateBodyLineNumberMax = 2147483647
+
+export const LiveDebuggerBreakpointsUpdateBody = /* @__PURE__ */ zod.object({
+ repository: zod.string().nullish(),
+ filename: zod.string(),
+ line_number: zod
+ .number()
+ .min(liveDebuggerBreakpointsUpdateBodyLineNumberMin)
+ .max(liveDebuggerBreakpointsUpdateBodyLineNumberMax),
+ enabled: zod.boolean().optional(),
+ condition: zod.string().nullish(),
+})
+
+/**
+ * Create, Read, Update and Delete breakpoints for live debugging.
+ */
+export const liveDebuggerBreakpointsPartialUpdateBodyLineNumberMin = 0
+export const liveDebuggerBreakpointsPartialUpdateBodyLineNumberMax = 2147483647
+
+export const LiveDebuggerBreakpointsPartialUpdateBody = /* @__PURE__ */ zod.object({
+ repository: zod.string().nullish(),
+ filename: zod.string().optional(),
+ line_number: zod
+ .number()
+ .min(liveDebuggerBreakpointsPartialUpdateBodyLineNumberMin)
+ .max(liveDebuggerBreakpointsPartialUpdateBodyLineNumberMax)
+ .optional(),
+ enabled: zod.boolean().optional(),
+ condition: zod.string().nullish(),
+})
diff --git a/products/logs/backend/alerts_api.py b/products/logs/backend/alerts_api.py
index c16aa20aa54a..5b2d97ff1a77 100644
--- a/products/logs/backend/alerts_api.py
+++ b/products/logs/backend/alerts_api.py
@@ -786,7 +786,6 @@ def _fill_empty_buckets(
return result
-@extend_schema(tags=["logs"])
class LogsAlertViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "logs"
queryset = LogsAlertConfiguration.objects.all().order_by("-created_at")
diff --git a/products/logs/backend/api.py b/products/logs/backend/api.py
index 5e924caf4be5..7ce25aa35deb 100644
--- a/products/logs/backend/api.py
+++ b/products/logs/backend/api.py
@@ -596,7 +596,6 @@ class _LogsValuesResponseSerializer(serializers.Serializer):
)
-@extend_schema(tags=["logs"])
class LogsViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet):
scope_object = "logs"
serializer_class = _FallbackSerializer
diff --git a/products/logs/backend/sampling_api.py b/products/logs/backend/sampling_api.py
index 1080fb90e1a5..98db0539a76e 100644
--- a/products/logs/backend/sampling_api.py
+++ b/products/logs/backend/sampling_api.py
@@ -288,7 +288,6 @@ class LogsSamplingRuleSimulateResponseSerializer(serializers.Serializer):
notes = serializers.CharField(help_text="Human-readable caveats for the estimate.")
-@extend_schema(tags=["logs"])
class LogsSamplingRuleViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "logs"
queryset = LogsExclusionRule.objects.all().order_by("priority", "created_at")
diff --git a/products/logs/backend/views_api.py b/products/logs/backend/views_api.py
index 6855be033c33..3cab77d90c9a 100644
--- a/products/logs/backend/views_api.py
+++ b/products/logs/backend/views_api.py
@@ -1,6 +1,5 @@
from typing import Any
-from drf_spectacular.utils import extend_schema
from rest_framework import serializers, viewsets
from posthog.api.routing import TeamAndOrgViewSetMixin
@@ -45,7 +44,6 @@ class LogsViewSerializer(serializers.ModelSerializer):
return super().create(validated_data)
-@extend_schema(tags=["logs"])
class LogsViewViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "logs"
queryset = LogsView.objects.all().order_by("-created_at")
diff --git a/products/logs/frontend/generated/api.ts b/products/logs/frontend/generated/api.ts
index dc49851be821..096004b8dad3 100644
--- a/products/logs/frontend/generated/api.ts
+++ b/products/logs/frontend/generated/api.ts
@@ -67,21 +67,6 @@ type NonReadonly<T> = [T] extends [UnionToIntersection<T>]
}
: DistributeReadOnlyOverUnions<T>
-export const getDomainsScimLogsRetrieveUrl = (organizationId: string, id: string) => {
- return `/api/organizations/${organizationId}/domains/${id}/scim/logs/`
-}
-
-export const domainsScimLogsRetrieve = async (
- organizationId: string,
- id: string,
- options?: RequestInit
-): Promise<void> => {
- return apiMutator<void>(getDomainsScimLogsRetrieveUrl(organizationId, id), {
- ...options,
- method: 'GET',
- })
-}
-
export const getLogsAlertsListUrl = (projectId: string, params?: LogsAlertsListParams) => {
const normalizedParams = new URLSearchParams()
diff --git a/products/mcp_analytics/backend/presentation/views.py b/products/mcp_analytics/backend/presentation/views.py
index 9f1598bbccba..97eb15bf62df 100644
--- a/products/mcp_analytics/backend/presentation/views.py
+++ b/products/mcp_analytics/backend/presentation/views.py
@@ -63,7 +63,6 @@ class MCPSessionPagination(LimitOffsetPagination):
}
-@extend_schema(tags=["mcp_analytics"])
class BaseMCPAnalyticsSubmissionViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
serializer_class = MCPAnalyticsSubmissionSerializer
# Keep these endpoints staff-only until the MCP tools and auth model are ready for customer traffic.
@@ -138,7 +137,6 @@ class MCPFeedbackViewSet(BaseMCPAnalyticsSubmissionViewSet):
return self._list_response(request, enums.SubmissionKind.FEEDBACK)
-@extend_schema(tags=["mcp_analytics"])
class MCPSessionViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
serializer_class = MCPSessionSerializer
permission_classes = [IsAuthenticated, SingleTenancyOrAdmin]
@@ -227,7 +225,6 @@ class MCPSessionViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
return Response(serializer.data)
-@extend_schema(tags=["mcp_analytics"])
class MCPIntentClusterViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
serializer_class = MCPIntentClusterSnapshotSerializer
permission_classes = [IsAuthenticated, SingleTenancyOrAdmin]
diff --git a/products/mcp_store/backend/presentation/views.py b/products/mcp_store/backend/presentation/views.py
index d930963ef058..1ea1b9f9584e 100644
--- a/products/mcp_store/backend/presentation/views.py
+++ b/products/mcp_store/backend/presentation/views.py
@@ -151,7 +151,6 @@ class MCPServerTemplateSerializer(serializers.ModelSerializer):
fields = ["id", "name", "url", "docs_url", "description", "auth_type", "icon_key", "category"]
-@extend_schema(tags=["mcp_store"])
class MCPServerViewSet(TeamAndOrgViewSetMixin, mixins.ListModelMixin, viewsets.GenericViewSet):
"""Lists curated MCP server templates that users can install with one click.
@@ -337,7 +336,6 @@ class ToolApprovalUpdateSerializer(serializers.Serializer):
approval_state = serializers.ChoiceField(choices=["approved", "needs_approval", "do_not_use"])
-@extend_schema(tags=["mcp_store"])
class MCPServerInstallationViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "project"
scope_object_read_actions = ["list", "retrieve", "authorize", "list_tools"]
@@ -1189,7 +1187,6 @@ def _installation_name(installation: MCPServerInstallation) -> str:
return installation.url
-@extend_schema(tags=["mcp_store"])
class MCPOAuthRedirectViewSet(viewsets.ViewSet):
"""Team-agnostic public OAuth callback endpoint.
diff --git a/products/messaging/frontend/generated/api.schemas.ts b/products/messaging/frontend/generated/api.schemas.ts
index a6589bb7bb3d..a1de89a48716 100644
--- a/products/messaging/frontend/generated/api.schemas.ts
+++ b/products/messaging/frontend/generated/api.schemas.ts
@@ -43,6 +43,22 @@ export interface PaginatedMessageCategoryListApi {
results: MessageCategoryApi[]
}
+export interface PatchedMessageCategoryApi {
+ readonly id?: string
+ /** @maxLength 64 */
+ key?: string
+ /** @maxLength 128 */
+ name?: string
+ description?: string
+ public_description?: string
+ category_type?: CategoryTypeEnumApi
+ readonly created_at?: string
+ readonly updated_at?: string
+ /** @nullable */
+ readonly created_by?: number | null
+ deleted?: boolean
+}
+
export interface AddOptOutRequestApi {
/**
* The recipient identifier to opt out (e.g. email address).
@@ -167,6 +183,22 @@ export interface PaginatedMessageTemplateListApi {
results: MessageTemplateApi[]
}
+export interface PatchedMessageTemplateApi {
+ readonly id?: string
+ /** @maxLength 400 */
+ name?: string
+ description?: string
+ readonly created_at?: string
+ readonly updated_at?: string
+ content?: MessageTemplateContentApi
+ readonly created_by?: UserBasicApi
+ /** @maxLength 24 */
+ type?: string
+ /** @nullable */
+ message_category?: string | null
+ deleted?: boolean
+}
+
export type MessagingCategoriesListParams = {
/**
* Number of results to return per page.
diff --git a/products/messaging/frontend/generated/api.ts b/products/messaging/frontend/generated/api.ts
index 7d6ef8a7a125..d20dd792be3c 100644
--- a/products/messaging/frontend/generated/api.ts
+++ b/products/messaging/frontend/generated/api.ts
@@ -17,6 +17,8 @@ import type {
MessagingTemplatesListParams,
PaginatedMessageCategoryListApi,
PaginatedMessageTemplateListApi,
+ PatchedMessageCategoryApi,
+ PatchedMessageTemplateApi,
} from './api.schemas'
// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
@@ -80,6 +82,75 @@ export const messagingCategoriesCreate = async (
})
}
+export const getMessagingCategoriesRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/messaging_categories/${id}/`
+}
+
+export const messagingCategoriesRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<MessageCategoryApi> => {
+ return apiMutator<MessageCategoryApi>(getMessagingCategoriesRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getMessagingCategoriesUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/messaging_categories/${id}/`
+}
+
+export const messagingCategoriesUpdate = async (
+ projectId: string,
+ id: string,
+ messageCategoryApi: NonReadonly<MessageCategoryApi>,
+ options?: RequestInit
+): Promise<MessageCategoryApi> => {
+ return apiMutator<MessageCategoryApi>(getMessagingCategoriesUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(messageCategoryApi),
+ })
+}
+
+export const getMessagingCategoriesPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/messaging_categories/${id}/`
+}
+
+export const messagingCategoriesPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedMessageCategoryApi?: NonReadonly<PatchedMessageCategoryApi>,
+ options?: RequestInit
+): Promise<MessageCategoryApi> => {
+ return apiMutator<MessageCategoryApi>(getMessagingCategoriesPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedMessageCategoryApi),
+ })
+}
+
+export const getMessagingCategoriesDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/messaging_categories/${id}/`
+}
+
+/**
+ * Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
+ */
+export const messagingCategoriesDestroy = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<unknown> => {
+ return apiMutator<unknown>(getMessagingCategoriesDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getMessagingCategoriesImportFromCustomerioCreateUrl = (projectId: string) => {
return `/api/projects/${projectId}/messaging_categories/import_from_customerio/`
}
@@ -369,3 +440,72 @@ export const messagingTemplatesCreate = async (
body: JSON.stringify(messageTemplateApi),
})
}
+
+export const getMessagingTemplatesRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/messaging_templates/${id}/`
+}
+
+export const messagingTemplatesRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<MessageTemplateApi> => {
+ return apiMutator<MessageTemplateApi>(getMessagingTemplatesRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getMessagingTemplatesUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/messaging_templates/${id}/`
+}
+
+export const messagingTemplatesUpdate = async (
+ projectId: string,
+ id: string,
+ messageTemplateApi: NonReadonly<MessageTemplateApi>,
+ options?: RequestInit
+): Promise<MessageTemplateApi> => {
+ return apiMutator<MessageTemplateApi>(getMessagingTemplatesUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(messageTemplateApi),
+ })
+}
+
+export const getMessagingTemplatesPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/messaging_templates/${id}/`
+}
+
+export const messagingTemplatesPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedMessageTemplateApi?: NonReadonly<PatchedMessageTemplateApi>,
+ options?: RequestInit
+): Promise<MessageTemplateApi> => {
+ return apiMutator<MessageTemplateApi>(getMessagingTemplatesPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedMessageTemplateApi),
+ })
+}
+
+export const getMessagingTemplatesDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/messaging_templates/${id}/`
+}
+
+/**
+ * Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
+ */
+export const messagingTemplatesDestroy = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<unknown> => {
+ return apiMutator<unknown>(getMessagingTemplatesDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
diff --git a/products/messaging/frontend/generated/api.zod.ts b/products/messaging/frontend/generated/api.zod.ts
index f4f7954d638e..a3f976ec7ecd 100644
--- a/products/messaging/frontend/generated/api.zod.ts
+++ b/products/messaging/frontend/generated/api.zod.ts
@@ -25,6 +25,38 @@ export const MessagingCategoriesCreateBody = /* @__PURE__ */ zod.object({
deleted: zod.boolean().optional(),
})
+export const messagingCategoriesUpdateBodyKeyMax = 64
+
+export const messagingCategoriesUpdateBodyNameMax = 128
+
+export const MessagingCategoriesUpdateBody = /* @__PURE__ */ zod.object({
+ key: zod.string().max(messagingCategoriesUpdateBodyKeyMax),
+ name: zod.string().max(messagingCategoriesUpdateBodyNameMax),
+ description: zod.string().optional(),
+ public_description: zod.string().optional(),
+ category_type: zod
+ .enum(['marketing', 'transactional'])
+ .optional()
+ .describe('\* `marketing` - Marketing\n\* `transactional` - Transactional'),
+ deleted: zod.boolean().optional(),
+})
+
+export const messagingCategoriesPartialUpdateBodyKeyMax = 64
+
+export const messagingCategoriesPartialUpdateBodyNameMax = 128
+
+export const MessagingCategoriesPartialUpdateBody = /* @__PURE__ */ zod.object({
+ key: zod.string().max(messagingCategoriesPartialUpdateBodyKeyMax).optional(),
+ name: zod.string().max(messagingCategoriesPartialUpdateBodyNameMax).optional(),
+ description: zod.string().optional(),
+ public_description: zod.string().optional(),
+ category_type: zod
+ .enum(['marketing', 'transactional'])
+ .optional()
+ .describe('\* `marketing` - Marketing\n\* `transactional` - Transactional'),
+ deleted: zod.boolean().optional(),
+})
+
/**
* Import subscription topics and globally unsubscribed users from Customer.io API.
Persists the App API key in Integration(kind="customerio-app").
@@ -158,3 +190,59 @@ export const MessagingTemplatesCreateBody = /* @__PURE__ */ zod.object({
message_category: zod.uuid().nullish(),
deleted: zod.boolean().optional(),
})
+
+export const messagingTemplatesUpdateBodyNameMax = 400
+
+export const messagingTemplatesUpdateBodyTypeMax = 24
+
+export const MessagingTemplatesUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(messagingTemplatesUpdateBodyNameMax),
+ description: zod.string().optional(),
+ content: zod
+ .object({
+ templating: zod.enum(['hog', 'liquid']).optional().describe('\* `hog` - hog\n\* `liquid` - liquid'),
+ email: zod
+ .union([
+ zod.object({
+ subject: zod.string().optional(),
+ text: zod.string().optional(),
+ html: zod.string().optional(),
+ design: zod.unknown().optional(),
+ }),
+ zod.null(),
+ ])
+ .optional(),
+ })
+ .optional(),
+ type: zod.string().max(messagingTemplatesUpdateBodyTypeMax).optional(),
+ message_category: zod.uuid().nullish(),
+ deleted: zod.boolean().optional(),
+})
+
+export const messagingTemplatesPartialUpdateBodyNameMax = 400
+
+export const messagingTemplatesPartialUpdateBodyTypeMax = 24
+
+export const MessagingTemplatesPartialUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(messagingTemplatesPartialUpdateBodyNameMax).optional(),
+ description: zod.string().optional(),
+ content: zod
+ .object({
+ templating: zod.enum(['hog', 'liquid']).optional().describe('\* `hog` - hog\n\* `liquid` - liquid'),
+ email: zod
+ .union([
+ zod.object({
+ subject: zod.string().optional(),
+ text: zod.string().optional(),
+ html: zod.string().optional(),
+ design: zod.unknown().optional(),
+ }),
+ zod.null(),
+ ])
+ .optional(),
+ })
+ .optional(),
+ type: zod.string().max(messagingTemplatesPartialUpdateBodyTypeMax).optional(),
+ message_category: zod.uuid().nullish(),
+ deleted: zod.boolean().optional(),
+})
diff --git a/products/notebooks/frontend/generated/api.schemas.ts b/products/notebooks/frontend/generated/api.schemas.ts
index f36791c14249..41531e1bb251 100644
--- a/products/notebooks/frontend/generated/api.schemas.ts
+++ b/products/notebooks/frontend/generated/api.schemas.ts
@@ -147,28 +147,6 @@ export interface NotebookApi {
_create_in_folder?: string
}
-export interface SharePasswordApi {
- readonly id: number
- readonly created_at: string
- /**
- * @maxLength 100
- * @nullable
- */
- note?: string | null
- readonly created_by_email: string
- readonly is_active: boolean
-}
-
-export interface SharingConfigurationApi {
- readonly created_at: string
- enabled?: boolean
- /** @nullable */
- readonly access_token: string | null
- settings?: unknown
- password_required?: boolean
- readonly share_passwords: readonly SharePasswordApi[]
-}
-
/**
* Parent resource this notebook is attached to, or `null`. Returns `{type: 'account', id: <uuid>}` for account-linked notebooks; used by the frontend to route breadcrumbs back to the resource's list.
* @nullable
diff --git a/products/notebooks/frontend/generated/api.ts b/products/notebooks/frontend/generated/api.ts
index 8b49f4fb8959..0aec5faae169 100644
--- a/products/notebooks/frontend/generated/api.ts
+++ b/products/notebooks/frontend/generated/api.ts
@@ -14,7 +14,6 @@ import type {
NotebooksListParams,
PaginatedNotebookMinimalListApi,
PatchedNotebookApi,
- SharingConfigurationApi,
} from './api.schemas'
// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
@@ -84,79 +83,6 @@ export const notebooksCreate = async (
})
}
-export const getNotebooksSharingListUrl = (projectId: string, notebookId: string) => {
- return `/api/projects/${projectId}/notebooks/${notebookId}/sharing/`
-}
-
-export const notebooksSharingList = async (
- projectId: string,
- notebookId: string,
- options?: RequestInit
-): Promise<SharingConfigurationApi[]> => {
- return apiMutator<SharingConfigurationApi[]>(getNotebooksSharingListUrl(projectId, notebookId), {
- ...options,
- method: 'GET',
- })
-}
-
-export const getNotebooksSharingPasswordsCreateUrl = (projectId: string, notebookId: string) => {
- return `/api/projects/${projectId}/notebooks/${notebookId}/sharing/passwords/`
-}
-
-/**
- * Create a new password for the sharing configuration.
- */
-export const notebooksSharingPasswordsCreate = async (
- projectId: string,
- notebookId: string,
- sharingConfigurationApi?: NonReadonly<SharingConfigurationApi>,
- options?: RequestInit
-): Promise<SharingConfigurationApi> => {
- return apiMutator<SharingConfigurationApi>(getNotebooksSharingPasswordsCreateUrl(projectId, notebookId), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(sharingConfigurationApi),
- })
-}
-
-export const getNotebooksSharingPasswordsDestroyUrl = (projectId: string, notebookId: string, passwordId: string) => {
- return `/api/projects/${projectId}/notebooks/${notebookId}/sharing/passwords/${passwordId}/`
-}
-
-/**
- * Delete a password from the sharing configuration.
- */
-export const notebooksSharingPasswordsDestroy = async (
- projectId: string,
- notebookId: string,
- passwordId: string,
- options?: RequestInit
-): Promise<void> => {
- return apiMutator<void>(getNotebooksSharingPasswordsDestroyUrl(projectId, notebookId, passwordId), {
- ...options,
- method: 'DELETE',
- })
-}
-
-export const getNotebooksSharingRefreshCreateUrl = (projectId: string, notebookId: string) => {
- return `/api/projects/${projectId}/notebooks/${notebookId}/sharing/refresh/`
-}
-
-export const notebooksSharingRefreshCreate = async (
- projectId: string,
- notebookId: string,
- sharingConfigurationApi?: NonReadonly<SharingConfigurationApi>,
- options?: RequestInit
-): Promise<SharingConfigurationApi> => {
- return apiMutator<SharingConfigurationApi>(getNotebooksSharingRefreshCreateUrl(projectId, notebookId), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(sharingConfigurationApi),
- })
-}
-
export const getNotebooksRetrieveUrl = (projectId: string, shortId: string) => {
return `/api/projects/${projectId}/notebooks/${shortId}/`
}
diff --git a/products/notebooks/frontend/generated/api.zod.ts b/products/notebooks/frontend/generated/api.zod.ts
index a86a69a8154f..b6aaf2aa79fe 100644
--- a/products/notebooks/frontend/generated/api.zod.ts
+++ b/products/notebooks/frontend/generated/api.zod.ts
@@ -33,21 +33,6 @@ export const NotebooksCreateBody = /* @__PURE__ */ zod.object({
_create_in_folder: zod.string().optional(),
})
-/**
- * Create a new password for the sharing configuration.
- */
-export const NotebooksSharingPasswordsCreateBody = /* @__PURE__ */ zod.object({
- enabled: zod.boolean().optional(),
- settings: zod.unknown().optional(),
- password_required: zod.boolean().optional(),
-})
-
-export const NotebooksSharingRefreshCreateBody = /* @__PURE__ */ zod.object({
- enabled: zod.boolean().optional(),
- settings: zod.unknown().optional(),
- password_required: zod.boolean().optional(),
-})
-
/**
* The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
*/
diff --git a/products/product_analytics/backend/api/insight.py b/products/product_analytics/backend/api/insight.py
index 0970bfcc209e..fa5b29d99188 100644
--- a/products/product_analytics/backend/api/insight.py
+++ b/products/product_analytics/backend/api/insight.py
@@ -1209,7 +1209,7 @@ class InsightViewedRequestSerializer(serializers.Serializer):
)
-@extend_schema(tags=[ProductKey.PRODUCT_ANALYTICS])
+@extend_schema(extensions={"x-product": ProductKey.PRODUCT_ANALYTICS})
@extend_schema_view(
list=extend_schema(
parameters=[
diff --git a/products/product_analytics/backend/api/insight_variable.py b/products/product_analytics/backend/api/insight_variable.py
index 34d8713fab7b..5d837e18c74e 100644
--- a/products/product_analytics/backend/api/insight_variable.py
+++ b/products/product_analytics/backend/api/insight_variable.py
@@ -60,7 +60,7 @@ class InsightVariablePagination(pagination.PageNumberPagination):
page_size = 500
-@extend_schema(tags=[ProductKey.DATA_WAREHOUSE])
+@extend_schema(extensions={"x-product": ProductKey.DATA_WAREHOUSE})
class InsightVariableViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "insight_variable"
queryset = InsightVariable.objects.all()
diff --git a/products/product_analytics/mcp/tools.yaml b/products/product_analytics/mcp/tools.yaml
index a32c1a642cea..d9f34cd3a531 100644
--- a/products/product_analytics/mcp/tools.yaml
+++ b/products/product_analytics/mcp/tools.yaml
@@ -176,12 +176,6 @@ tools:
- query_status
- hogql
- types
- insight-variables-create:
- operation: insight_variables_create
- enabled: false
- insight-variables-list:
- operation: insight_variables_list
- enabled: false
insights-activity-retrieve:
operation: insights_activity_retrieve
enabled: true
diff --git a/products/replay_vision/backend/api/constants.py b/products/replay_vision/backend/api/constants.py
deleted file mode 100644
index 19295cbe68b4..000000000000
--- a/products/replay_vision/backend/api/constants.py
+++ /dev/null
@@ -1 +0,0 @@
-VISION_TAG = "replay_vision"
diff --git a/products/replay_vision/backend/api/observations.py b/products/replay_vision/backend/api/observations.py
index 4c1b7587637e..97bf69a40fb6 100644
--- a/products/replay_vision/backend/api/observations.py
+++ b/products/replay_vision/backend/api/observations.py
@@ -13,7 +13,6 @@ from rest_framework.exceptions import NotFound, PermissionDenied, ValidationErro
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.shared import UserBasicSerializer
-from products.replay_vision.backend.api.constants import VISION_TAG
from products.replay_vision.backend.feature_flag import ReplayVisionEnabledPermission
from products.replay_vision.backend.models.replay_observation import (
ObservationStatus,
@@ -182,7 +181,6 @@ class ReplayObservationFilter(django_filters.FilterSet):
fields = ["status", "triggered_by", "session_id"]
-@extend_schema(tags=[VISION_TAG])
class ReplayObservationViewSet(
TeamAndOrgViewSetMixin,
mixins.ListModelMixin,
@@ -218,7 +216,6 @@ class ReplayObservationViewSet(
)
-@extend_schema(tags=[VISION_TAG])
@extend_schema_view(
list=extend_schema(
parameters=[
diff --git a/products/replay_vision/backend/api/quota.py b/products/replay_vision/backend/api/quota.py
index 7fa0c90cbe07..483a33d4b06c 100644
--- a/products/replay_vision/backend/api/quota.py
+++ b/products/replay_vision/backend/api/quota.py
@@ -8,7 +8,6 @@ from rest_framework.response import Response
from posthog.api.routing import TeamAndOrgViewSetMixin
-from products.replay_vision.backend.api.constants import VISION_TAG
from products.replay_vision.backend.feature_flag import ReplayVisionEnabledPermission
from products.replay_vision.backend.quota import compute_quota_snapshot
@@ -42,7 +41,6 @@ class VisionQuotaSerializer(serializers.Serializer):
)
-@extend_schema(tags=[VISION_TAG])
class VisionQuotaViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
scope_object = "replay_scanner"
# Custom viewsets must declare scopes or personal-API-key callers 403 silently.
diff --git a/products/replay_vision/backend/api/scanners.py b/products/replay_vision/backend/api/scanners.py
index 6069438fcdba..1053cfbb5797 100644
--- a/products/replay_vision/backend/api/scanners.py
+++ b/products/replay_vision/backend/api/scanners.py
@@ -26,7 +26,6 @@ from posthog.exceptions import QuotaLimitExceeded
from posthog.models.user import User
from posthog.temporal.common.client import sync_connect
-from products.replay_vision.backend.api.constants import VISION_TAG
from products.replay_vision.backend.feature_flag import ReplayVisionEnabledPermission
from products.replay_vision.backend.models.replay_observation import ObservationTrigger
from products.replay_vision.backend.models.replay_scanner import (
@@ -314,7 +313,6 @@ class EstimateResponseSerializer(serializers.Serializer):
)
-@extend_schema(tags=[VISION_TAG])
class ReplayScannerViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
"""CRUD for Replay Vision scanners."""
diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
index 4b64aacc75d8..1cf47ceb15b1 100644
--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts
@@ -14,8 +14,8 @@ describe('replayScannerLogic', () => {
beforeEach(() => {
useMocks({
get: {
- '/api/environments/:team/vision/scanners/:id/': () => [404, {}],
- '/api/environments/:team/vision/scanners/:id/observations/': { results: [] },
+ '/api/projects/:team/vision/scanners/:id/': () => [404, {}],
+ '/api/projects/:team/vision/scanners/:id/observations/': { results: [] },
},
})
initKeaTests()
diff --git a/products/replay_vision/frontend/replay_scanners/replayScannersLogic.test.ts b/products/replay_vision/frontend/replay_scanners/replayScannersLogic.test.ts
index e10acbb960e7..f42546e814e3 100644
--- a/products/replay_vision/frontend/replay_scanners/replayScannersLogic.test.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayScannersLogic.test.ts
@@ -48,8 +48,8 @@ describe('replayScannersLogic', () => {
beforeEach(() => {
useMocks({
get: {
- '/api/environments/:team/vision/scanners/': { results: [] },
- '/api/environments/:team/vision/quota/': () => [404, {}],
+ '/api/projects/:team/vision/scanners/': { results: [] },
+ '/api/projects/:team/vision/quota/': () => [404, {}],
},
})
initKeaTests()
diff --git a/products/surveys/backend/api/survey.py b/products/surveys/backend/api/survey.py
index c6c4eb0347eb..c1ad3d3c1136 100644
--- a/products/surveys/backend/api/survey.py
+++ b/products/surveys/backend/api/survey.py
@@ -266,7 +266,6 @@ CONDITION_FIELDS_NOT_APPLICABLE_TO_EXTERNAL_SURVEYS = [
"deviceTypesMatchType",
]
-
if "replica" in settings.DATABASES:
READ_DB_FOR_SURVEYS = "replica"
else:
@@ -1851,7 +1850,6 @@ class SurveySerializerCreateUpdateOnlySchema(SurveySerializerCreateUpdateOnly):
}
-@extend_schema(tags=[ProductKey.SURVEYS])
@extend_schema_view(
create=extend_schema(request=SurveySerializerCreateUpdateOnlySchema),
partial_update=extend_schema(request=SurveySerializerCreateUpdateOnlySchema),
diff --git a/products/tasks/backend/api.py b/products/tasks/backend/api.py
index 3745eb061667..a80bd9f9b79b 100644
--- a/products/tasks/backend/api.py
+++ b/products/tasks/backend/api.py
@@ -317,7 +317,6 @@ def _slack_repo_research_payload(
}
-@extend_schema(tags=["tasks"])
class TaskViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
"""
API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
@@ -2157,6 +2156,7 @@ class TaskRunViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
return response
@extend_schema(
+ extensions={"x-product": "logs"},
responses={
200: OpenApiResponse(description="Log content in JSONL format"),
404: OpenApiResponse(description="Task run not found"),
diff --git a/products/tasks/frontend/generated/api.schemas.ts b/products/tasks/frontend/generated/api.schemas.ts
index d3698d186a5e..e18705a13305 100644
--- a/products/tasks/frontend/generated/api.schemas.ts
+++ b/products/tasks/frontend/generated/api.schemas.ts
@@ -148,6 +148,32 @@ export interface SandboxEnvironmentApi {
readonly updated_at: string
}
+export interface PatchedSandboxEnvironmentApi {
+ readonly id?: string
+ /** @maxLength 255 */
+ name?: string
+ network_access_level?: NetworkAccessLevelEnumApi
+ /** List of allowed domains for custom network access */
+ allowed_domains?: string[]
+ /** Whether to include default trusted domains (GitHub, npm, PyPI) */
+ include_default_domains?: boolean
+ /** List of repositories this environment applies to (format: org/repo) */
+ repositories?: string[]
+ /** Encrypted environment variables (write-only, never returned in responses) */
+ environment_variables?: unknown
+ /** Whether this environment has any environment variables set */
+ readonly has_environment_variables?: boolean
+ /** If true, only the creator can see this environment. Otherwise visible to whole team. */
+ private?: boolean
+ /** If true, this environment is for internal use (e.g. signals pipeline) and should not be exposed to end users. */
+ readonly internal?: boolean
+ /** Computed domain allowlist based on network_access_level and allowed_domains */
+ readonly effective_domains?: readonly string[]
+ readonly created_by?: UserBasicApi
+ readonly created_at?: string
+ readonly updated_at?: string
+}
+
export interface TaskAutomationApi {
readonly id: string
/** @maxLength 255 */
@@ -190,6 +216,39 @@ export interface PaginatedTaskAutomationListApi {
results: TaskAutomationApi[]
}
+export interface PatchedTaskAutomationApi {
+ readonly id?: string
+ /** @maxLength 255 */
+ name?: string
+ prompt?: string
+ /** @maxLength 255 */
+ repository?: string
+ /** @nullable */
+ github_integration?: number | null
+ /** @maxLength 100 */
+ cron_expression?: string
+ /** @maxLength 128 */
+ timezone?: string
+ /**
+ * @maxLength 255
+ * @nullable
+ */
+ template_id?: string | null
+ enabled?: boolean
+ /** @nullable */
+ readonly last_run_at?: string | null
+ /** @nullable */
+ readonly last_run_status?: string | null
+ /** @nullable */
+ readonly last_task_id?: string | null
+ /** @nullable */
+ readonly last_task_run_id?: string | null
+ /** @nullable */
+ readonly last_error?: string | null
+ readonly created_at?: string
+ readonly updated_at?: string
+}
+
/**
* * `error_tracking` - Error Tracking
* `eval_clusters` - Eval Clusters
diff --git a/products/tasks/frontend/generated/api.ts b/products/tasks/frontend/generated/api.ts
index 1ed7344b02f7..36517a1ce8ce 100644
--- a/products/tasks/frontend/generated/api.ts
+++ b/products/tasks/frontend/generated/api.ts
@@ -16,7 +16,9 @@ import type {
PaginatedTaskListApi,
PaginatedTaskRunDetailListApi,
PaginatedTaskSummaryListApi,
+ PatchedSandboxEnvironmentApi,
PatchedTaskApi,
+ PatchedTaskAutomationApi,
PatchedTaskRunSetOutputRequestApi,
PatchedTaskRunUpdateApi,
RepositoryReadinessResponseApi,
@@ -160,6 +162,59 @@ export const sandboxCreate = async (
})
}
+export const getSandboxRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/sandbox_environments/${id}/`
+}
+
+/**
+ * API for managing sandbox environments that control network access for task runs.
+ */
+export const sandboxRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<SandboxEnvironmentApi> => {
+ return apiMutator<SandboxEnvironmentApi>(getSandboxRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getSandboxPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/sandbox_environments/${id}/`
+}
+
+/**
+ * API for managing sandbox environments that control network access for task runs.
+ */
+export const sandboxPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedSandboxEnvironmentApi?: NonReadonly<PatchedSandboxEnvironmentApi>,
+ options?: RequestInit
+): Promise<SandboxEnvironmentApi> => {
+ return apiMutator<SandboxEnvironmentApi>(getSandboxPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedSandboxEnvironmentApi),
+ })
+}
+
+export const getSandboxDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/sandbox_environments/${id}/`
+}
+
+/**
+ * API for managing sandbox environments that control network access for task runs.
+ */
+export const sandboxDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getSandboxDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
export const getTaskAutomationsListUrl = (projectId: string, params?: TaskAutomationsListParams) => {
const normalizedParams = new URLSearchParams()
@@ -204,6 +259,86 @@ export const taskAutomationsCreate = async (
})
}
+export const getTaskAutomationsRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/task_automations/${id}/`
+}
+
+export const taskAutomationsRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<TaskAutomationApi> => {
+ return apiMutator<TaskAutomationApi>(getTaskAutomationsRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getTaskAutomationsUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/task_automations/${id}/`
+}
+
+export const taskAutomationsUpdate = async (
+ projectId: string,
+ id: string,
+ taskAutomationApi: NonReadonly<TaskAutomationApi>,
+ options?: RequestInit
+): Promise<TaskAutomationApi> => {
+ return apiMutator<TaskAutomationApi>(getTaskAutomationsUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(taskAutomationApi),
+ })
+}
+
+export const getTaskAutomationsPartialUpdateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/task_automations/${id}/`
+}
+
+export const taskAutomationsPartialUpdate = async (
+ projectId: string,
+ id: string,
+ patchedTaskAutomationApi?: NonReadonly<PatchedTaskAutomationApi>,
+ options?: RequestInit
+): Promise<TaskAutomationApi> => {
+ return apiMutator<TaskAutomationApi>(getTaskAutomationsPartialUpdateUrl(projectId, id), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedTaskAutomationApi),
+ })
+}
+
+export const getTaskAutomationsDestroyUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/task_automations/${id}/`
+}
+
+export const taskAutomationsDestroy = async (projectId: string, id: string, options?: RequestInit): Promise<void> => {
+ return apiMutator<void>(getTaskAutomationsDestroyUrl(projectId, id), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
+export const getTaskAutomationsRunCreateUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/task_automations/${id}/run/`
+}
+
+export const taskAutomationsRunCreate = async (
+ projectId: string,
+ id: string,
+ taskAutomationApi: NonReadonly<TaskAutomationApi>,
+ options?: RequestInit
+): Promise<TaskAutomationApi> => {
+ return apiMutator<TaskAutomationApi>(getTaskAutomationsRunCreateUrl(projectId, id), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(taskAutomationApi),
+ })
+}
+
export const getTasksListUrl = (projectId: string, params?: TasksListParams) => {
const normalizedParams = new URLSearchParams()
diff --git a/products/tasks/frontend/generated/api.zod.ts b/products/tasks/frontend/generated/api.zod.ts
index 51210a7ccd9f..b24646789762 100644
--- a/products/tasks/frontend/generated/api.zod.ts
+++ b/products/tasks/frontend/generated/api.zod.ts
@@ -56,6 +56,43 @@ export const SandboxCreateBody = /* @__PURE__ */ zod.object({
.describe('If true, only the creator can see this environment. Otherwise visible to whole team.'),
})
+/**
+ * API for managing sandbox environments that control network access for task runs.
+ */
+export const sandboxPartialUpdateBodyNameMax = 255
+
+export const sandboxPartialUpdateBodyAllowedDomainsItemMax = 255
+
+export const sandboxPartialUpdateBodyRepositoriesItemMax = 255
+
+export const SandboxPartialUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(sandboxPartialUpdateBodyNameMax).optional(),
+ network_access_level: zod
+ .enum(['trusted', 'full', 'custom'])
+ .optional()
+ .describe('\* `trusted` - Trusted\n\* `full` - Full\n\* `custom` - Custom'),
+ allowed_domains: zod
+ .array(zod.string().max(sandboxPartialUpdateBodyAllowedDomainsItemMax))
+ .optional()
+ .describe('List of allowed domains for custom network access'),
+ include_default_domains: zod
+ .boolean()
+ .optional()
+ .describe('Whether to include default trusted domains (GitHub, npm, PyPI)'),
+ repositories: zod
+ .array(zod.string().max(sandboxPartialUpdateBodyRepositoriesItemMax))
+ .optional()
+ .describe('List of repositories this environment applies to (format: org\/repo)'),
+ environment_variables: zod
+ .unknown()
+ .optional()
+ .describe('Encrypted environment variables (write-only, never returned in responses)'),
+ private: zod
+ .boolean()
+ .optional()
+ .describe('If true, only the creator can see this environment. Otherwise visible to whole team.'),
+})
+
export const taskAutomationsCreateBodyNameMax = 255
export const taskAutomationsCreateBodyRepositoryMax = 255
@@ -77,6 +114,69 @@ export const TaskAutomationsCreateBody = /* @__PURE__ */ zod.object({
enabled: zod.boolean().optional(),
})
+export const taskAutomationsUpdateBodyNameMax = 255
+
+export const taskAutomationsUpdateBodyRepositoryMax = 255
+
+export const taskAutomationsUpdateBodyCronExpressionMax = 100
+
+export const taskAutomationsUpdateBodyTimezoneMax = 128
+
+export const taskAutomationsUpdateBodyTemplateIdMax = 255
+
+export const TaskAutomationsUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(taskAutomationsUpdateBodyNameMax),
+ prompt: zod.string(),
+ repository: zod.string().max(taskAutomationsUpdateBodyRepositoryMax),
+ github_integration: zod.number().nullish(),
+ cron_expression: zod.string().max(taskAutomationsUpdateBodyCronExpressionMax),
+ timezone: zod.string().max(taskAutomationsUpdateBodyTimezoneMax).optional(),
+ template_id: zod.string().max(taskAutomationsUpdateBodyTemplateIdMax).nullish(),
+ enabled: zod.boolean().optional(),
+})
+
+export const taskAutomationsPartialUpdateBodyNameMax = 255
+
+export const taskAutomationsPartialUpdateBodyRepositoryMax = 255
+
+export const taskAutomationsPartialUpdateBodyCronExpressionMax = 100
+
+export const taskAutomationsPartialUpdateBodyTimezoneMax = 128
+
+export const taskAutomationsPartialUpdateBodyTemplateIdMax = 255
+
+export const TaskAutomationsPartialUpdateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(taskAutomationsPartialUpdateBodyNameMax).optional(),
+ prompt: zod.string().optional(),
+ repository: zod.string().max(taskAutomationsPartialUpdateBodyRepositoryMax).optional(),
+ github_integration: zod.number().nullish(),
+ cron_expression: zod.string().max(taskAutomationsPartialUpdateBodyCronExpressionMax).optional(),
+ timezone: zod.string().max(taskAutomationsPartialUpdateBodyTimezoneMax).optional(),
+ template_id: zod.string().max(taskAutomationsPartialUpdateBodyTemplateIdMax).nullish(),
+ enabled: zod.boolean().optional(),
+})
+
+export const taskAutomationsRunCreateBodyNameMax = 255
+
+export const taskAutomationsRunCreateBodyRepositoryMax = 255
+
+export const taskAutomationsRunCreateBodyCronExpressionMax = 100
+
+export const taskAutomationsRunCreateBodyTimezoneMax = 128
+
+export const taskAutomationsRunCreateBodyTemplateIdMax = 255
+
+export const TaskAutomationsRunCreateBody = /* @__PURE__ */ zod.object({
+ name: zod.string().max(taskAutomationsRunCreateBodyNameMax),
+ prompt: zod.string(),
+ repository: zod.string().max(taskAutomationsRunCreateBodyRepositoryMax),
+ github_integration: zod.number().nullish(),
+ cron_expression: zod.string().max(taskAutomationsRunCreateBodyCronExpressionMax),
+ timezone: zod.string().max(taskAutomationsRunCreateBodyTimezoneMax).optional(),
+ template_id: zod.string().max(taskAutomationsRunCreateBodyTemplateIdMax).nullish(),
+ enabled: zod.boolean().optional(),
+})
+
/**
* API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
*/
diff --git a/products/tracing/backend/presentation/views.py b/products/tracing/backend/presentation/views.py
index e560ca3199fc..9e5516325462 100644
--- a/products/tracing/backend/presentation/views.py
+++ b/products/tracing/backend/presentation/views.py
@@ -267,7 +267,6 @@ class _TracingTreeRequestSerializer(serializers.Serializer):
query = _TracingTreeQueryBodySerializer(help_text="The span call-tree aggregation query to execute.")
-@extend_schema(tags=["tracing"])
class SpansViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet):
scope_object = "tracing"
serializer_class = _FallbackSerializer
diff --git a/products/user_interviews/backend/presentation/views.py b/products/user_interviews/backend/presentation/views.py
index e6678e5ae444..a992b424c9b0 100644
--- a/products/user_interviews/backend/presentation/views.py
+++ b/products/user_interviews/backend/presentation/views.py
@@ -26,7 +26,7 @@ from rest_framework.parsers import JSONParser, MultiPartParser
from rest_framework.request import Request
from rest_framework_csv import renderers as csvrenderers
-from posthog.schema import EmbeddingModelName, ProductKey
+from posthog.schema import EmbeddingModelName
from posthog.hogql import ast
from posthog.hogql.query import execute_hogql_query
@@ -330,7 +330,6 @@ class UserInterviewSearchResultSerializer(serializers.Serializer):
created_at = serializers.DateTimeField(help_text="When the interview row was created.")
-@extend_schema(tags=[ProductKey.USER_INTERVIEWS])
class UserInterviewViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
scope_object = "user_interview"
queryset = UserInterview.objects.order_by("-created_at").select_related("created_by").all()
@@ -805,7 +804,6 @@ class SendInvitesRequestSerializer(serializers.Serializer):
)
-@extend_schema(tags=[ProductKey.USER_INTERVIEWS])
class UserInterviewTopicViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
"""Planned user interview topics: who we want to target and what we want to ask about."""
@@ -1222,7 +1220,6 @@ class BulkIntervieweeContextResponseSerializer(serializers.Serializer):
)
-@extend_schema(tags=[ProductKey.USER_INTERVIEWS])
class IntervieweeContextViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
"""Per-interviewee extra context for a user interview topic. At most one row per (topic, interviewee_identifier)."""
diff --git a/products/visual_review/backend/presentation/views.py b/products/visual_review/backend/presentation/views.py
index 38060f7df17c..a6802484a367 100644
--- a/products/visual_review/backend/presentation/views.py
+++ b/products/visual_review/backend/presentation/views.py
@@ -60,10 +60,7 @@ from .serializers import (
UpdateRepoInputSerializer,
)
-VISUAL_REVIEW_TAG = "visual_review"
-
-@extend_schema(tags=[VISUAL_REVIEW_TAG])
class RepoViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
"""
Projects for visual review.
@@ -263,7 +260,6 @@ class RepoViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
return Response(BaselineOverviewSerializer(instance=result).data)
-@extend_schema(tags=[VISUAL_REVIEW_TAG])
class SnapshotViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
"""Snapshot identities under a repo, keyed by (run_type, identifier).
@@ -309,7 +305,6 @@ class SnapshotViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
return Response(SnapshotHistoryEntrySerializer(instance=history, many=True).data)
-@extend_schema(tags=[VISUAL_REVIEW_TAG])
class RepoRunsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
"""Listing/aggregation of runs scoped to a single repo.
@@ -347,7 +342,6 @@ class RepoRunsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
return Response(api.get_review_state_counts(self.team_id, repo_id=repo_id))
-@extend_schema(tags=[VISUAL_REVIEW_TAG])
class RunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
"""
Visual review runs.
diff --git a/products/web_analytics/frontend/generated/api.ts b/products/web_analytics/frontend/generated/api.ts
index 1686c808ebba..a2a471abeadd 100644
--- a/products/web_analytics/frontend/generated/api.ts
+++ b/products/web_analytics/frontend/generated/api.ts
@@ -40,6 +40,21 @@ type NonReadonly<T> = [T] extends [UnionToIntersection<T>]
}
: DistributeReadOnlyOverUnions<T>
+export const getHeatmapScreenshotsContentRetrieveUrl = (projectId: string, id: string) => {
+ return `/api/projects/${projectId}/heatmap_screenshots/${id}/content/`
+}
+
+export const heatmapScreenshotsContentRetrieve = async (
+ projectId: string,
+ id: string,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getHeatmapScreenshotsContentRetrieveUrl(projectId, id), {
+ ...options,
+ method: 'GET',
+ })
+}
+
export const getHeatmapsListUrl = (projectId: string, params?: HeatmapsListParams) => {
const normalizedParams = new URLSearchParams()
diff --git a/products/web_analytics/mcp/tools.yaml b/products/web_analytics/mcp/tools.yaml
index 95cdd4966155..6b752f6a51a2 100644
--- a/products/web_analytics/mcp/tools.yaml
+++ b/products/web_analytics/mcp/tools.yaml
@@ -9,6 +9,9 @@ feature: web_analytics
url_prefix: /web
ui_apps: {}
tools:
+ heatmap-screenshots-content-retrieve:
+ operation: heatmap_screenshots_content_retrieve
+ enabled: false
heatmaps-events-retrieve:
operation: heatmaps_events_retrieve
enabled: false
diff --git a/products/workflows/backend/api/hog_flow.py b/products/workflows/backend/api/hog_flow.py
index fe45d8b52ce1..a0904f599b77 100644
--- a/products/workflows/backend/api/hog_flow.py
+++ b/products/workflows/backend/api/hog_flow.py
@@ -433,7 +433,7 @@ class HogFlowFilterSet(FilterSet):
fields = ["id", "created_by", "created_at", "updated_at"]
-@extend_schema(tags=["workflows"])
+@extend_schema(extensions={"x-product": "workflows"})
class HogFlowViewSet(TeamAndOrgViewSetMixin, LogEntryMixin, AppMetricsMixin, viewsets.ModelViewSet):
scope_object = "hog_flow"
scope_object_read_actions = ["list", "retrieve", "logs", "metrics", "metrics_totals"]
diff --git a/products/workflows/backend/api/hog_flow_template.py b/products/workflows/backend/api/hog_flow_template.py
index 72fad1481793..ff48fac8531e 100644
--- a/products/workflows/backend/api/hog_flow_template.py
+++ b/products/workflows/backend/api/hog_flow_template.py
@@ -215,7 +215,7 @@ class HogFlowTemplateSerializer(serializers.ModelSerializer):
return super().create(validated_data=validated_data)
-@extend_schema(tags=["workflows"])
+@extend_schema(extensions={"x-product": "workflows"})
class HogFlowTemplateViewSet(TeamAndOrgViewSetMixin, LogEntryMixin, viewsets.ModelViewSet):
scope_object = "INTERNAL"
queryset = HogFlowTemplate.objects.all()
diff --git a/services/mcp/definitions/core.yaml b/services/mcp/definitions/core.yaml
index 5d5a8f4006ca..aa459d6501c2 100644
--- a/services/mcp/definitions/core.yaml
+++ b/services/mcp/definitions/core.yaml
@@ -23,24 +23,6 @@ tools:
add-product-intent-partial-update:
operation: organizations_projects_add_product_intent_partial_update
enabled: false
- annotations-create:
- operation: annotations_create
- enabled: false
- annotations-destroy:
- operation: annotations_destroy
- enabled: false
- annotations-list:
- operation: annotations_list
- enabled: false
- annotations-partial-update:
- operation: annotations_partial_update
- enabled: false
- annotations-retrieve:
- operation: annotations_retrieve
- enabled: false
- annotations-update:
- operation: annotations_update
- enabled: false
change-organization-create:
operation: organizations_projects_change_organization_create
enabled: false
@@ -56,141 +38,9 @@ tools:
cimd-verification-tokens-retrieve:
operation: cimd_verification_tokens_retrieve
enabled: false
- cohorts-activity-retrieve:
- operation: cohorts_activity_retrieve
- enabled: false
- cohorts-add-persons-to-static-cohort-partial-update:
- operation: cohorts_add_persons_to_static_cohort_partial_update
- enabled: false
- cohorts-all-activity-retrieve:
- operation: cohorts_all_activity_retrieve
- enabled: false
- cohorts-calculation-history-retrieve:
- operation: cohorts_calculation_history_retrieve
- enabled: false
- cohorts-create:
- operation: cohorts_create
- enabled: false
- cohorts-destroy:
- operation: cohorts_destroy
- enabled: false
- cohorts-list:
- operation: cohorts_list
- enabled: false
- cohorts-partial-update:
- operation: cohorts_partial_update
- enabled: false
- cohorts-persons-retrieve:
- operation: cohorts_persons_retrieve
- enabled: false
- cohorts-remove-person-from-static-cohort-partial-update:
- operation: cohorts_remove_person_from_static_cohort_partial_update
- enabled: false
- cohorts-retrieve:
- operation: cohorts_retrieve
- enabled: false
- cohorts-update:
- operation: cohorts_update
- enabled: false
- comments-complete-create:
- operation: comments_complete_create
- enabled: false
- comments-count-retrieve:
- operation: comments_count_retrieve
- enabled: false
- comments-create:
- operation: comments_create
- enabled: false
- comments-destroy:
- operation: comments_destroy
- enabled: false
- comments-list:
- operation: comments_list
- enabled: false
- comments-partial-update:
- operation: comments_partial_update
- enabled: false
- comments-reopen-create:
- operation: comments_reopen_create
- enabled: false
- comments-retrieve:
- operation: comments_retrieve
- enabled: false
- comments-thread-retrieve:
- operation: comments_thread_retrieve
- enabled: false
- comments-update:
- operation: comments_update
- enabled: false
complete-product-onboarding-partial-update:
operation: organizations_projects_complete_product_onboarding_partial_update
enabled: false
- dashboard-templates-copy-between-projects-create:
- operation: dashboard_templates_copy_between_projects_create
- enabled: false
- dashboard-templates-create:
- operation: dashboard_templates_create
- enabled: false
- dashboard-templates-destroy:
- operation: dashboard_templates_destroy
- enabled: false
- dashboard-templates-json-schema-retrieve:
- operation: dashboard_templates_json_schema_retrieve
- enabled: false
- dashboard-templates-list:
- operation: dashboard_templates_list
- enabled: false
- dashboard-templates-partial-update:
- operation: dashboard_templates_partial_update
- enabled: false
- dashboard-templates-retrieve:
- operation: dashboard_templates_retrieve
- enabled: false
- dashboard-templates-update:
- operation: dashboard_templates_update
- enabled: false
- dashboards-analyze-refresh-result-create:
- operation: dashboards_analyze_refresh_result_create
- enabled: false
- dashboards-bulk-update-tags-create:
- operation: dashboards_bulk_update_tags_create
- enabled: false
- dashboards-copy-tile-create:
- operation: dashboards_copy_tile_create
- enabled: false
- dashboards-create:
- operation: dashboards_create
- enabled: false
- dashboards-create-from-template-json-create:
- operation: dashboards_create_from_template_json_create
- enabled: false
- dashboards-create-text-tile-create:
- operation: dashboards_create_text_tile_create
- enabled: false
- dashboards-create-unlisted-dashboard-create:
- operation: dashboards_create_unlisted_dashboard_create
- enabled: false
- dashboards-destroy:
- operation: dashboards_destroy
- enabled: false
- dashboards-list:
- operation: dashboards_list
- enabled: false
- dashboards-move-tile-partial-update:
- operation: dashboards_move_tile_partial_update
- enabled: false
- dashboards-partial-update:
- operation: dashboards_partial_update
- enabled: false
- dashboards-reorder-tiles-create:
- operation: dashboards_reorder_tiles_create
- enabled: false
- dashboards-retrieve:
- operation: dashboards_retrieve
- enabled: false
- dashboards-run-insights-retrieve:
- operation: dashboards_run_insights_retrieve
- enabled: false
dashboards-sharing-list:
operation: dashboards_sharing_list
enabled: false
@@ -203,18 +53,6 @@ tools:
dashboards-sharing-refresh-create:
operation: dashboards_sharing_refresh_create
enabled: false
- dashboards-snapshot-create:
- operation: dashboards_snapshot_create
- enabled: false
- dashboards-stream-tiles-retrieve:
- operation: dashboards_stream_tiles_retrieve
- enabled: false
- dashboards-update:
- operation: dashboards_update
- enabled: false
- dashboards-update-text-tile-create:
- operation: dashboards_update_text_tile_create
- enabled: false
delete-secret-token-backup-partial-update:
operation: organizations_projects_delete_secret_token_backup_partial_update
enabled: false
@@ -245,45 +83,6 @@ tools:
domains-verify-create:
operation: domains_verify_create
enabled: false
- event-definitions-bulk-update-tags-create:
- operation: event_definitions_bulk_update_tags_create
- enabled: false
- event-definitions-by-name-retrieve:
- operation: event_definitions_by_name_retrieve
- enabled: false
- event-definitions-create:
- operation: event_definitions_create
- enabled: false
- event-definitions-destroy:
- operation: event_definitions_destroy
- enabled: false
- event-definitions-golang-retrieve:
- operation: event_definitions_golang_retrieve
- enabled: false
- event-definitions-list:
- operation: event_definitions_list
- enabled: false
- event-definitions-metrics-retrieve:
- operation: event_definitions_metrics_retrieve
- enabled: false
- event-definitions-partial-update:
- operation: event_definitions_partial_update
- enabled: false
- event-definitions-primary-properties-retrieve:
- operation: event_definitions_primary_properties_retrieve
- enabled: false
- event-definitions-python-retrieve:
- operation: event_definitions_python_retrieve
- enabled: false
- event-definitions-retrieve:
- operation: event_definitions_retrieve
- enabled: false
- event-definitions-typescript-retrieve:
- operation: event_definitions_typescript_retrieve
- enabled: false
- event-definitions-update:
- operation: event_definitions_update
- enabled: false
exports-content-retrieve:
operation: exports_content_retrieve
enabled: false
@@ -341,33 +140,6 @@ tools:
generate-conversations-public-token-create:
operation: organizations_projects_generate_conversations_public_token_create
enabled: false
- groups-activity-retrieve:
- operation: groups_activity_retrieve
- enabled: false
- groups-create:
- operation: groups_create
- enabled: false
- groups-delete-property-create:
- operation: groups_delete_property_create
- enabled: false
- groups-find-retrieve:
- operation: groups_find_retrieve
- enabled: false
- groups-list:
- operation: groups_list
- enabled: false
- groups-property-definitions-retrieve:
- operation: groups_property_definitions_retrieve
- enabled: false
- groups-property-values-retrieve:
- operation: groups_property_values_retrieve
- enabled: false
- groups-related-retrieve:
- operation: groups_related_retrieve
- enabled: false
- groups-update-property-create:
- operation: groups_update_property_create
- enabled: false
insights-sharing-list:
operation: insights_sharing_list
enabled: false
@@ -398,33 +170,6 @@ tools:
is-generating-demo-data-retrieve:
operation: organizations_projects_is_generating_demo_data_retrieve
enabled: false
- legal-documents-create:
- operation: legal_documents_create
- enabled: false
- legal-documents-download-retrieve:
- operation: legal_documents_download_retrieve
- enabled: false
- legal-documents-list:
- operation: legal_documents_list
- enabled: false
- legal-documents-retrieve:
- operation: legal_documents_retrieve
- enabled: false
- members-destroy:
- operation: members_destroy
- enabled: false
- members-list:
- operation: members_list
- enabled: false
- members-partial-update:
- operation: members_partial_update
- enabled: false
- members-scoped-api-keys-retrieve:
- operation: members_scoped_api_keys_retrieve
- enabled: false
- members-update:
- operation: members_update
- enabled: false
notebooks-sharing-list:
operation: notebooks_sharing_list
enabled: false
@@ -554,24 +299,6 @@ tools:
reset-token-partial-update:
operation: organizations_projects_reset_token_partial_update
enabled: false
- roles-create:
- operation: roles_create
- enabled: false
- roles-destroy:
- operation: roles_destroy
- enabled: false
- roles-list:
- operation: roles_list
- enabled: false
- roles-partial-update:
- operation: roles_partial_update
- enabled: false
- roles-retrieve:
- operation: roles_retrieve
- enabled: false
- roles-update:
- operation: roles_update
- enabled: false
rotate-secret-token-partial-update:
operation: organizations_projects_rotate_secret_token_partial_update
enabled: false
diff --git a/services/mcp/definitions/data_warehouse.yaml b/services/mcp/definitions/data_warehouse.yaml
index 77869c52b222..8273c466373e 100644
--- a/services/mcp/definitions/data_warehouse.yaml
+++ b/services/mcp/definitions/data_warehouse.yaml
@@ -153,9 +153,21 @@ tools:
fix-hogql-create:
operation: fix_hogql_create
enabled: false
+ fix-hogql-destroy:
+ operation: fix_hogql_destroy
+ enabled: false
fix-hogql-list:
operation: fix_hogql_list
enabled: false
+ fix-hogql-partial-update:
+ operation: fix_hogql_partial_update
+ enabled: false
+ fix-hogql-retrieve:
+ operation: fix_hogql_retrieve
+ enabled: false
+ fix-hogql-update:
+ operation: fix_hogql_update
+ enabled: false
insight-variables-create:
operation: insight_variables_create
enabled: false
@@ -210,6 +222,9 @@ tools:
warehouse-model-paths-list:
operation: warehouse_model_paths_list
enabled: false
+ warehouse-model-paths-retrieve:
+ operation: warehouse_model_paths_retrieve
+ enabled: false
warehouse-saved-queries-activity-retrieve:
operation: warehouse_saved_queries_activity_retrieve
enabled: false
@@ -294,27 +309,69 @@ tools:
warehouse-tables-create:
operation: warehouse_tables_create
enabled: false
+ warehouse-tables-destroy:
+ operation: warehouse_tables_destroy
+ enabled: false
warehouse-tables-file-create:
operation: warehouse_tables_file_create
enabled: false
warehouse-tables-list:
operation: warehouse_tables_list
enabled: false
+ warehouse-tables-partial-update:
+ operation: warehouse_tables_partial_update
+ enabled: false
+ warehouse-tables-refresh-schema-create:
+ operation: warehouse_tables_refresh_schema_create
+ enabled: false
+ warehouse-tables-retrieve:
+ operation: warehouse_tables_retrieve
+ enabled: false
+ warehouse-tables-update:
+ operation: warehouse_tables_update
+ enabled: false
+ warehouse-tables-update-schema-create:
+ operation: warehouse_tables_update_schema_create
+ enabled: false
warehouse-view-link-create:
operation: warehouse_view_link_create
enabled: false
+ warehouse-view-link-destroy:
+ operation: warehouse_view_link_destroy
+ enabled: false
warehouse-view-link-list:
operation: warehouse_view_link_list
enabled: false
+ warehouse-view-link-partial-update:
+ operation: warehouse_view_link_partial_update
+ enabled: false
+ warehouse-view-link-retrieve:
+ operation: warehouse_view_link_retrieve
+ enabled: false
+ warehouse-view-link-update:
+ operation: warehouse_view_link_update
+ enabled: false
warehouse-view-link-validate-create:
operation: warehouse_view_link_validate_create
enabled: false
warehouse-view-links-create:
operation: warehouse_view_links_create
enabled: false
+ warehouse-view-links-destroy:
+ operation: warehouse_view_links_destroy
+ enabled: false
warehouse-view-links-list:
operation: warehouse_view_links_list
enabled: false
+ warehouse-view-links-partial-update:
+ operation: warehouse_view_links_partial_update
+ enabled: false
+ warehouse-view-links-retrieve:
+ operation: warehouse_view_links_retrieve
+ enabled: false
+ warehouse-view-links-update:
+ operation: warehouse_view_links_update
+ enabled: false
warehouse-view-links-validate-create:
operation: warehouse_view_links_validate_create
enabled: false
diff --git a/services/mcp/scripts/scaffold-yaml.ts b/services/mcp/scripts/scaffold-yaml.ts
index 334c4b1407f0..d25030435df6 100644
--- a/services/mcp/scripts/scaffold-yaml.ts
+++ b/services/mcp/scripts/scaffold-yaml.ts
@@ -2,7 +2,7 @@
/**
* Scaffolds YAML tool definitions from the OpenAPI schema.
*
- * Discovers operations using x-explicit-tags (priority 1) and URL path
+ * Discovers operations using x-product (priority 1) and URL path
* substring matching (fallback), same approach as generate-openapi-types.mjs.
*
* Idempotent: re-running on an existing file only adds newly discovered
@@ -41,7 +41,7 @@ interface OpenApiOperation {
summary?: string
description?: string
deprecated?: boolean
- 'x-explicit-tags'?: string[]
+ 'x-product'?: string[]
}
interface OpenApiSpec {
@@ -94,10 +94,10 @@ function operationIdToToolName(operationId: string): string {
}
/**
- * Find operations by x-explicit-tags — same priority-1 approach as
+ * Find operations by x-product — same priority-1 approach as
* frontend/bin/generate-openapi-types.mjs resolveTagToProduct().
- * Tags are set via @extend_schema(tags=[...]) or auto-derived from
- * the ViewSet module path (products/<name>/backend/ → tag "<name>").
+ * Values are set via @extend_schema(tags=[...]) or auto-derived from
+ * the ViewSet module path (products/<name>/backend/ → "<name>").
*/
function findOperationsByTag(spec: OpenApiSpec, product: string): DiscoveredOperation[] {
const ops: DiscoveredOperation[] = []
@@ -114,7 +114,7 @@ function findOperationsByTag(spec: OpenApiSpec, product: string): DiscoveredOper
if (!httpMethods.has(method) || !op?.operationId || op.deprecated) {
continue
}
- const tags = op['x-explicit-tags'] ?? []
+ const tags = op['x-product'] ?? []
if (tags.some((tag) => matchingTags.has(tag.replace(/-/g, '_')))) {
ops.push({
operationId: op.operationId,
@@ -131,7 +131,7 @@ function findOperationsByTag(spec: OpenApiSpec, product: string): DiscoveredOper
/**
* Find operations whose URL path contains /{product}/ — fallback when
- * x-explicit-tags doesn't match, same as generate-openapi-types.mjs
+ * x-product doesn't match, same as generate-openapi-types.mjs
* matchUrlToProduct().
*/
function findOperationsByUrl(spec: OpenApiSpec, product: string): DiscoveredOperation[] {
@@ -171,7 +171,7 @@ function findOperationsByUrl(spec: OpenApiSpec, product: string): DiscoveredOper
/**
* Find operations for a product. Uses the same priority as
* frontend/bin/generate-openapi-types.mjs:
- * 1. x-explicit-tags match (covers ViewSets with @extend_schema(tags=[...])
+ * 1. x-product match (covers ViewSets with @extend_schema(tags=[...])
* and ViewSets in products/<name>/backend/)
* 2. URL path substring match (fallback for legacy endpoints)
*/
@@ -528,7 +528,7 @@ function main(): void {
console.error(' scaffold-yaml --path <prefix> [--output <file>]')
console.error(' scaffold-yaml --sync-all')
console.error('')
- console.error('--product discovers endpoints by x-explicit-tags first, then URL path fallback.')
+ console.error('--product discovers endpoints by x-product first, then URL path fallback.')
console.error('Uses the product folder name (underscores), e.g. error_tracking, workflows.')
process.exit(1)
}