> ## Documentation Index
> Fetch the complete documentation index at: https://confidence.spotify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Resolves Flag

> Resolve multiple flags into variants and values. This method resolves
 all flags that are enabled for the given client, or a subset of them
 specified in the request.
 A flag is resolved by evaluating its rules in order, a rule matches if:
 1) it is enabled, 2) the referred segment is active, and 3) the
 randomization unit is in the population indicated by the segment's
 targeting criteria and population allocation. The first rule that matches
 will assign a variant and value to the unit. Archived flags are not included.



## OpenAPI

````yaml /api/flags/api/resolve.openapi.json post /v1/flags:resolve
openapi: 3.1.0
info:
  title: Confidence Resolve API
  version: 1.0.0
  description: API documentation for resolve
servers: []
security: []
paths:
  /v1/flags:resolve:
    post:
      summary: Resolves Flag
      description: |-
        Resolve multiple flags into variants and values. This method resolves
         all flags that are enabled for the given client, or a subset of them
         specified in the request.
         A flag is resolved by evaluating its rules in order, a rule matches if:
         1) it is enabled, 2) the referred segment is active, and 3) the
         randomization unit is in the population indicated by the segment's
         targeting criteria and population allocation. The first rule that matches
         will assign a variant and value to the unit. Archived flags are not included.
      operationId: Flag.resolves
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                flags:
                  type: array
                  items:
                    type: string
                  description: >-
                    If non-empty, the specific flags are resolved, otherwise all
                    flags
                     available to the client will be resolved.
                evaluationContext:
                  type: object
                  description: >-
                    An object that contains data used in the flag resolve. For
                    example,
                     the targeting key e.g. the id of the randomization unit, other attributes
                     like country or version that are used for targeting.
                clientSecret:
                  type: string
                  description: >-
                    Credentials for the client. It is used to identify the
                    client and find
                     the flags that are available to it.
                apply:
                  type: boolean
                  description: >-
                    Determines whether the flags should be applied directly as
                    part of the
                     resolve, or delayed until `ApplyFlag` is called. A flag is typically
                     applied when it is used, if this occurs much later than the resolve, then
                     `apply` should likely be set to false.
                sdk:
                  type: object
                  properties:
                    id:
                      type: string
                      enum:
                        - SDK_ID_UNSPECIFIED
                        - SDK_ID_JAVA_PROVIDER
                        - SDK_ID_KOTLIN_PROVIDER
                        - SDK_ID_SWIFT_PROVIDER
                        - SDK_ID_JS_WEB_PROVIDER
                        - SDK_ID_JS_SERVER_PROVIDER
                        - SDK_ID_PYTHON_PROVIDER
                        - SDK_ID_GO_PROVIDER
                        - SDK_ID_RUBY_PROVIDER
                        - SDK_ID_RUST_PROVIDER
                        - SDK_ID_JAVA_CONFIDENCE
                        - SDK_ID_KOTLIN_CONFIDENCE
                        - SDK_ID_SWIFT_CONFIDENCE
                        - SDK_ID_JS_CONFIDENCE
                        - SDK_ID_PYTHON_CONFIDENCE
                        - SDK_ID_GO_CONFIDENCE
                        - SDK_ID_RUST_CONFIDENCE
                        - SDK_ID_FLUTTER_IOS_CONFIDENCE
                        - SDK_ID_FLUTTER_ANDROID_CONFIDENCE
                        - SDK_ID_DOTNET_CONFIDENCE
                        - SDK_ID_GO_LOCAL_PROVIDER
                        - SDK_ID_JAVA_LOCAL_PROVIDER
                        - SDK_ID_JS_LOCAL_SERVER_PROVIDER
                        - SDK_ID_PYTHON_LOCAL_PROVIDER
                        - SDK_ID_RUST_LOCAL_PROVIDER
                      description: Name of a Confidence SDKs.
                    customId:
                      type: string
                      description: Custom name for non-Confidence SDKs.
                    version:
                      type: string
                      description: Version of the SDK.
                  description: Information about the SDK used to initiate the request.
              required:
                - clientSecret
                - apply
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  resolvedFlags:
                    type: array
                    items:
                      type: object
                      properties:
                        flag:
                          type: string
                          description: The id of the flag that as resolved.
                        variant:
                          type: string
                          description: >-
                            The id of the resolved variant has the format
                            `flags/abc/variants/xyz`.
                        value:
                          type: object
                          description: >-
                            The value corresponding to the variant. It will
                            always be a json object,
                             for example `\{ "color": "red", "size": 12 }`.
                        flagSchema:
                          type: object
                          properties:
                            schema:
                              type: array
                              items:
                                type: object
                                additionalProperties:
                                  type: object
                                  properties:
                                    structSchema:
                                      type: object
                                      description: Schema if this is a struct
                                    listSchema:
                                      type: object
                                      properties:
                                        elementSchema:
                                          type: object
                                          description: The schema for the elements in the list
                                      description: Schema if this is a list
                                    intSchema:
                                      type: object
                                      description: Schema if this is an int
                                    doubleSchema:
                                      type: object
                                      description: Schema if this is a double
                                    stringSchema:
                                      type: object
                                      description: Schema if this is a string
                                    boolSchema:
                                      type: object
                                      description: Schema if this is a bool
                              description: Map of field name to the schema for the field
                          description: >-
                            The schema of the value that was returned. For
                            example:
                             ```
                             \{
                                "schema": \{
                                  "color": \{ "stringSchema": \{} },
                                  "size": \{ "intSchema": \{} }
                                }
                             }
                             ```
                        reason:
                          type: string
                          enum:
                            - RESOLVE_REASON_UNSPECIFIED
                            - RESOLVE_REASON_MATCH
                            - RESOLVE_REASON_NO_SEGMENT_MATCH
                            - RESOLVE_REASON_NO_TREATMENT_MATCH
                            - RESOLVE_REASON_FLAG_ARCHIVED
                            - RESOLVE_REASON_TARGETING_KEY_ERROR
                            - RESOLVE_REASON_ERROR
                            - RESOLVE_REASON_UNRECOGNIZED_TARGETING_RULE
                            - RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED
                            - RESOLVE_REASON_TYPE_MISMATCH
                            - RESOLVE_REASON_FLAG_NOT_FOUND
                          description: The reason to why the flag could be resolved or not.
                        shouldApply:
                          type: boolean
                          description: >-
                            Determines whether the flag should be applied in the
                            clients
                    description: >-
                      The list of all flags that could be resolved. Note: if any
                      flag was
                       archived it will not be included in this list.
                  resolveToken:
                    type: object
                    description: >-
                      An opaque token that is used when `apply` is set to false
                      in `ResolveFlags`.
                       When `apply` is set to false, the token must be passed to `ApplyFlags`.
                  resolveId:
                    type: string
                    description: Unique identifier for this particular resolve request.
      servers:
        - url: https://resolver.eu.confidence.dev
        - url: https://resolver.us.confidence.dev

````