Feature flags allow you to control feature availability for organizations in your application. Flags can either be enabled for individual organizations or all organizations in an environment. Read more about how feature flags integrate with AuthKit here.
const featureFlag = { object: 'feature_flag', id: 'flag_01EHZNVPK3SFK441A1RGBFSHRT', name: 'Advanced Analytics', slug: 'advanced-analytics', description: 'Enable advanced analytics dashboard feature', createdAt: '2025-08-04T19:07:33.155Z', updatedAt: '2025-08-04T19:07:33.155Z', };
interface FeatureFlagGet the details of an existing feature flag.
curl https://api.workos.com/feature-flags/advanced-analytics \ --header "Authorization: Bearer sk_example_123456789"
Get a list of all of your existing feature flags matching the criteria specified.
curl https://api.workos.com/feature-flags \ --header "Authorization: Bearer sk_example_123456789"
GET/feature-flagsParameters Returns objectGet a list of all enabled feature flags for the provided organization.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const featureFlags = await workos.organizations.listOrganizationFeatureFlags({ organizationId: 'org_01EHZNVPK3SFK441A1RGBFSHRT', }); console.log(featureFlags.data);
organizations .listOrganizationFeatureFlags()Parameters objectReturns objectGet a list of all enabled feature flags for the provided user. This includes feature flags enabled specifically for the user as well as any organizations that the user is a member of.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const featureFlags = await workos.userManagement.listUserFeatureFlags({ userId: 'user_01EHZNVPK3SFK441A1RGBFSHRT', }); console.log(featureFlags.data);
userManagement .listUserFeatureFlags()Parameters objectReturns objectEnables a feature flag for a specific target in the current environment. Currently, supported targets include users and organizations.
curl --request POST \ --url https://api.workos.com/feature-flags/test-flag/targets/org_01EHZNVPK3SFK441A1RGBFSHRT \ --header "Authorization: Bearer sk_example_123456789"
POST/feature-flags /:slug /targets /:target_idParameters Removes a target from the feature flag’s target list in the current environment. Currently, supported targets include users and organizations.
curl --request DELETE \ --url https://api.workos.com/feature-flags/test-flag/targets/org_01EHZNVPK3SFK441A1RGBFSHRT \ --header "Authorization: Bearer sk_example_123456789"
DELETE/feature-flags /:slug /targets /:target_idParameters Enables a feature flag in the current environment.
curl --request PUT \ --url https://api.workos.com/feature-flags/advanced-analytics/enable \ --header "Authorization: Bearer sk_example_123456789"
Disables a feature flag in the current environment.
curl --request PUT \ --url https://api.workos.com/feature-flags/advanced-analytics/disable \ --header "Authorization: Bearer sk_example_123456789"