provider subscriptionssubscriptions PUT /api/projects/{project_id}/subscriptions/{id}/
@utdk/posthog /api/projects/{project_id}/subscriptions/{id}/
subscriptions_update
id path required
A unique integer value identifying this subscription.
integer
project_id path required
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
string

Try it

Authentication
Configure credentials for PostHog API
subscriptionsUpdate
PUT/api/projects/{project_id}/subscriptions/{id}/

Parameters

required

A unique integer value identifying this subscription.

required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Input

required
required

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

required
required

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.

required

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

required

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

required

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

required

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.

required

When to start delivering (ISO 8601 datetime).

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

required
required

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.

required

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

required

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