provider subscriptionssubscriptions PATCH /api/environments/{environment_id}/subscriptions/{id}/
@utdk/posthog /api/environments/{environment_id}/subscriptions/{id}/
environments_subscriptions_partial_update
environment_id path required
Deprecated. Use /api/projects/{project_id}/ instead.
string
id path required
A unique integer value identifying this subscription.
integer

Try it

Authentication
Configure credentials for PostHog API
environmentsSubscriptionsPartialUpdate
PATCH/api/environments/{environment_id}/subscriptions/{id}/

Parameters

required

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

required

A unique integer value identifying this subscription.

Input

What the subscription delivers: 'insight' (snapshot of one insight), 'dashboard' (snapshot of one dashboard), or 'ai_prompt' (LLM-generated report). Read-only — derived from the populated target (insight → insight, dashboard → dashboard, prompt → ai_prompt). * `insight` - Insight * `dashboard` - Dashboard * `ai_prompt` - AI prompt

Dashboard ID to subscribe to (mutually exclusive with insight on create).

Insight ID to subscribe to (mutually exclusive with dashboard on create).

List of insight IDs from the dashboard to include. Required for dashboard subscriptions, max 6.

Free-text prompt that drives the AI-generated report. Required when resource_type is 'ai_prompt'. Max 4000 characters.

Configuration for AI report subscriptions (analysis window, future knobs). Only valid when resource_type is 'ai_prompt'. Replaced wholesale on writes.

Delivery channel: email or slack. * `email` - Email * `slack` - Slack

Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack.

How often to deliver: daily, weekly, monthly, or yearly. * `daily` - Daily * `weekly` - Weekly * `monthly` - Monthly * `yearly` - Yearly

Interval multiplier (e.g. 2 with weekly frequency means every 2 weeks). Required on create; must be 1 or greater.

Days of week for weekly subscriptions: monday, tuesday, wednesday, thursday, friday, saturday, sunday.

Position within byweekday set for monthly frequency (e.g. 1 for first, -1 for last).

Total number of deliveries before the subscription stops. Null for unlimited.

When to start delivering (ISO 8601 datetime).

When to stop delivering (ISO 8601 datetime). Null for indefinite.

Set to true to soft-delete. Subscriptions cannot be hard-deleted.

Whether the subscription is active. Set to false to pause delivery without deleting. Auto-set to false when the delivery integration becomes invalid.

Human-readable name for this subscription.

Human-readable schedule summary, e.g. 'sent daily'.

ID of a connected Slack integration. Required when target_type is slack.

Optional message included in the invitation email when adding new recipients.

Whether to immediately deliver the subscription once on save so the editor can confirm it looks right. Defaults to true on create. When omitted on update, a delivery is sent only if the edit changed what gets delivered (recipient, channel, source) or re-enabled the subscription. The recurring schedule is unaffected.

Whether to attach an AI-generated summary to each delivery (insight and dashboard subscriptions only). Requires the organization to have approved AI data processing, and is subject to the org's active-summary cap and AI credit budget; otherwise the write is rejected. Not applicable to prompt subscriptions, which are themselves AI-generated.

Optional free-text guidance (max 500 chars) steering the AI summary, e.g. which metrics to emphasize. Only settable when AI summary context is enabled for the organization; clearing it (empty string) is always allowed.

Configure credentials above to enable sending.

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

TypeScript

import posthog from '@utdk/posthog';

await posthog.environmentsSubscriptionsPartialUpdate()