# Search features GET https://app.unleash-instance.example.com/api/admin/search/features Search and filter by selected fields. Reference: https://docs.getunleash.io/api/search-features ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Search and filter features version: endpoint_search.features paths: /api/admin/search/features: get: operationId: features summary: Search and filter features description: Search and filter by selected fields. tags: - - subpackage_search parameters: - name: query in: query description: The search query for the feature name or tag required: false schema: type: string - name: project in: query description: >- Id of the project where search and filter is performed. The project id can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF. required: false schema: type: string - name: state in: query description: >- The state of the feature active/stale. The state can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF. required: false schema: type: string - name: lifecycle in: query description: >- The lifecycle stage of the feature. The stagee can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF. required: false schema: type: string - name: type in: query description: >- The feature flag type to filter by. The type can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF. required: false schema: type: string - name: createdBy in: query description: >- The feature flag creator to filter by. The creators can be specified with an operator. The supported operators are IS, IS_NOT, IS_ANY_OF, IS_NONE_OF. required: false schema: type: string - name: tag in: query description: >- The list of feature tags to filter by. Feature tag has to specify a type and a value joined with a colon. required: false schema: type: string - name: segment in: query description: >- The list of segments with operators to filter by. The segment valid operators are INCLUDE, DO_NOT_INCLUDE, INCLUDE_ALL_OF, INCLUDE_ANY_OF, EXCLUDE_IF_ANY_OF, EXCLUDE_ALL. required: false schema: type: string - name: status in: query description: >- The list of feature environment status to filter by. Feature environment has to specify a name and a status joined with a colon. required: false schema: type: array items: type: string - name: offset in: query description: >- The number of features to skip when returning a page. By default it is set to 0. required: false schema: type: string - name: limit in: query description: >- The number of feature environments to return in a page. By default it is set to 50. required: false schema: type: string - name: sortBy in: query description: >- The field to sort the results by. By default it is set to "createdAt". required: false schema: type: string - name: sortOrder in: query description: The sort order for the sortBy. By default it is det to "asc". required: false schema: $ref: '#/components/schemas/ApiAdminSearchFeaturesGetParametersSortOrder' - name: favoritesFirst in: query description: >- The flag to indicate if the favorite features should be returned first. By default it is set to false. required: false schema: type: string - name: archived in: query description: >- Whether to get results for archived feature flags or active feature flags. If `IS:true`, Unleash will return only archived flags. If `IS:false`, it will return only active flags. required: false schema: type: string - name: createdAt in: query description: >- The date the feature was created. The date can be specified with an operator. The supported operators are IS_BEFORE, IS_ON_OR_AFTER. required: false schema: type: string - name: lastSeenAt in: query description: >- The date the feature was last seen from metrics. The date can be specified with an operator. The supported operators are IS_BEFORE, IS_ON_OR_AFTER. required: false schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: searchFeaturesSchema content: application/json: schema: $ref: '#/components/schemas/searchFeaturesSchema' '401': description: >- Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`. content: {} '403': description: >- The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation content: {} '404': description: The requested resource was not found. content: {} components: schemas: ApiAdminSearchFeaturesGetParametersSortOrder: type: string enum: - value: asc - value: desc FeatureSearchResponseSchemaDependencyType: type: string enum: - value: parent - value: child ConstraintSchemaOperator: type: string enum: - value: NOT_IN - value: IN - value: STR_ENDS_WITH - value: STR_STARTS_WITH - value: STR_CONTAINS - value: NUM_EQ - value: NUM_GT - value: NUM_GTE - value: NUM_LT - value: NUM_LTE - value: DATE_AFTER - value: DATE_BEFORE - value: SEMVER_EQ - value: SEMVER_GT - value: SEMVER_LT constraintSchema: type: object properties: contextName: type: string description: The name of the context field that this constraint should apply to. operator: $ref: '#/components/schemas/ConstraintSchemaOperator' description: >- The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/concepts/activation-strategies#constraint-operators). caseInsensitive: type: boolean default: false description: >- Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive). inverted: type: boolean default: false description: >- Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa. values: type: array items: type: string description: >- The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values. value: type: string description: >- The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values. required: - contextName - operator StrategyVariantSchemaWeightType: type: string enum: - value: variable - value: fix StrategyVariantSchemaPayloadType: type: string enum: - value: json - value: csv - value: string - value: number StrategyVariantSchemaPayload: type: object properties: type: $ref: '#/components/schemas/StrategyVariantSchemaPayloadType' description: >- The type of the value. Commonly used types are string, number, json and csv. value: type: string description: The actual value of payload required: - type - value strategyVariantSchema: type: object properties: name: type: string description: The variant name. Must be unique for this feature flag weight: type: integer description: >- The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information weightType: $ref: '#/components/schemas/StrategyVariantSchemaWeightType' description: >- Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight). stickiness: type: string description: >- The [stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time payload: $ref: '#/components/schemas/StrategyVariantSchemaPayload' description: Extra data configured for this variant required: - name - weight - weightType - stickiness parametersSchema: type: object additionalProperties: type: string featureStrategySchema: type: object properties: id: type: string description: A uuid for the feature strategy name: type: string description: The name or type of strategy title: type: - string - 'null' description: A descriptive title for the strategy disabled: type: - boolean - 'null' description: >- A toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs featureName: type: string description: The name or feature the strategy is attached to sortOrder: type: number format: double description: The order of the strategy in the list segments: type: array items: type: number format: double description: A list of segment ids attached to the strategy constraints: type: array items: $ref: '#/components/schemas/constraintSchema' description: >- A list of the constraints attached to the strategy. See https://docs.getunleash.io/concepts/activation-strategies#constraints variants: type: array items: $ref: '#/components/schemas/strategyVariantSchema' description: Strategy level variants parameters: $ref: '#/components/schemas/parametersSchema' required: - name VariantSchemaWeightType: type: string enum: - value: variable - value: fix VariantSchemaPayloadType: type: string enum: - value: json - value: csv - value: string - value: number VariantSchemaPayload: type: object properties: type: $ref: '#/components/schemas/VariantSchemaPayloadType' description: >- The type of the value. Commonly used types are string, number, json and csv. value: type: string description: The actual value of payload required: - type - value overrideSchema: type: object properties: contextName: type: string description: The name of the context field used to determine overrides values: type: array items: type: string description: Which values that should be overriden required: - contextName - values variantSchema: type: object properties: name: type: string description: The variants name. Is unique for this feature flag weight: type: number format: double description: >- The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information weightType: $ref: '#/components/schemas/VariantSchemaWeightType' description: >- Set to fix if this variant must have exactly the weight allocated to it. If the type is variable, the weight will adjust so that the total weight of all variants adds up to 1000 stickiness: type: string description: >- [Stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) is how Unleash guarantees that the same user gets the same variant every time payload: $ref: '#/components/schemas/VariantSchemaPayload' description: Extra data configured for this variant overrides: type: array items: $ref: '#/components/schemas/overrideSchema' description: >- Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence. required: - name - weight ReleasePlanSchemaDiscriminator: type: string enum: - value: plan ReleasePlanMilestoneSchemaTransitionCondition: type: object properties: intervalMinutes: type: integer description: The interval in minutes before transitioning required: - intervalMinutes CreateStrategyVariantSchemaWeightType: type: string enum: - value: variable - value: fix CreateStrategyVariantSchemaPayloadType: type: string enum: - value: json - value: csv - value: string - value: number CreateStrategyVariantSchemaPayload: type: object properties: type: $ref: '#/components/schemas/CreateStrategyVariantSchemaPayloadType' description: >- The type of the value. Commonly used types are string, number, json and csv. value: type: string description: The actual value of payload required: - type - value createStrategyVariantSchema: type: object properties: name: type: string description: The variant name. Must be unique for this feature flag weight: type: integer description: >- The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information weightType: $ref: '#/components/schemas/CreateStrategyVariantSchemaWeightType' description: >- Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight). stickiness: type: string description: >- The [stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time payload: $ref: '#/components/schemas/CreateStrategyVariantSchemaPayload' description: Extra data configured for this variant required: - name - weight - weightType - stickiness releasePlanMilestoneStrategySchema: type: object properties: id: type: string description: The milestone strategy's ID. Milestone strategy IDs are ulids. milestoneId: type: string description: The ID of the milestone that this strategy belongs to. sortOrder: type: number format: double description: The order of the strategy in the list title: type: - string - 'null' description: A descriptive title for the strategy strategyName: type: string description: The name of the strategy type parameters: $ref: '#/components/schemas/parametersSchema' description: An object containing the parameters for the strategy constraints: type: array items: $ref: '#/components/schemas/constraintSchema' description: >- A list of the constraints attached to the strategy. See https://docs.getunleash.io/concepts/activation-strategies#constraints variants: type: array items: $ref: '#/components/schemas/createStrategyVariantSchema' description: Strategy level variants segments: type: array items: type: number format: double description: Ids of segments to use for this strategy required: - id - milestoneId - sortOrder - strategyName releasePlanMilestoneSchema: type: object properties: id: type: string description: The milestone's ID. Milestone IDs are ulids. name: type: string description: The name of the milestone. sortOrder: type: integer description: The order of the milestone in the release plan. releasePlanDefinitionId: type: string description: The ID of the release plan/template that this milestone belongs to. startedAt: type: - string - 'null' format: date-time description: The date and time when the milestone was started. transitionCondition: oneOf: - $ref: >- #/components/schemas/ReleasePlanMilestoneSchemaTransitionCondition - type: 'null' description: The condition configuration for the transition progressionExecutedAt: type: - string - 'null' format: date-time description: The date and time when the milestone progression was executed. pausedAt: type: - string - 'null' format: date-time description: The date and time when the milestone was paused. strategies: type: array items: $ref: '#/components/schemas/releasePlanMilestoneStrategySchema' description: A list of strategies that are attached to this milestone. required: - id - name - sortOrder - releasePlanDefinitionId SafeguardSchemaAction: type: object properties: type: type: string description: The type of action to perform. id: type: string description: The ID of the release plan this safeguard applies to. required: - type - id SafeguardTriggerConditionSchemaOperator: type: string enum: - value: '>' - value: < safeguardTriggerConditionSchema: type: object properties: operator: $ref: '#/components/schemas/SafeguardTriggerConditionSchemaOperator' description: The comparison operator for the threshold check. threshold: type: number format: double description: The threshold value to compare against. required: - operator - threshold SafeguardSchemaImpactMetricTimeRange: type: string enum: - value: hour - value: day - value: week - value: month SafeguardSchemaImpactMetricAggregationMode: type: string enum: - value: rps - value: count - value: avg - value: sum - value: p95 - value: p99 - value: p50 SafeguardSchemaImpactMetric: type: object properties: id: type: string description: The unique identifier for this impact metric metricName: type: string description: >- The Prometheus metric series to query. It includes both unleash prefix and metric type and display name timeRange: $ref: '#/components/schemas/SafeguardSchemaImpactMetricTimeRange' description: The time range for the metric data. aggregationMode: $ref: '#/components/schemas/SafeguardSchemaImpactMetricAggregationMode' description: The aggregation mode for the metric data. labelSelectors: type: object additionalProperties: type: array items: type: string description: The selected labels and their values for filtering the metric data. required: - id - metricName - timeRange - aggregationMode - labelSelectors safeguardSchema: type: object properties: id: type: string description: The unique ULID identifier for this safeguard action: $ref: '#/components/schemas/SafeguardSchemaAction' description: The action to take when the safeguard is triggered. triggerCondition: $ref: '#/components/schemas/safeguardTriggerConditionSchema' description: The condition that triggers the safeguard. impactMetric: $ref: '#/components/schemas/SafeguardSchemaImpactMetric' description: The metric configuration used to evaluate the safeguard condition. required: - id - action - triggerCondition - impactMetric releasePlanSchema: type: object properties: id: type: string description: The release plan/template's ID. Release template IDs are ulids. discriminator: $ref: '#/components/schemas/ReleasePlanSchemaDiscriminator' description: A field to distinguish between release plans and release templates. name: type: string description: The name of the release template. description: type: - string - 'null' description: A description of the release template. featureName: type: string description: The name of the feature that uses this release plan. environment: type: string description: The environment that this release plan is for. createdByUserId: type: number format: double description: 'Release template: The ID of the user who created this template.' createdAt: type: string format: date-time description: The date and time that the release template was created. activeMilestoneId: type: - string - 'null' description: The ID of the currently active milestone in this release plan. milestones: type: array items: $ref: '#/components/schemas/releasePlanMilestoneSchema' description: A list of the milestones in this release template. releasePlanTemplateId: type: string description: >- The ID of the release plan template that this release plan is based on. safeguards: type: array items: $ref: '#/components/schemas/safeguardSchema' description: An array of safeguards configured for this release plan. required: - id - discriminator - name - featureName - environment - createdByUserId - createdAt - milestones - releasePlanTemplateId featureSearchEnvironmentSchema: type: object properties: name: type: string description: The name of the environment featureName: type: string description: The name of the feature environment: type: string description: The name of the environment type: type: string description: The type of the environment enabled: type: boolean description: >- `true` if the feature is enabled for the environment, otherwise `false`. sortOrder: type: number format: double description: >- The sort order of the feature environment in the feature environments list variantCount: type: number format: double description: The number of defined variants strategies: type: array items: $ref: '#/components/schemas/featureStrategySchema' description: A list of activation strategies for the feature environment variants: type: array items: $ref: '#/components/schemas/variantSchema' description: A list of variants for the feature environment changeRequestIds: type: array items: type: number format: double description: >- Experimental. A list of change request identifiers for actionable change requests that are not Cancelled, Rejected or Approved. milestoneName: type: string description: >- Experimental: The name of the currently active release plan milestone milestoneOrder: type: number format: double description: >- Experimental: The zero-indexed order of currently active milestone in the list of all release plan milestones totalMilestones: type: number format: double description: >- Experimental: The total number of milestones in the feature environment release plan lastSeenAt: type: - string - 'null' format: date-time description: >- The date when metrics where last collected for the feature environment hasStrategies: type: boolean description: Whether the feature has any strategies defined. hasEnabledStrategies: type: boolean description: Whether the feature has any enabled strategies defined. releasePlans: type: array items: $ref: '#/components/schemas/releasePlanSchema' description: >- Release plans for this feature environment (only available when milestoneProgression feature flag is enabled) 'yes': type: integer description: How many times the toggle evaluated to true in last hour bucket 'no': type: integer description: How many times the toggle evaluated to false in last hour bucket required: - name - type - enabled FeatureSearchResponseSchemaStrategiesItems: type: object properties: {} tagSchema: type: object properties: value: type: string description: The value of the tag. type: type: string description: >- The [type](https://docs.getunleash.io/concepts/feature-flags#tags) of the tag color: type: - string - 'null' description: The hexadecimal color code for the tag type. required: - value - type FeatureSearchResponseSchemaLifecycleStage: type: string enum: - value: initial - value: pre-live - value: live - value: completed - value: archived FeatureSearchResponseSchemaLifecycle: type: object properties: stage: $ref: '#/components/schemas/FeatureSearchResponseSchemaLifecycleStage' description: The name of the current lifecycle stage status: type: - string - 'null' description: >- The name of the detailed status of a given stage. E.g. completed stage can be kept or discarded. enteredStageAt: type: string format: date-time description: When the feature entered this stage required: - stage - enteredStageAt FeatureSearchResponseSchemaCreatedBy: type: object properties: id: type: integer description: The user id name: type: string description: Name of the user imageUrl: type: string description: URL used for the user profile image required: - id - name - imageUrl featureSearchResponseSchema: type: object properties: name: type: string description: Unique feature name type: type: string description: >- Type of the flag e.g. experiment, kill-switch, release, operational, permission description: type: - string - 'null' description: Detailed description of the feature dependencyType: oneOf: - $ref: '#/components/schemas/FeatureSearchResponseSchemaDependencyType' - type: 'null' description: >- The type of dependency. 'parent' means that the feature is a parent feature, 'child' means that the feature is a child feature. project: type: string description: Name of the project the feature belongs to stale: type: boolean description: >- `true` if the feature is stale based on the age and feature type, otherwise `false`. favorite: type: boolean description: '`true` if the feature was favorited, otherwise `false`.' impressionData: type: boolean description: >- `true` if the impression data collection is enabled for the feature, otherwise `false`. createdAt: type: - string - 'null' format: date-time description: The date the feature was created archivedAt: type: - string - 'null' format: date-time description: The date the feature was archived lastSeenAt: type: - string - 'null' format: date-time description: >- The date when metrics where last collected for the feature. This field was deprecated in v5 and will be removed in a future release, use the one in featureEnvironmentSchema environments: type: array items: $ref: '#/components/schemas/featureSearchEnvironmentSchema' description: The list of environments where the feature can be used segments: type: array items: type: string description: The list of segments the feature is enabled for. variants: type: array items: $ref: '#/components/schemas/variantSchema' description: The list of feature variants. This field was deprecated in v5 strategies: type: array items: $ref: '#/components/schemas/FeatureSearchResponseSchemaStrategiesItems' description: This is a legacy field that was deprecated in v5 tags: type: - array - 'null' items: $ref: '#/components/schemas/tagSchema' description: The list of feature tags lifecycle: $ref: '#/components/schemas/FeatureSearchResponseSchemaLifecycle' description: Current lifecycle stage of the feature createdBy: $ref: '#/components/schemas/FeatureSearchResponseSchemaCreatedBy' description: User who created the feature flag required: - name - type - description - dependencyType - project - stale - favorite - impressionData - createdAt - archivedAt - environments - segments - createdBy searchFeaturesSchema: type: object properties: features: type: array items: $ref: '#/components/schemas/featureSearchResponseSchema' description: >- The full list of features in this project matching search and filter criteria. total: type: number format: double description: Total count of the features matching search and filter criteria required: - features ``` ## SDK Code Examples ```python import requests url = "https://app.unleash-instance.example.com/api/admin/search/features" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/search/features'; const options = {method: 'GET', headers: {Authorization: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.unleash-instance.example.com/api/admin/search/features" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.unleash-instance.example.com/api/admin/search/features") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.unleash-instance.example.com/api/admin/search/features") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/admin/search/features', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/search/features"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://app.unleash-instance.example.com/api/admin/search/features")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```