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

# Query objective metrics

> Reports how sessions performed against the agent's configured objective, conversion or resolution, for one project over a date range. The request body takes `startDate` and `endDate`, with optional timezone, channel and environment filters.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json post /v1/stable/analytics/query/objective-metrics/project/{projectID}
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/analytics/query/objective-metrics/project/{projectID}:
    post:
      tags:
        - Analytics
      summary: Query objective metrics
      description: Reports how sessions performed against the agent's configured
        objective, conversion or resolution, for one project over a date range.
        The request body takes `startDate` and `endDate`, with optional
        timezone, channel and environment filters.
      operationId: StableAnalyticsController_queryObjectiveMetrics
      parameters:
        - name: projectID
          required: true
          in: path
          schema:
            type: string
          x-vf-doc:
            description: The ID of the project to operate on.
          description: The ID of the project to operate on.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StableAnalyticsQueryObjectiveMetricsRequest"
      responses:
        "200":
          description: Returns the objective's rate, its matched and evaluated session
            counts and a time series of buckets, under `conversion` or
            `resolution` depending on which objective the agent is configured
            with.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableAnalyticsQueryObjectiveMetricsResponse"
          x-vf-doc:
            description: Returns the objective's rate, its matched and evaluated session
              counts and a time series of buckets, under `conversion` or
              `resolution` depending on which objective the agent is configured
              with.
      security:
        - token: []
components:
  schemas:
    StableAnalyticsQueryObjectiveMetricsRequest:
      type: object
      properties:
        endDate:
          type: string
          allOf:
            - type: string
              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: string
              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        startDate:
          type: string
          allOf:
            - type: string
              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: string
              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        timezone:
          type: string
        interfaces:
          description: The channels to filter results by. Defaults to all channels.
          minItems: 1
          type: array
          items:
            type: string
            enum:
              - phone
              - webchat
              - api
              - sms
            x-enumNames:
              - PHONE
              - WEBCHAT
              - API
              - SMS
        environmentAlias:
          description: The ID or alias of the environment to filter results by. Defaults
            to all environments.
          type: string
      required:
        - endDate
        - startDate
      additionalProperties: false
    StableAnalyticsQueryObjectiveMetricsResponse:
      type: object
      properties:
        conversion:
          description: Returned only when the assistant's objective is conversion.
          allOf:
            - $ref: "#/components/schemas/ObjectiveMetrics"
        resolution:
          description: Returned only when the assistant's objective is resolution.
          allOf:
            - $ref: "#/components/schemas/ObjectiveMetrics"
    ObjectiveMetrics:
      type: object
      properties:
        rate:
          nullable: true
          description: Percentage (0-100) of evaluated sessions that met the objective,
            rounded to one decimal. Null when no session was evaluated; never
            report a null as 0%.
          type: number
        matchedSessions:
          type: number
          description: Sessions that met the objective. The numerator of the rate.
        evaluatedSessions:
          type: number
          description: Sessions evaluated against the objective. The denominator of the
            rate.
        interval:
          type: string
          enum:
            - hour
            - day
            - week
            - month
          description: "The bucket size of every `buckets` entry, derived from the
            requested range: hour up to a day, day up to 31 days, week up to 56
            days, month beyond that."
          x-enumNames:
            - HOUR
            - DAY
            - WEEK
            - MONTH
        buckets:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date-time
                pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              matchedSessions:
                type: number
              evaluatedSessions:
                type: number
            required:
              - date
              - matchedSessions
              - evaluatedSessions
          description: Counts per `interval` bucket, not percentages. `date` is the start
            of the bucket. Divide within a bucket to get that bucket's rate.
      required:
        - rate
        - matchedSessions
        - evaluatedSessions
        - interval
        - buckets
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
