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

# Query usage

> Query usage for a project



## OpenAPI

````yaml /specs/analytics/openapi.public.json post /v2/query/usage
openapi: 3.0.0
info:
  title: Analytics
  description: Voiceflow analytics service
  version: 1.0.0
  contact: {}
servers:
  - url: https://analytics-api.voiceflow.com
security: []
paths:
  /v2/query/usage:
    post:
      tags:
        - Usage
        - Public-Docs
      summary: Query usage
      description: Query usage for a project
      operationId: QueryPublicController_queryUsageV2_v2
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  oneOf:
                    - description: >-
                        Aggregate the number of interactions that match the
                        provided filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - interactions
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                            cursor:
                              type: number
                          required:
                            - projectID
                      required:
                        - name
                        - filter
                    - description: Find the top intents that match the provided filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - top_intents
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                          required:
                            - projectID
                      required:
                        - name
                        - filter
                    - description: >-
                        Aggregate the number of unique users that match the
                        provided filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - unique_users
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                            cursor:
                              type: number
                          required:
                            - projectID
                      required:
                        - name
                        - filter
                    - description: >-
                        Aggregate the number of tokens spent that match the
                        provided filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - credit_usage
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                            cursor:
                              type: number
                          required:
                            - projectID
                      required:
                        - name
                        - filter
                    - description: >-
                        Aggregate the function calls that match the provided
                        filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - function_usage
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                            cursor:
                              type: number
                          required:
                            - projectID
                      required:
                        - name
                        - filter
                    - description: Aggregate the API calls that match the provided filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - api_calls
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                            cursor:
                              type: number
                          required:
                            - projectID
                      required:
                        - name
                        - filter
                    - description: >-
                        Find the knowledge base documents that match the
                        provided filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - kb_documents
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                            cursor:
                              type: number
                          required:
                            - projectID
                      required:
                        - name
                        - filter
                    - description: >-
                        Aggregate the integration tool calls that match the
                        provided filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - integrations
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                            cursor:
                              type: number
                          required:
                            - projectID
                      required:
                        - name
                        - filter
                    - description: >-
                        Aggregate the transcripts that match the provided
                        filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - transcripts
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                            cursor:
                              type: number
                          required:
                            - projectID
                      required:
                        - name
                        - filter
                    - description: >-
                        Aggregate the agent invocations that match the provided
                        filter.
                      type: object
                      properties:
                        name:
                          type: string
                          enum:
                            - agent_usage
                        filter:
                          description: >-
                            A base filter supported by all queries that return a
                            list
                          type: object
                          properties:
                            projectID:
                              type: string
                              minLength: 1
                            startTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            endTime:
                              description: A timestamp in ISO-8601 format
                              type: string
                            projectEnvironmentIDOrAlias:
                              description: >-
                                One or more Voiceflow project environment IDs or
                                aliases
                              oneOf:
                                - type: string
                                  minLength: 1
                                - type: array
                                  minItems: 1
                                  items:
                                    type: string
                                    minLength: 1
                            limit:
                              type: integer
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 500
                              exclusiveMaximum: false
                              default: 100
                            cursor:
                              type: number
                          required:
                            - projectID
                      required:
                        - name
                        - filter
              required:
                - data
      responses:
        '200':
          description: The query succeed and the result was returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    oneOf:
                      - type: object
                        properties:
                          cursor:
                            type: integer
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                period:
                                  type: string
                                  format: date-time
                                projectID:
                                  type: string
                                environmentID:
                                  type: string
                                count:
                                  type: integer
                                type:
                                  type: string
                              required:
                                - period
                                - projectID
                                - environmentID
                                - count
                                - type
                        required:
                          - items
                      - type: object
                        properties:
                          intents:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  description: The name of the intent
                                  type: string
                                count:
                                  description: >-
                                    The number of times the intent was used in
                                    the project(s) that matched the provided
                                    filter
                                  type: integer
                                  minimum: 0
                                  exclusiveMinimum: false
                              required:
                                - name
                                - count
                        required:
                          - intents
                      - type: object
                        properties:
                          cursor:
                            type: integer
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                period:
                                  type: string
                                  format: date-time
                                projectID:
                                  type: string
                                environmentID:
                                  type: string
                                count:
                                  type: integer
                              required:
                                - period
                                - projectID
                                - environmentID
                                - count
                        required:
                          - items
                      - type: object
                        properties:
                          cursor:
                            type: integer
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                period:
                                  type: string
                                  format: date-time
                                projectID:
                                  type: string
                                environmentID:
                                  type: string
                                count:
                                  type: integer
                                diagramID:
                                  type: string
                                nodeID:
                                  type: string
                                model:
                                  type: string
                                type:
                                  type: string
                              required:
                                - period
                                - projectID
                                - environmentID
                                - count
                                - diagramID
                                - nodeID
                                - model
                                - type
                        required:
                          - items
                      - type: object
                        properties:
                          cursor:
                            type: integer
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                period:
                                  type: string
                                  format: date-time
                                projectID:
                                  type: string
                                environmentID:
                                  type: string
                                count:
                                  type: integer
                                functionID:
                                  type: string
                                name:
                                  type: string
                                successCount:
                                  type: integer
                              required:
                                - period
                                - projectID
                                - environmentID
                                - count
                                - functionID
                                - name
                                - successCount
                        required:
                          - items
                      - type: object
                        properties:
                          cursor:
                            type: integer
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                period:
                                  type: string
                                  format: date-time
                                projectID:
                                  type: string
                                environmentID:
                                  type: string
                                count:
                                  type: integer
                                apiToolID:
                                  type: string
                                name:
                                  type: string
                                successCount:
                                  type: integer
                              required:
                                - period
                                - projectID
                                - environmentID
                                - count
                                - apiToolID
                                - name
                                - successCount
                        required:
                          - items
                      - type: object
                        properties:
                          cursor:
                            type: integer
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                period:
                                  type: string
                                  format: date-time
                                projectID:
                                  type: string
                                environmentID:
                                  type: string
                                count:
                                  type: integer
                                documentID:
                                  type: string
                              required:
                                - period
                                - projectID
                                - environmentID
                                - count
                                - documentID
                        required:
                          - items
                      - type: object
                        properties:
                          cursor:
                            type: integer
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                period:
                                  type: string
                                  format: date-time
                                projectID:
                                  type: string
                                environmentID:
                                  type: string
                                count:
                                  type: integer
                                integrationToolName:
                                  type: string
                                successCount:
                                  type: integer
                              required:
                                - period
                                - projectID
                                - environmentID
                                - count
                                - integrationToolName
                                - successCount
                        required:
                          - items
                      - type: object
                        properties:
                          cursor:
                            type: integer
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                period:
                                  type: string
                                  format: date-time
                                projectID:
                                  type: string
                                environmentID:
                                  type: string
                                count:
                                  type: integer
                              required:
                                - period
                                - projectID
                                - environmentID
                                - count
                        required:
                          - items
                      - type: object
                        properties:
                          cursor:
                            type: integer
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                period:
                                  type: string
                                  format: date-time
                                projectID:
                                  type: string
                                environmentID:
                                  type: string
                                count:
                                  type: integer
                                agentID:
                                  type: string
                                name:
                                  type: string
                                successCount:
                                  type: integer
                              required:
                                - period
                                - projectID
                                - environmentID
                                - count
                                - agentID
                                - name
                                - successCount
                        required:
                          - items
                required:
                  - result
        '401':
          description: >-
            The provided authentication token does not have permissions for some
            of the requested resources
      security:
        - auth: []
components:
  securitySchemes:
    auth:
      type: apiKey
      in: header
      name: authorization
      description: Voiceflow API key

````