Class FeatureFlagsApi


  • public class FeatureFlagsApi
    extends java.lang.Object
    • Constructor Detail

      • FeatureFlagsApi

        public FeatureFlagsApi()
      • FeatureFlagsApi

        public FeatureFlagsApi​(ApiClient apiClient)
    • Method Detail

      • getApiClient

        public ApiClient getApiClient()
      • setApiClient

        public void setApiClient​(ApiClient apiClient)
      • getHostIndex

        public int getHostIndex()
      • setHostIndex

        public void setHostIndex​(int hostIndex)
      • getCustomBaseUrl

        public java.lang.String getCustomBaseUrl()
      • setCustomBaseUrl

        public void setCustomBaseUrl​(java.lang.String customBaseUrl)
      • copyFeatureFlagCall

        public okhttp3.Call copyFeatureFlagCall​(java.lang.String projectKey,
                                                java.lang.String featureFlagKey,
                                                FlagCopyConfigPost flagCopyConfigPost,
                                                ApiCallback _callback)
                                         throws ApiException
        Build call for copyFeatureFlag
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        flagCopyConfigPost - (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • copyFeatureFlag

        public FeatureFlag copyFeatureFlag​(java.lang.String projectKey,
                                           java.lang.String featureFlagKey,
                                           FlagCopyConfigPost flagCopyConfigPost)
                                    throws ApiException
        Copy feature flag Copy flag settings from a source environment to a target environment. By default, this operation copies the entire flag configuration. You can use the `includedActions` or `excludedActions` to specify that only part of the flag configuration is copied. If you provide the optional `currentVersion` of a flag, this operation tests to ensure that the current flag version in the environment matches the version you've specified. The operation rejects attempts to copy flag settings if the environment's current version of the flag does not match the version you've specified. You can use this to enforce optimistic locking on copy attempts.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        flagCopyConfigPost - (required)
        Returns:
        FeatureFlag
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • copyFeatureFlagWithHttpInfo

        public ApiResponse<FeatureFlag> copyFeatureFlagWithHttpInfo​(java.lang.String projectKey,
                                                                    java.lang.String featureFlagKey,
                                                                    FlagCopyConfigPost flagCopyConfigPost)
                                                             throws ApiException
        Copy feature flag Copy flag settings from a source environment to a target environment. By default, this operation copies the entire flag configuration. You can use the `includedActions` or `excludedActions` to specify that only part of the flag configuration is copied. If you provide the optional `currentVersion` of a flag, this operation tests to ensure that the current flag version in the environment matches the version you've specified. The operation rejects attempts to copy flag settings if the environment's current version of the flag does not match the version you've specified. You can use this to enforce optimistic locking on copy attempts.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        flagCopyConfigPost - (required)
        Returns:
        ApiResponse<FeatureFlag>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • copyFeatureFlagAsync

        public okhttp3.Call copyFeatureFlagAsync​(java.lang.String projectKey,
                                                 java.lang.String featureFlagKey,
                                                 FlagCopyConfigPost flagCopyConfigPost,
                                                 ApiCallback<FeatureFlag> _callback)
                                          throws ApiException
        Copy feature flag (asynchronously) Copy flag settings from a source environment to a target environment. By default, this operation copies the entire flag configuration. You can use the `includedActions` or `excludedActions` to specify that only part of the flag configuration is copied. If you provide the optional `currentVersion` of a flag, this operation tests to ensure that the current flag version in the environment matches the version you've specified. The operation rejects attempts to copy flag settings if the environment's current version of the flag does not match the version you've specified. You can use this to enforce optimistic locking on copy attempts.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        flagCopyConfigPost - (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • deleteFeatureFlagCall

        public okhttp3.Call deleteFeatureFlagCall​(java.lang.String projectKey,
                                                  java.lang.String featureFlagKey,
                                                  ApiCallback _callback)
                                           throws ApiException
        Build call for deleteFeatureFlag
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • deleteFeatureFlag

        public void deleteFeatureFlag​(java.lang.String projectKey,
                                      java.lang.String featureFlagKey)
                               throws ApiException
        Delete feature flag Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • deleteFeatureFlagWithHttpInfo

        public ApiResponse<java.lang.Void> deleteFeatureFlagWithHttpInfo​(java.lang.String projectKey,
                                                                         java.lang.String featureFlagKey)
                                                                  throws ApiException
        Delete feature flag Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        Returns:
        ApiResponse<Void>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • deleteFeatureFlagAsync

        public okhttp3.Call deleteFeatureFlagAsync​(java.lang.String projectKey,
                                                   java.lang.String featureFlagKey,
                                                   ApiCallback<java.lang.Void> _callback)
                                            throws ApiException
        Delete feature flag (asynchronously) Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • getExpiringUserTargetsCall

        public okhttp3.Call getExpiringUserTargetsCall​(java.lang.String projectKey,
                                                       java.lang.String environmentKey,
                                                       java.lang.String featureFlagKey,
                                                       ApiCallback _callback)
                                                throws ApiException
        Build call for getExpiringUserTargets
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getExpiringUserTargets

        public ExpiringUserTargetGetResponse getExpiringUserTargets​(java.lang.String projectKey,
                                                                    java.lang.String environmentKey,
                                                                    java.lang.String featureFlagKey)
                                                             throws ApiException
        Get expiring user targets for feature flag Get a list of user targets on a feature flag that are scheduled for removal.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        Returns:
        ExpiringUserTargetGetResponse
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getExpiringUserTargetsWithHttpInfo

        public ApiResponse<ExpiringUserTargetGetResponse> getExpiringUserTargetsWithHttpInfo​(java.lang.String projectKey,
                                                                                             java.lang.String environmentKey,
                                                                                             java.lang.String featureFlagKey)
                                                                                      throws ApiException
        Get expiring user targets for feature flag Get a list of user targets on a feature flag that are scheduled for removal.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        Returns:
        ApiResponse<ExpiringUserTargetGetResponse>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getExpiringUserTargetsAsync

        public okhttp3.Call getExpiringUserTargetsAsync​(java.lang.String projectKey,
                                                        java.lang.String environmentKey,
                                                        java.lang.String featureFlagKey,
                                                        ApiCallback<ExpiringUserTargetGetResponse> _callback)
                                                 throws ApiException
        Get expiring user targets for feature flag (asynchronously) Get a list of user targets on a feature flag that are scheduled for removal.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • getFeatureFlagCall

        public okhttp3.Call getFeatureFlagCall​(java.lang.String projectKey,
                                               java.lang.String featureFlagKey,
                                               java.lang.String env,
                                               ApiCallback _callback)
                                        throws ApiException
        Build call for getFeatureFlag
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        env - Filter configurations by environment (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getFeatureFlag

        public FeatureFlag getFeatureFlag​(java.lang.String projectKey,
                                          java.lang.String featureFlagKey,
                                          java.lang.String env)
                                   throws ApiException
        Get feature flag Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just the `production` environment.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        env - Filter configurations by environment (optional)
        Returns:
        FeatureFlag
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagWithHttpInfo

        public ApiResponse<FeatureFlag> getFeatureFlagWithHttpInfo​(java.lang.String projectKey,
                                                                   java.lang.String featureFlagKey,
                                                                   java.lang.String env)
                                                            throws ApiException
        Get feature flag Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just the `production` environment.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        env - Filter configurations by environment (optional)
        Returns:
        ApiResponse<FeatureFlag>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagAsync

        public okhttp3.Call getFeatureFlagAsync​(java.lang.String projectKey,
                                                java.lang.String featureFlagKey,
                                                java.lang.String env,
                                                ApiCallback<FeatureFlag> _callback)
                                         throws ApiException
        Get feature flag (asynchronously) Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just the `production` environment.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        env - Filter configurations by environment (optional)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • getFeatureFlagStatusCall

        public okhttp3.Call getFeatureFlagStatusCall​(java.lang.String projectKey,
                                                     java.lang.String environmentKey,
                                                     java.lang.String featureFlagKey,
                                                     ApiCallback _callback)
                                              throws ApiException
        Build call for getFeatureFlagStatus
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getFeatureFlagStatus

        public FlagStatusRep getFeatureFlagStatus​(java.lang.String projectKey,
                                                  java.lang.String environmentKey,
                                                  java.lang.String featureFlagKey)
                                           throws ApiException
        Get feature flag status Get the status for a particular feature flag.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        Returns:
        FlagStatusRep
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusWithHttpInfo

        public ApiResponse<FlagStatusRep> getFeatureFlagStatusWithHttpInfo​(java.lang.String projectKey,
                                                                           java.lang.String environmentKey,
                                                                           java.lang.String featureFlagKey)
                                                                    throws ApiException
        Get feature flag status Get the status for a particular feature flag.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        Returns:
        ApiResponse<FlagStatusRep>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusAsync

        public okhttp3.Call getFeatureFlagStatusAsync​(java.lang.String projectKey,
                                                      java.lang.String environmentKey,
                                                      java.lang.String featureFlagKey,
                                                      ApiCallback<FlagStatusRep> _callback)
                                               throws ApiException
        Get feature flag status (asynchronously) Get the status for a particular feature flag.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • getFeatureFlagStatusAcrossEnvironmentsCall

        public okhttp3.Call getFeatureFlagStatusAcrossEnvironmentsCall​(java.lang.String projectKey,
                                                                       java.lang.String featureFlagKey,
                                                                       java.lang.String env,
                                                                       ApiCallback _callback)
                                                                throws ApiException
        Build call for getFeatureFlagStatusAcrossEnvironments
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        env - Optional environment filter (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getFeatureFlagStatusAcrossEnvironments

        public FeatureFlagStatusAcrossEnvironments getFeatureFlagStatusAcrossEnvironments​(java.lang.String projectKey,
                                                                                          java.lang.String featureFlagKey,
                                                                                          java.lang.String env)
                                                                                   throws ApiException
        Get flag status across environments Get the status for a particular feature flag across environments.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        env - Optional environment filter (optional)
        Returns:
        FeatureFlagStatusAcrossEnvironments
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusAcrossEnvironmentsWithHttpInfo

        public ApiResponse<FeatureFlagStatusAcrossEnvironments> getFeatureFlagStatusAcrossEnvironmentsWithHttpInfo​(java.lang.String projectKey,
                                                                                                                   java.lang.String featureFlagKey,
                                                                                                                   java.lang.String env)
                                                                                                            throws ApiException
        Get flag status across environments Get the status for a particular feature flag across environments.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        env - Optional environment filter (optional)
        Returns:
        ApiResponse<FeatureFlagStatusAcrossEnvironments>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusAcrossEnvironmentsAsync

        public okhttp3.Call getFeatureFlagStatusAcrossEnvironmentsAsync​(java.lang.String projectKey,
                                                                        java.lang.String featureFlagKey,
                                                                        java.lang.String env,
                                                                        ApiCallback<FeatureFlagStatusAcrossEnvironments> _callback)
                                                                 throws ApiException
        Get flag status across environments (asynchronously) Get the status for a particular feature flag across environments.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        env - Optional environment filter (optional)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • getFeatureFlagStatusesCall

        public okhttp3.Call getFeatureFlagStatusesCall​(java.lang.String projectKey,
                                                       java.lang.String environmentKey,
                                                       ApiCallback _callback)
                                                throws ApiException
        Build call for getFeatureFlagStatuses
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getFeatureFlagStatuses

        public FeatureFlagStatuses getFeatureFlagStatuses​(java.lang.String projectKey,
                                                          java.lang.String environmentKey)
                                                   throws ApiException
        List feature flag statuses Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following: - `new`: the feature flag was created within the last seven days, and has not been requested yet - `active`: the feature flag was requested by your servers or clients within the last seven days - `inactive`: the feature flag was created more than seven days ago, and hasn't been requested by your servers or clients within the past seven days - `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        Returns:
        FeatureFlagStatuses
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusesWithHttpInfo

        public ApiResponse<FeatureFlagStatuses> getFeatureFlagStatusesWithHttpInfo​(java.lang.String projectKey,
                                                                                   java.lang.String environmentKey)
                                                                            throws ApiException
        List feature flag statuses Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following: - `new`: the feature flag was created within the last seven days, and has not been requested yet - `active`: the feature flag was requested by your servers or clients within the last seven days - `inactive`: the feature flag was created more than seven days ago, and hasn't been requested by your servers or clients within the past seven days - `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        Returns:
        ApiResponse<FeatureFlagStatuses>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusesAsync

        public okhttp3.Call getFeatureFlagStatusesAsync​(java.lang.String projectKey,
                                                        java.lang.String environmentKey,
                                                        ApiCallback<FeatureFlagStatuses> _callback)
                                                 throws ApiException
        List feature flag statuses (asynchronously) Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following: - `new`: the feature flag was created within the last seven days, and has not been requested yet - `active`: the feature flag was requested by your servers or clients within the last seven days - `inactive`: the feature flag was created more than seven days ago, and hasn't been requested by your servers or clients within the past seven days - `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • getFeatureFlagsCall

        public okhttp3.Call getFeatureFlagsCall​(java.lang.String projectKey,
                                                java.lang.String env,
                                                java.lang.String tag,
                                                java.lang.Long limit,
                                                java.lang.Long offset,
                                                java.lang.Boolean archived,
                                                java.lang.Boolean summary,
                                                java.lang.String filter,
                                                java.lang.String sort,
                                                java.lang.Boolean compare,
                                                ApiCallback _callback)
                                         throws ApiException
        Build call for getFeatureFlags
        Parameters:
        projectKey - The project key (required)
        env - Filter configurations by environment (optional)
        tag - Filter feature flags by tag (optional)
        limit - The number of feature flags to return. Defaults to -1, which returns all flags (optional)
        offset - Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
        archived - A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned (optional)
        summary - By default in API version >= 1, flags will _not_ include their list of prerequisites, targets or rules. Set summary=0 to include these fields for each flag returned (optional)
        filter - A comma-separated list of filters. Each filter is of the form field:value (optional)
        sort - A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order (optional)
        compare - A boolean to filter results by only flags that have differences between environments (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getFeatureFlags

        public FeatureFlags getFeatureFlags​(java.lang.String projectKey,
                                            java.lang.String env,
                                            java.lang.String tag,
                                            java.lang.Long limit,
                                            java.lang.Long offset,
                                            java.lang.Boolean archived,
                                            java.lang.Boolean summary,
                                            java.lang.String filter,
                                            java.lang.String sort,
                                            java.lang.Boolean compare)
                                     throws ApiException
        List feature flags Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env query parameter. For example, setting `env=production` restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter. We support the following fields for filters: - `query` is a string that matches against the flags' keys and names. It is not case sensitive. - `archived` is a boolean to filter the list to archived flags. When this is absent, only unarchived flags are returned. - `type` is a string allowing filtering to `temporary` or `permanent` flags. - `status` is a string allowing filtering to `new`, `inactive`, `active`, or `launched` flags in the specified environment. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=status:active,filterEnv:production`. - `tags` is a + separated list of tags. It filters the list to members who have all of the tags in the list. - `hasExperiment` is a boolean with values of true or false and returns any flags that have an attached metric. - `hasDataExport` is a boolean with values of true or false and returns any flags that are exporting data in the specified environment. This includes flags that are exporting data from Experimentation. This filter also requires that you set a `filterEnv` field to a valid environment key. For example: `filter=hasDataExport:true,filterEnv:production` - `evaluated` is an object that contains a key of `after` and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires you to set a `filterEnv` field to a valid environment. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production`. - `filterEnv` is a string with the key of a valid environment. You can use the filterEnv field for filters that are environment-specific. If there are multiple environment-specific filters, you should only declare this parameter once. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production,status:active`. An example filter is `query:abc,tags:foo+bar`. This matches flags with the string `abc` in their key or name, ignoring case, which also have the tags `foo` and `bar`. By default, this returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page.
        Parameters:
        projectKey - The project key (required)
        env - Filter configurations by environment (optional)
        tag - Filter feature flags by tag (optional)
        limit - The number of feature flags to return. Defaults to -1, which returns all flags (optional)
        offset - Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
        archived - A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned (optional)
        summary - By default in API version >= 1, flags will _not_ include their list of prerequisites, targets or rules. Set summary=0 to include these fields for each flag returned (optional)
        filter - A comma-separated list of filters. Each filter is of the form field:value (optional)
        sort - A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order (optional)
        compare - A boolean to filter results by only flags that have differences between environments (optional)
        Returns:
        FeatureFlags
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagsWithHttpInfo

        public ApiResponse<FeatureFlags> getFeatureFlagsWithHttpInfo​(java.lang.String projectKey,
                                                                     java.lang.String env,
                                                                     java.lang.String tag,
                                                                     java.lang.Long limit,
                                                                     java.lang.Long offset,
                                                                     java.lang.Boolean archived,
                                                                     java.lang.Boolean summary,
                                                                     java.lang.String filter,
                                                                     java.lang.String sort,
                                                                     java.lang.Boolean compare)
                                                              throws ApiException
        List feature flags Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env query parameter. For example, setting `env=production` restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter. We support the following fields for filters: - `query` is a string that matches against the flags' keys and names. It is not case sensitive. - `archived` is a boolean to filter the list to archived flags. When this is absent, only unarchived flags are returned. - `type` is a string allowing filtering to `temporary` or `permanent` flags. - `status` is a string allowing filtering to `new`, `inactive`, `active`, or `launched` flags in the specified environment. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=status:active,filterEnv:production`. - `tags` is a + separated list of tags. It filters the list to members who have all of the tags in the list. - `hasExperiment` is a boolean with values of true or false and returns any flags that have an attached metric. - `hasDataExport` is a boolean with values of true or false and returns any flags that are exporting data in the specified environment. This includes flags that are exporting data from Experimentation. This filter also requires that you set a `filterEnv` field to a valid environment key. For example: `filter=hasDataExport:true,filterEnv:production` - `evaluated` is an object that contains a key of `after` and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires you to set a `filterEnv` field to a valid environment. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production`. - `filterEnv` is a string with the key of a valid environment. You can use the filterEnv field for filters that are environment-specific. If there are multiple environment-specific filters, you should only declare this parameter once. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production,status:active`. An example filter is `query:abc,tags:foo+bar`. This matches flags with the string `abc` in their key or name, ignoring case, which also have the tags `foo` and `bar`. By default, this returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page.
        Parameters:
        projectKey - The project key (required)
        env - Filter configurations by environment (optional)
        tag - Filter feature flags by tag (optional)
        limit - The number of feature flags to return. Defaults to -1, which returns all flags (optional)
        offset - Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
        archived - A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned (optional)
        summary - By default in API version >= 1, flags will _not_ include their list of prerequisites, targets or rules. Set summary=0 to include these fields for each flag returned (optional)
        filter - A comma-separated list of filters. Each filter is of the form field:value (optional)
        sort - A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order (optional)
        compare - A boolean to filter results by only flags that have differences between environments (optional)
        Returns:
        ApiResponse<FeatureFlags>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagsAsync

        public okhttp3.Call getFeatureFlagsAsync​(java.lang.String projectKey,
                                                 java.lang.String env,
                                                 java.lang.String tag,
                                                 java.lang.Long limit,
                                                 java.lang.Long offset,
                                                 java.lang.Boolean archived,
                                                 java.lang.Boolean summary,
                                                 java.lang.String filter,
                                                 java.lang.String sort,
                                                 java.lang.Boolean compare,
                                                 ApiCallback<FeatureFlags> _callback)
                                          throws ApiException
        List feature flags (asynchronously) Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env query parameter. For example, setting `env=production` restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter. We support the following fields for filters: - `query` is a string that matches against the flags' keys and names. It is not case sensitive. - `archived` is a boolean to filter the list to archived flags. When this is absent, only unarchived flags are returned. - `type` is a string allowing filtering to `temporary` or `permanent` flags. - `status` is a string allowing filtering to `new`, `inactive`, `active`, or `launched` flags in the specified environment. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=status:active,filterEnv:production`. - `tags` is a + separated list of tags. It filters the list to members who have all of the tags in the list. - `hasExperiment` is a boolean with values of true or false and returns any flags that have an attached metric. - `hasDataExport` is a boolean with values of true or false and returns any flags that are exporting data in the specified environment. This includes flags that are exporting data from Experimentation. This filter also requires that you set a `filterEnv` field to a valid environment key. For example: `filter=hasDataExport:true,filterEnv:production` - `evaluated` is an object that contains a key of `after` and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires you to set a `filterEnv` field to a valid environment. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production`. - `filterEnv` is a string with the key of a valid environment. You can use the filterEnv field for filters that are environment-specific. If there are multiple environment-specific filters, you should only declare this parameter once. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production,status:active`. An example filter is `query:abc,tags:foo+bar`. This matches flags with the string `abc` in their key or name, ignoring case, which also have the tags `foo` and `bar`. By default, this returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page.
        Parameters:
        projectKey - The project key (required)
        env - Filter configurations by environment (optional)
        tag - Filter feature flags by tag (optional)
        limit - The number of feature flags to return. Defaults to -1, which returns all flags (optional)
        offset - Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
        archived - A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned (optional)
        summary - By default in API version >= 1, flags will _not_ include their list of prerequisites, targets or rules. Set summary=0 to include these fields for each flag returned (optional)
        filter - A comma-separated list of filters. Each filter is of the form field:value (optional)
        sort - A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order (optional)
        compare - A boolean to filter results by only flags that have differences between environments (optional)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • patchExpiringUserTargetsCall

        public okhttp3.Call patchExpiringUserTargetsCall​(java.lang.String projectKey,
                                                         java.lang.String environmentKey,
                                                         java.lang.String featureFlagKey,
                                                         PatchFlagsRequest patchFlagsRequest,
                                                         ApiCallback _callback)
                                                  throws ApiException
        Build call for patchExpiringUserTargets
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        patchFlagsRequest - (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • patchExpiringUserTargets

        public ExpiringUserTargetPatchResponse patchExpiringUserTargets​(java.lang.String projectKey,
                                                                        java.lang.String environmentKey,
                                                                        java.lang.String featureFlagKey,
                                                                        PatchFlagsRequest patchFlagsRequest)
                                                                 throws ApiException
        Update expiring user targets on feature flag Schedule a user for removal from individual targeting on a feature flag. The flag must already individually target the user. You can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag. This request only supports semantic patches. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions #### addExpireUserTargetDate Adds a date and time that LaunchDarkly will remove the user from the flag's individual targeting. ##### Parameters * `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag * `variationId`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * `userKey`: The user key for the user to remove from individual targeting #### updateExpireUserTargetDate Updates the date and time that LaunchDarkly will remove the user from the flag's individual targeting. ##### Parameters * `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag * `variationId`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * `userKey`: The user key for the user to remove from individual targeting #### removeExpireUserTargetDate Removes the scheduled removal of the user from the flag's individual targeting. The user will remain part of the flag's individual targeting until you explicitly remove them, or until you schedule another removal. ##### Parameters * `variationId`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * `userKey`: The user key for the user to remove from individual targeting
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        patchFlagsRequest - (required)
        Returns:
        ExpiringUserTargetPatchResponse
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchExpiringUserTargetsWithHttpInfo

        public ApiResponse<ExpiringUserTargetPatchResponse> patchExpiringUserTargetsWithHttpInfo​(java.lang.String projectKey,
                                                                                                 java.lang.String environmentKey,
                                                                                                 java.lang.String featureFlagKey,
                                                                                                 PatchFlagsRequest patchFlagsRequest)
                                                                                          throws ApiException
        Update expiring user targets on feature flag Schedule a user for removal from individual targeting on a feature flag. The flag must already individually target the user. You can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag. This request only supports semantic patches. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions #### addExpireUserTargetDate Adds a date and time that LaunchDarkly will remove the user from the flag's individual targeting. ##### Parameters * `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag * `variationId`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * `userKey`: The user key for the user to remove from individual targeting #### updateExpireUserTargetDate Updates the date and time that LaunchDarkly will remove the user from the flag's individual targeting. ##### Parameters * `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag * `variationId`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * `userKey`: The user key for the user to remove from individual targeting #### removeExpireUserTargetDate Removes the scheduled removal of the user from the flag's individual targeting. The user will remain part of the flag's individual targeting until you explicitly remove them, or until you schedule another removal. ##### Parameters * `variationId`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * `userKey`: The user key for the user to remove from individual targeting
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        patchFlagsRequest - (required)
        Returns:
        ApiResponse<ExpiringUserTargetPatchResponse>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchExpiringUserTargetsAsync

        public okhttp3.Call patchExpiringUserTargetsAsync​(java.lang.String projectKey,
                                                          java.lang.String environmentKey,
                                                          java.lang.String featureFlagKey,
                                                          PatchFlagsRequest patchFlagsRequest,
                                                          ApiCallback<ExpiringUserTargetPatchResponse> _callback)
                                                   throws ApiException
        Update expiring user targets on feature flag (asynchronously) Schedule a user for removal from individual targeting on a feature flag. The flag must already individually target the user. You can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag. This request only supports semantic patches. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions #### addExpireUserTargetDate Adds a date and time that LaunchDarkly will remove the user from the flag's individual targeting. ##### Parameters * `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag * `variationId`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * `userKey`: The user key for the user to remove from individual targeting #### updateExpireUserTargetDate Updates the date and time that LaunchDarkly will remove the user from the flag's individual targeting. ##### Parameters * `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag * `variationId`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * `userKey`: The user key for the user to remove from individual targeting #### removeExpireUserTargetDate Removes the scheduled removal of the user from the flag's individual targeting. The user will remain part of the flag's individual targeting until you explicitly remove them, or until you schedule another removal. ##### Parameters * `variationId`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. * `userKey`: The user key for the user to remove from individual targeting
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        featureFlagKey - The feature flag key (required)
        patchFlagsRequest - (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • patchFeatureFlagCall

        public okhttp3.Call patchFeatureFlagCall​(java.lang.String projectKey,
                                                 java.lang.String featureFlagKey,
                                                 PatchWithComment patchWithComment,
                                                 ApiCallback _callback)
                                          throws ApiException
        Build call for patchFeatureFlag
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        patchWithComment - (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • patchFeatureFlag

        public FeatureFlag patchFeatureFlag​(java.lang.String projectKey,
                                            java.lang.String featureFlagKey,
                                            PatchWithComment patchWithComment)
                                     throws ApiException
        Update feature flag Perform a partial update to a feature flag. The request body must be a valid semantic patch or JSON patch. ## Using semantic patches on a feature flag To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). The body of a semantic patch request for updating feature flags requires an `environmentKey` in addition to `instructions` and an optional `comment`. The body of the request takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): (Required) The key of the LaunchDarkly environment. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. ### Instructions Semantic patch requests support the following `kind` instructions for updating feature flags. <details> <summary>Click to expand instructions for turning flags on and off</summary> #### turnFlagOff Sets the flag's targeting state to **Off**. For example, to turn a flag off, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOff\" } ] } ``` #### turnFlagOn Sets the flag's targeting state to **On**. For example, to turn a flag on, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOn\" } ] } ``` </details><br /> <details> <summary>Click to expand instructions for working with targeting and variations</summary> #### addClauses Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### addPrerequisite Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag in the path parameter. ##### Parameters - `key`: Flag key of the prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. #### addRule Adds a new targeting rule to the flag. The rule may contain `clauses` and serve the variation that `variationId` indicates, or serve a percentage rollout that `rolloutWeights` and `rolloutBucketBy` indicate. If you set `beforeRuleId`, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. - `beforeRuleId`: (Optional) ID of a flag rule. - `variationId`: ID of a variation of the flag. - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) User attribute. #### addUserTargets Adds user keys to the individual user targets for the variation that `variationId` specifies. Returns an error if this causes the flag to target the same user key in multiple variations. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a variation on the flag. #### addValuesToClause Adds `values` to the values of the clause that `ruleId` and `clauseId` indicate. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings. #### clearUserTargets Removes all individual user targets from the variation that `variationId` specifies. ##### Parameters - `variationId`: ID of a variation on the flag. #### removeClauses Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseIds`: Array of IDs of clauses in the rule. #### removePrerequisite Removes the prerequisite flag indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. #### removeRule Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag. #### removeUserTargets Removes user keys from the individual user targets for the variation that `variationId` specifies. Does nothing if the flag does not target the user keys. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a flag variation. #### removeValuesFromClause Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings. #### reorderRules Rearranges the rules to match the order given in `ruleIds`. Returns an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag. #### replacePrerequisites Removes all existing prerequisites and replaces them with the list you provide. ##### Parameters - `prerequisites`: A list of prerequisites. Each item in the list must include a flag `key` and `variationId`. For example, to replace prerequisites, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"prereq-flag-key\", \"variationId\": \"variation-1\" }, { \"key\": \"another-prereq-flag-key\", \"variationId\": \"variation-2\" } ] } ] } ``` #### replaceRules Removes all targeting rules for the flag and replaces them with the list you provide. ##### Parameters - `rules`: A list of rules. For example, to replace rules, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"variation-1\", \"description\": \"myRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ] } ``` #### replaceUserTargets Removes all existing user targeting and replaces it with the list of targets you provide. ##### Parameters - `targets`: A list of user targeting. Each item in the list must include a `variationId` and a list of `values`. For example, to replace user targets, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"variation-1\", \"values\": [\"blah\", \"foo\", \"bar\"] }, { \"variationId\": \"variation-2\", \"values\": [\"abc\", \"def\"] } ] } ] } ``` #### updateClause Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `clause`: New `clause` object, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### updateFallthroughVariationOrRollout Updates the default or \"fallthrough\" rule for the flag, which the flag serves when a user matches none of the targeting rules. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: Optional user attribute. #### updateOffVariation Updates the default off variation to `variationId`. The flag serves the default off variation when the flag's targeting is **Off**. ##### Parameters - `variationId`: ID of a variation of the flag. #### updatePrerequisite Changes the prerequisite flag that `key` indicates to use the variation that `variationId` indicates. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. #### updateRuleDescription Updates the description of the feature flag rule. ##### Parameters - `description`: The new human-readable description for this rule. - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. #### updateRuleTrackEvents Updates whether or not LaunchDarkly tracks events for the feature flag associated with this rule. ##### Parameters - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. - `trackEvents`: Whether or not events are tracked. #### updateRuleVariationOrRollout Updates what `ruleId` serves when its clauses evaluate to true. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `ruleId`: ID of a rule in the flag. - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: Optional user attribute. #### updateTrackEvents Updates whether or not LaunchDarkly tracks events for the feature flag, for all rules. ##### Parameters - `trackEvents`: Whether or not events are tracked. #### updateTrackEventsFallthrough Updates whether or not LaunchDarkly tracks events for the feature flag, for the default rule. ##### Parameters - `trackEvents`: Whether or not events are tracked. </details><br /> <details> <summary>Click to expand instructions for updating flag settings</summary> #### addTags Adds tags to the feature flag. ##### Parameters - `values`: A list of tags to add. #### makeFlagPermanent Marks the feature flag as permanent. LaunchDarkly does not prompt you to remove permanent flags, even if one variation is rolled out to all your users. #### makeFlagTemporary Marks the feature flag as temporary. #### removeMaintainer Removes the flag's maintainer. To set a new maintainer, use the flag's **Settings** tab in the LaunchDarkly user interface. #### removeTags Removes tags from the feature flag. ##### Parameters - `values`: A list of tags to remove. #### turnOffClientSideAvailability Turns off client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. #### turnOnClientSideAvailability Turns on client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. #### updateDescription Updates the feature flag description. ##### Parameters - `value`: The new description. #### updateName Updates the feature flag name. ##### Parameters - `value`: The new name. </details><br /> <details> <summary>Click to expand instructions for updating the flag lifecycle</summary> #### archiveFlag Archives the feature flag. This retires it from LaunchDarkly without deleting it. You cannot archive a flag that is a prerequisite of other flags. #### deleteFlag Deletes the feature flag and its rules. You cannot restore a deleted flag. If this flag is requested again, the flag value defined in code will be returned for all users. #### restoreFlag Restores the feature flag if it was previously archived. </details> ### Example The body of a single semantic patch can contain many different instructions. <details> <summary>Click to expand example semantic patch request body</summary> ```json { \"environmentKey\": \"production\", \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"turnFlagOff\" }, { \"kind\": \"addUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId\", \"userId2\"] }, { \"kind\": \"removeUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId3\", \"userId4\"] }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": null }, { \"kind\": \"addRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } ], \"variationId\": null, \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": \"key\" }, { \"kind\": \"removeRule\", \"ruleId\": \"99f12464-a429-40fc-86cc-b27612188955\" }, { \"kind\": \"reorderRules\", \"ruleIds\": [\"2f72974e-de68-4243-8dd3-739582147a1f\", \"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"addClauses\", \"ruleId\": \"1134\", \"clauses\": [ { \"attribute\": \"email\", \"op\": \"in\", \"negate\": false, \"values\": [\"[email protected]\"] } ] }, { \"kind\": \"removeClauses\", \"ruleId\": \"1242529\", \"clauseIds\": [\"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"updateClause\", \"ruleId\": \"2f72974e-de68-4243-8dd3-739582147a1f\", \"clauseId\": \"309845\", \"clause\": { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } }, { \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"2342\", \"rolloutWeights\": null, \"rolloutBucketBy\": null }, { \"kind\": \"updateOffVariation\", \"variationId\": \"3242453\" }, { \"kind\": \"addPrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"updatePrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"removePrerequisite\", \"key\": \"flagKey\" } ] } ``` </details> ## Using JSON Patches on a feature flag If you do not include the header described above, you can use [JSON patch](/reference#updates-using-json-patch). When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation. If a flag variation already has users individually targeted, the path for the JSON Patch operation is: ```json { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ``` If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` ## Required approvals If a request attempts to alter a flag configuration in an environment where approvals are required for the flag, the request will fail with a 405. Changes to the flag configuration in that environment will require creating an [approval request](/tag/Approvals) or a [workflow](/tag/Workflows-(beta)). ## Conflicts If a flag configuration change made through this endpoint would cause a pending scheduled change or approval request to fail, this endpoint will return a 400. You can ignore this check by adding an `ignoreConflicts` query parameter set to `true`.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        patchWithComment - (required)
        Returns:
        FeatureFlag
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchFeatureFlagWithHttpInfo

        public ApiResponse<FeatureFlag> patchFeatureFlagWithHttpInfo​(java.lang.String projectKey,
                                                                     java.lang.String featureFlagKey,
                                                                     PatchWithComment patchWithComment)
                                                              throws ApiException
        Update feature flag Perform a partial update to a feature flag. The request body must be a valid semantic patch or JSON patch. ## Using semantic patches on a feature flag To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). The body of a semantic patch request for updating feature flags requires an `environmentKey` in addition to `instructions` and an optional `comment`. The body of the request takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): (Required) The key of the LaunchDarkly environment. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. ### Instructions Semantic patch requests support the following `kind` instructions for updating feature flags. <details> <summary>Click to expand instructions for turning flags on and off</summary> #### turnFlagOff Sets the flag's targeting state to **Off**. For example, to turn a flag off, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOff\" } ] } ``` #### turnFlagOn Sets the flag's targeting state to **On**. For example, to turn a flag on, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOn\" } ] } ``` </details><br /> <details> <summary>Click to expand instructions for working with targeting and variations</summary> #### addClauses Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### addPrerequisite Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag in the path parameter. ##### Parameters - `key`: Flag key of the prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. #### addRule Adds a new targeting rule to the flag. The rule may contain `clauses` and serve the variation that `variationId` indicates, or serve a percentage rollout that `rolloutWeights` and `rolloutBucketBy` indicate. If you set `beforeRuleId`, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. - `beforeRuleId`: (Optional) ID of a flag rule. - `variationId`: ID of a variation of the flag. - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) User attribute. #### addUserTargets Adds user keys to the individual user targets for the variation that `variationId` specifies. Returns an error if this causes the flag to target the same user key in multiple variations. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a variation on the flag. #### addValuesToClause Adds `values` to the values of the clause that `ruleId` and `clauseId` indicate. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings. #### clearUserTargets Removes all individual user targets from the variation that `variationId` specifies. ##### Parameters - `variationId`: ID of a variation on the flag. #### removeClauses Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseIds`: Array of IDs of clauses in the rule. #### removePrerequisite Removes the prerequisite flag indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. #### removeRule Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag. #### removeUserTargets Removes user keys from the individual user targets for the variation that `variationId` specifies. Does nothing if the flag does not target the user keys. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a flag variation. #### removeValuesFromClause Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings. #### reorderRules Rearranges the rules to match the order given in `ruleIds`. Returns an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag. #### replacePrerequisites Removes all existing prerequisites and replaces them with the list you provide. ##### Parameters - `prerequisites`: A list of prerequisites. Each item in the list must include a flag `key` and `variationId`. For example, to replace prerequisites, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"prereq-flag-key\", \"variationId\": \"variation-1\" }, { \"key\": \"another-prereq-flag-key\", \"variationId\": \"variation-2\" } ] } ] } ``` #### replaceRules Removes all targeting rules for the flag and replaces them with the list you provide. ##### Parameters - `rules`: A list of rules. For example, to replace rules, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"variation-1\", \"description\": \"myRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ] } ``` #### replaceUserTargets Removes all existing user targeting and replaces it with the list of targets you provide. ##### Parameters - `targets`: A list of user targeting. Each item in the list must include a `variationId` and a list of `values`. For example, to replace user targets, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"variation-1\", \"values\": [\"blah\", \"foo\", \"bar\"] }, { \"variationId\": \"variation-2\", \"values\": [\"abc\", \"def\"] } ] } ] } ``` #### updateClause Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `clause`: New `clause` object, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### updateFallthroughVariationOrRollout Updates the default or \"fallthrough\" rule for the flag, which the flag serves when a user matches none of the targeting rules. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: Optional user attribute. #### updateOffVariation Updates the default off variation to `variationId`. The flag serves the default off variation when the flag's targeting is **Off**. ##### Parameters - `variationId`: ID of a variation of the flag. #### updatePrerequisite Changes the prerequisite flag that `key` indicates to use the variation that `variationId` indicates. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. #### updateRuleDescription Updates the description of the feature flag rule. ##### Parameters - `description`: The new human-readable description for this rule. - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. #### updateRuleTrackEvents Updates whether or not LaunchDarkly tracks events for the feature flag associated with this rule. ##### Parameters - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. - `trackEvents`: Whether or not events are tracked. #### updateRuleVariationOrRollout Updates what `ruleId` serves when its clauses evaluate to true. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `ruleId`: ID of a rule in the flag. - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: Optional user attribute. #### updateTrackEvents Updates whether or not LaunchDarkly tracks events for the feature flag, for all rules. ##### Parameters - `trackEvents`: Whether or not events are tracked. #### updateTrackEventsFallthrough Updates whether or not LaunchDarkly tracks events for the feature flag, for the default rule. ##### Parameters - `trackEvents`: Whether or not events are tracked. </details><br /> <details> <summary>Click to expand instructions for updating flag settings</summary> #### addTags Adds tags to the feature flag. ##### Parameters - `values`: A list of tags to add. #### makeFlagPermanent Marks the feature flag as permanent. LaunchDarkly does not prompt you to remove permanent flags, even if one variation is rolled out to all your users. #### makeFlagTemporary Marks the feature flag as temporary. #### removeMaintainer Removes the flag's maintainer. To set a new maintainer, use the flag's **Settings** tab in the LaunchDarkly user interface. #### removeTags Removes tags from the feature flag. ##### Parameters - `values`: A list of tags to remove. #### turnOffClientSideAvailability Turns off client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. #### turnOnClientSideAvailability Turns on client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. #### updateDescription Updates the feature flag description. ##### Parameters - `value`: The new description. #### updateName Updates the feature flag name. ##### Parameters - `value`: The new name. </details><br /> <details> <summary>Click to expand instructions for updating the flag lifecycle</summary> #### archiveFlag Archives the feature flag. This retires it from LaunchDarkly without deleting it. You cannot archive a flag that is a prerequisite of other flags. #### deleteFlag Deletes the feature flag and its rules. You cannot restore a deleted flag. If this flag is requested again, the flag value defined in code will be returned for all users. #### restoreFlag Restores the feature flag if it was previously archived. </details> ### Example The body of a single semantic patch can contain many different instructions. <details> <summary>Click to expand example semantic patch request body</summary> ```json { \"environmentKey\": \"production\", \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"turnFlagOff\" }, { \"kind\": \"addUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId\", \"userId2\"] }, { \"kind\": \"removeUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId3\", \"userId4\"] }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": null }, { \"kind\": \"addRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } ], \"variationId\": null, \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": \"key\" }, { \"kind\": \"removeRule\", \"ruleId\": \"99f12464-a429-40fc-86cc-b27612188955\" }, { \"kind\": \"reorderRules\", \"ruleIds\": [\"2f72974e-de68-4243-8dd3-739582147a1f\", \"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"addClauses\", \"ruleId\": \"1134\", \"clauses\": [ { \"attribute\": \"email\", \"op\": \"in\", \"negate\": false, \"values\": [\"[email protected]\"] } ] }, { \"kind\": \"removeClauses\", \"ruleId\": \"1242529\", \"clauseIds\": [\"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"updateClause\", \"ruleId\": \"2f72974e-de68-4243-8dd3-739582147a1f\", \"clauseId\": \"309845\", \"clause\": { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } }, { \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"2342\", \"rolloutWeights\": null, \"rolloutBucketBy\": null }, { \"kind\": \"updateOffVariation\", \"variationId\": \"3242453\" }, { \"kind\": \"addPrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"updatePrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"removePrerequisite\", \"key\": \"flagKey\" } ] } ``` </details> ## Using JSON Patches on a feature flag If you do not include the header described above, you can use [JSON patch](/reference#updates-using-json-patch). When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation. If a flag variation already has users individually targeted, the path for the JSON Patch operation is: ```json { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ``` If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` ## Required approvals If a request attempts to alter a flag configuration in an environment where approvals are required for the flag, the request will fail with a 405. Changes to the flag configuration in that environment will require creating an [approval request](/tag/Approvals) or a [workflow](/tag/Workflows-(beta)). ## Conflicts If a flag configuration change made through this endpoint would cause a pending scheduled change or approval request to fail, this endpoint will return a 400. You can ignore this check by adding an `ignoreConflicts` query parameter set to `true`.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        patchWithComment - (required)
        Returns:
        ApiResponse<FeatureFlag>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchFeatureFlagAsync

        public okhttp3.Call patchFeatureFlagAsync​(java.lang.String projectKey,
                                                  java.lang.String featureFlagKey,
                                                  PatchWithComment patchWithComment,
                                                  ApiCallback<FeatureFlag> _callback)
                                           throws ApiException
        Update feature flag (asynchronously) Perform a partial update to a feature flag. The request body must be a valid semantic patch or JSON patch. ## Using semantic patches on a feature flag To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). The body of a semantic patch request for updating feature flags requires an `environmentKey` in addition to `instructions` and an optional `comment`. The body of the request takes the following properties: * `comment` (string): (Optional) A description of the update. * `environmentKey` (string): (Required) The key of the LaunchDarkly environment. * `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. ### Instructions Semantic patch requests support the following `kind` instructions for updating feature flags. <details> <summary>Click to expand instructions for turning flags on and off</summary> #### turnFlagOff Sets the flag's targeting state to **Off**. For example, to turn a flag off, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOff\" } ] } ``` #### turnFlagOn Sets the flag's targeting state to **On**. For example, to turn a flag on, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"turnFlagOn\" } ] } ``` </details><br /> <details> <summary>Click to expand instructions for working with targeting and variations</summary> #### addClauses Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### addPrerequisite Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag in the path parameter. ##### Parameters - `key`: Flag key of the prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. #### addRule Adds a new targeting rule to the flag. The rule may contain `clauses` and serve the variation that `variationId` indicates, or serve a percentage rollout that `rolloutWeights` and `rolloutBucketBy` indicate. If you set `beforeRuleId`, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list. ##### Parameters - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. - `beforeRuleId`: (Optional) ID of a flag rule. - `variationId`: ID of a variation of the flag. - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: (Optional) User attribute. #### addUserTargets Adds user keys to the individual user targets for the variation that `variationId` specifies. Returns an error if this causes the flag to target the same user key in multiple variations. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a variation on the flag. #### addValuesToClause Adds `values` to the values of the clause that `ruleId` and `clauseId` indicate. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings. #### clearUserTargets Removes all individual user targets from the variation that `variationId` specifies. ##### Parameters - `variationId`: ID of a variation on the flag. #### removeClauses Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseIds`: Array of IDs of clauses in the rule. #### removePrerequisite Removes the prerequisite flag indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. #### removeRule Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag. #### removeUserTargets Removes user keys from the individual user targets for the variation that `variationId` specifies. Does nothing if the flag does not target the user keys. ##### Parameters - `values`: List of user keys. - `variationId`: ID of a flag variation. #### removeValuesFromClause Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `values`: Array of strings. #### reorderRules Rearranges the rules to match the order given in `ruleIds`. Returns an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag. #### replacePrerequisites Removes all existing prerequisites and replaces them with the list you provide. ##### Parameters - `prerequisites`: A list of prerequisites. Each item in the list must include a flag `key` and `variationId`. For example, to replace prerequisites, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"prereq-flag-key\", \"variationId\": \"variation-1\" }, { \"key\": \"another-prereq-flag-key\", \"variationId\": \"variation-2\" } ] } ] } ``` #### replaceRules Removes all targeting rules for the flag and replaces them with the list you provide. ##### Parameters - `rules`: A list of rules. For example, to replace rules, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"variation-1\", \"description\": \"myRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ] } ``` #### replaceUserTargets Removes all existing user targeting and replaces it with the list of targets you provide. ##### Parameters - `targets`: A list of user targeting. Each item in the list must include a `variationId` and a list of `values`. For example, to replace user targets, use this request body: ```json { \"environmentKey\": \"example-environment-key\", \"instructions\": [ { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"variation-1\", \"values\": [\"blah\", \"foo\", \"bar\"] }, { \"variationId\": \"variation-2\", \"values\": [\"abc\", \"def\"] } ] } ] } ``` #### updateClause Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag. - `clauseId`: ID of a clause in that rule. - `clause`: New `clause` object, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### updateFallthroughVariationOrRollout Updates the default or \"fallthrough\" rule for the flag, which the flag serves when a user matches none of the targeting rules. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: Optional user attribute. #### updateOffVariation Updates the default off variation to `variationId`. The flag serves the default off variation when the flag's targeting is **Off**. ##### Parameters - `variationId`: ID of a variation of the flag. #### updatePrerequisite Changes the prerequisite flag that `key` indicates to use the variation that `variationId` indicates. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: Flag key of an existing prerequisite flag. - `variationId`: ID of a variation of the prerequisite flag. #### updateRuleDescription Updates the description of the feature flag rule. ##### Parameters - `description`: The new human-readable description for this rule. - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. #### updateRuleTrackEvents Updates whether or not LaunchDarkly tracks events for the feature flag associated with this rule. ##### Parameters - `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag. - `trackEvents`: Whether or not events are tracked. #### updateRuleVariationOrRollout Updates what `ruleId` serves when its clauses evaluate to true. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate. ##### Parameters - `ruleId`: ID of a rule in the flag. - `variationId`: ID of a variation of the flag. or - `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000). - `rolloutBucketBy`: Optional user attribute. #### updateTrackEvents Updates whether or not LaunchDarkly tracks events for the feature flag, for all rules. ##### Parameters - `trackEvents`: Whether or not events are tracked. #### updateTrackEventsFallthrough Updates whether or not LaunchDarkly tracks events for the feature flag, for the default rule. ##### Parameters - `trackEvents`: Whether or not events are tracked. </details><br /> <details> <summary>Click to expand instructions for updating flag settings</summary> #### addTags Adds tags to the feature flag. ##### Parameters - `values`: A list of tags to add. #### makeFlagPermanent Marks the feature flag as permanent. LaunchDarkly does not prompt you to remove permanent flags, even if one variation is rolled out to all your users. #### makeFlagTemporary Marks the feature flag as temporary. #### removeMaintainer Removes the flag's maintainer. To set a new maintainer, use the flag's **Settings** tab in the LaunchDarkly user interface. #### removeTags Removes tags from the feature flag. ##### Parameters - `values`: A list of tags to remove. #### turnOffClientSideAvailability Turns off client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. #### turnOnClientSideAvailability Turns on client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them. ##### Parameters - `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs. #### updateDescription Updates the feature flag description. ##### Parameters - `value`: The new description. #### updateName Updates the feature flag name. ##### Parameters - `value`: The new name. </details><br /> <details> <summary>Click to expand instructions for updating the flag lifecycle</summary> #### archiveFlag Archives the feature flag. This retires it from LaunchDarkly without deleting it. You cannot archive a flag that is a prerequisite of other flags. #### deleteFlag Deletes the feature flag and its rules. You cannot restore a deleted flag. If this flag is requested again, the flag value defined in code will be returned for all users. #### restoreFlag Restores the feature flag if it was previously archived. </details> ### Example The body of a single semantic patch can contain many different instructions. <details> <summary>Click to expand example semantic patch request body</summary> ```json { \"environmentKey\": \"production\", \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"turnFlagOff\" }, { \"kind\": \"addUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId\", \"userId2\"] }, { \"kind\": \"removeUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId3\", \"userId4\"] }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": null }, { \"kind\": \"addRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } ], \"variationId\": null, \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": \"key\" }, { \"kind\": \"removeRule\", \"ruleId\": \"99f12464-a429-40fc-86cc-b27612188955\" }, { \"kind\": \"reorderRules\", \"ruleIds\": [\"2f72974e-de68-4243-8dd3-739582147a1f\", \"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"addClauses\", \"ruleId\": \"1134\", \"clauses\": [ { \"attribute\": \"email\", \"op\": \"in\", \"negate\": false, \"values\": [\"[email protected]\"] } ] }, { \"kind\": \"removeClauses\", \"ruleId\": \"1242529\", \"clauseIds\": [\"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"updateClause\", \"ruleId\": \"2f72974e-de68-4243-8dd3-739582147a1f\", \"clauseId\": \"309845\", \"clause\": { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } }, { \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"2342\", \"rolloutWeights\": null, \"rolloutBucketBy\": null }, { \"kind\": \"updateOffVariation\", \"variationId\": \"3242453\" }, { \"kind\": \"addPrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"updatePrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"removePrerequisite\", \"key\": \"flagKey\" } ] } ``` </details> ## Using JSON Patches on a feature flag If you do not include the header described above, you can use [JSON patch](/reference#updates-using-json-patch). When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation. If a flag variation already has users individually targeted, the path for the JSON Patch operation is: ```json { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ``` If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` ## Required approvals If a request attempts to alter a flag configuration in an environment where approvals are required for the flag, the request will fail with a 405. Changes to the flag configuration in that environment will require creating an [approval request](/tag/Approvals) or a [workflow](/tag/Workflows-(beta)). ## Conflicts If a flag configuration change made through this endpoint would cause a pending scheduled change or approval request to fail, this endpoint will return a 400. You can ignore this check by adding an `ignoreConflicts` query parameter set to `true`.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key. The key identifies the flag in your code. (required)
        patchWithComment - (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • postFeatureFlagCall

        public okhttp3.Call postFeatureFlagCall​(java.lang.String projectKey,
                                                FeatureFlagBody featureFlagBody,
                                                java.lang.String clone,
                                                ApiCallback _callback)
                                         throws ApiException
        Build call for postFeatureFlag
        Parameters:
        projectKey - The project key (required)
        featureFlagBody - (required)
        clone - The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • postFeatureFlag

        public FeatureFlag postFeatureFlag​(java.lang.String projectKey,
                                           FeatureFlagBody featureFlagBody,
                                           java.lang.String clone)
                                    throws ApiException
        Create a feature flag Create a feature flag with the given name, key, and variations.
        Parameters:
        projectKey - The project key (required)
        featureFlagBody - (required)
        clone - The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. (optional)
        Returns:
        FeatureFlag
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • postFeatureFlagWithHttpInfo

        public ApiResponse<FeatureFlag> postFeatureFlagWithHttpInfo​(java.lang.String projectKey,
                                                                    FeatureFlagBody featureFlagBody,
                                                                    java.lang.String clone)
                                                             throws ApiException
        Create a feature flag Create a feature flag with the given name, key, and variations.
        Parameters:
        projectKey - The project key (required)
        featureFlagBody - (required)
        clone - The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. (optional)
        Returns:
        ApiResponse<FeatureFlag>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • postFeatureFlagAsync

        public okhttp3.Call postFeatureFlagAsync​(java.lang.String projectKey,
                                                 FeatureFlagBody featureFlagBody,
                                                 java.lang.String clone,
                                                 ApiCallback<FeatureFlag> _callback)
                                          throws ApiException
        Create a feature flag (asynchronously) Create a feature flag with the given name, key, and variations.
        Parameters:
        projectKey - The project key (required)
        featureFlagBody - (required)
        clone - The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. (optional)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object