provider feature_flags POST /api/projects/{project_id}/feature_flags/
@utdk/posthog /api/projects/{project_id}/feature_flags/
feature_flags_create
Create, read, update and delete feature flags. [See docs](https://posthog.com/docs/feature-flags) for more information on feature flags. If you're looking to use feature flags on your application, you can either use our JavaScript Library or our dedicated endpoint to check if feature flags are enabled for a given user.
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
featureFlagsCreate
POST/api/projects/{project_id}/feature_flags/
Create, read, update and delete feature flags. [See docs](https://posthog.com/docs/feature-flags) for more information on feature flags. If you're looking to use feature flags on your application, you can either use our JavaScript Library or our dedicated endpoint to check if feature flags are enabled for a given user.

Parameters

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

Feature flag key.

Feature flag description (stored in the `name` field for backwards compatibility).

Feature flag targeting configuration.

Whether the feature flag is active.

Whether the flag is archived. Archived flags are hidden from the flag list by default and must be disabled (`active: false`).

Organizational tags for this feature flag.

Evaluation contexts that control where this flag evaluates at runtime.

Whether this flag is a remote configuration flag that delivers a payload rather than gating a feature.

Whether to persist a user's flag value across the anonymous-to-identified transition (the 'persist across authentication steps' option). Incompatible with device_id bucketing.

Where this flag is allowed to evaluate: 'server' (server-side SDKs only), 'client' (client-side SDKs only), or 'all' (both). Defaults to 'all'. * `server` - Server * `client` - Client * `all` - All

Identifier used to bucket users into rollout percentages and variants: 'distinct_id' (user ID, the default) or 'device_id'. Using 'device_id' is incompatible with ensure_experience_continuity=True. * `distinct_id` - User ID (default) * `device_id` - Device ID

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