> ## 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.

# Queryusage Flag

> Query time series data about how much this flag was used recently. You
 cannot query more than 7 days back in time.



## OpenAPI

````yaml /api/flags/api/flag.openapi.json post /v1/flags/{flag}/usage:query
openapi: 3.1.0
info:
  title: Confidence Flag API
  version: 1.0.0
  description: API documentation for flag
servers: []
security: []
paths:
  /v1/flags/{flag}/usage:query:
    post:
      summary: Queryusage Flag
      description: |-
        Query time series data about how much this flag was used recently. You
         cannot query more than 7 days back in time.
      operationId: Flag.queryusage
      parameters:
        - name: flag
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                startTime:
                  type: object
                  description: >-
                    Start time of the query, can at most be 7 days before the
                    current date.
                endTime:
                  type: object
                  description: End time of the query.
              required:
                - startTime
                - endTime
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  usage:
                    type: array
                    items:
                      type: object
                      properties:
                        hourTime:
                          type: object
                          description: The hour the usage was recorded.
                        variants:
                          type: array
                          items:
                            type: object
                            additionalProperties:
                              type: object
                              properties:
                                resolveCount:
                                  type: integer
                                  description: >-
                                    The number of times this variant was
                                    resolved in the time interval.
                                applyCount:
                                  type: integer
                                  description: >-
                                    The number of times this variant was applied
                                    in the time interval.
                          description: The usage of each variant of the flag.
                      required:
                        - hourTime
                    description: The usage time series.
      security:
        - admin: []
      servers:
        - url: https://flags.eu.confidence.dev
        - url: https://flags.us.confidence.dev
        - url: https://flags.confidence.dev
components:
  securitySchemes:
    admin:
      type: http
      scheme: bearer

````