Operations for the FeatureFlags API.
Summary
Functions
Add a feature flag target
Disable a feature flag
Enable a feature flag
Get a feature flag
List feature flags
List enabled feature flags for an organization
List enabled feature flags for a user
Remove a feature flag target
Functions
@spec add_flag_target(WorkOS.Client.t(), String.t(), String.t(), keyword()) :: {:ok, term()} | {:error, WorkOS.Error.error()}
Add a feature flag target
Enables a feature flag for a specific target in the current environment. Currently, supported targets include users and organizations.
Parameters
slug— The unique slug identifier of the feature flag.resource_id— The resource ID in format "user<id>" or "org<id>".opts— per-request options (seeWorkOS.Client.request/5)
@spec disable_feature_flag(WorkOS.Client.t(), String.t(), keyword()) :: {:ok, WorkOS.FeatureFlag.t()} | {:error, WorkOS.Error.error()}
Disable a feature flag
Disables a feature flag in the current environment.
Parameters
slug— A unique key to reference the Feature Flag.opts— per-request options (seeWorkOS.Client.request/5)
@spec enable_feature_flag(WorkOS.Client.t(), String.t(), keyword()) :: {:ok, WorkOS.FeatureFlag.t()} | {:error, WorkOS.Error.error()}
Enable a feature flag
Enables a feature flag in the current environment.
Parameters
slug— A unique key to reference the Feature Flag.opts— per-request options (seeWorkOS.Client.request/5)
@spec get_feature_flag(WorkOS.Client.t(), String.t(), keyword()) :: {:ok, WorkOS.Flag.t()} | {:error, WorkOS.Error.error()}
Get a feature flag
Get the details of an existing feature flag by its slug.
Parameters
slug— A unique key to reference the Feature Flag.opts— per-request options (seeWorkOS.Client.request/5)
@spec list_feature_flags(WorkOS.Client.t(), map(), keyword()) :: {:ok, WorkOS.Page.t(WorkOS.Flag.t())} | {:error, WorkOS.Error.error()}
List feature flags
Get a list of all of your existing feature flags matching the criteria specified.
Parameters
params— query parameters::before,:after_,:limit,:orderopts— per-request options (seeWorkOS.Client.request/5)
@spec list_organization_feature_flags(WorkOS.Client.t(), String.t(), map(), keyword()) :: {:ok, WorkOS.Page.t(WorkOS.Flag.t())} | {:error, WorkOS.Error.error()}
List enabled feature flags for an organization
Get a list of all enabled feature flags for an organization.
Parameters
organization_id— Unique identifier of the Organization.params— query parameters::before,:after_,:limit,:orderopts— per-request options (seeWorkOS.Client.request/5)
@spec list_user_feature_flags(WorkOS.Client.t(), String.t(), map(), keyword()) :: {:ok, WorkOS.Page.t(WorkOS.Flag.t())} | {:error, WorkOS.Error.error()}
List enabled feature flags for a user
Get 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.
Parameters
user_id— The ID of the user.params— query parameters::before,:after_,:limit,:orderopts— per-request options (seeWorkOS.Client.request/5)
@spec remove_flag_target(WorkOS.Client.t(), String.t(), String.t(), keyword()) :: {:ok, term()} | {:error, WorkOS.Error.error()}
Remove a feature flag target
Removes a target from the feature flag's target list in the current environment. Currently, supported targets include users and organizations.
Parameters
slug— The unique slug identifier of the feature flag.resource_id— The resource ID in format "user<id>" or "org<id>".opts— per-request options (seeWorkOS.Client.request/5)