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

# Get Billing Metrics Timeseries

> Get organization credit consumption and completed activity counts for an inclusive date range of at most 365 days, grouped by day or week, along with aggregated period totals.



## OpenAPI

````yaml /openapi.json get /v1/billing/metrics/timeseries
openapi: 3.1.0
info:
  title: MindFort API
  version: 1.0.0
  description: >-
    The MindFort Public API supports targets and domain verification, Discovery,
    assessments, finding lifecycle and analytics, reports, and read-only credit
    usage. Informational probe results are labeled `secured`.
servers:
  - url: https://api.mindfort.app
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/billing/metrics/timeseries:
    get:
      tags:
        - Billing
      summary: Get Billing Metrics Timeseries
      description: >-
        Get organization credit consumption and completed activity counts for an
        inclusive date range of at most 365 days, grouped by day or week, along
        with aggregated period totals.
      operationId: getBillingMetricsTimeseries
      parameters:
        - name: from
          in: query
          required: true
          description: Start date, inclusive
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: true
          description: End date, inclusive
          schema:
            type: string
            format: date
        - name: granularity
          in: query
          required: false
          description: >-
            Aggregation bucket size (day or week; weekly dates are the Monday of
            the ISO week)
          schema:
            type: string
            enum:
              - day
              - week
            default: day
      responses:
        '200':
          description: Billing credit consumption timeseries returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicBillingMetricsTimeseries'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Not permitted for this organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PublicBillingMetricsTimeseries:
      properties:
        granularity:
          type: string
          enum:
            - day
            - week
          title: Granularity
        date_from:
          type: string
          format: date
          title: Date From
        date_to:
          type: string
          format: date
          title: Date To
        totals:
          $ref: '#/components/schemas/PublicBillingMetricsTotals'
        data:
          items:
            $ref: '#/components/schemas/PublicBillingTimeseriesPoint'
          type: array
          title: Data
      type: object
      required:
        - granularity
        - date_from
        - date_to
        - totals
        - data
      title: PublicBillingMetricsTimeseries
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
        code:
          type: string
          description: Stable machine-readable error code when one is available
        request_id:
          type: string
          description: Unique request identifier for debugging
    PublicBillingMetricsTotals:
      properties:
        credits_used:
          $ref: '#/components/schemas/PublicBillingCreditUsage'
        assessments_completed:
          $ref: '#/components/schemas/PublicBillingAssessmentCounts'
        tasks_completed:
          $ref: '#/components/schemas/PublicBillingActivityCount'
        retests_completed:
          $ref: '#/components/schemas/PublicBillingActivityCount'
      type: object
      required:
        - credits_used
        - assessments_completed
        - tasks_completed
        - retests_completed
      title: PublicBillingMetricsTotals
      additionalProperties: false
    PublicBillingTimeseriesPoint:
      properties:
        date:
          type: string
          format: date
          title: Date
        credits_used:
          $ref: '#/components/schemas/PublicBillingCreditUsage'
        assessments_completed:
          $ref: '#/components/schemas/PublicBillingAssessmentCounts'
        tasks_completed:
          $ref: '#/components/schemas/PublicBillingActivityCount'
        retests_completed:
          $ref: '#/components/schemas/PublicBillingActivityCount'
        plan_type:
          type:
            - string
            - 'null'
          title: Plan Type
      type: object
      required:
        - date
        - credits_used
        - assessments_completed
        - tasks_completed
        - retests_completed
        - plan_type
      title: PublicBillingTimeseriesPoint
      additionalProperties: false
    PublicBillingCreditUsage:
      properties:
        total:
          type: integer
          title: Total
          default: 0
        balanced:
          type: integer
          default: 0
          title: Balanced
        deep:
          type: integer
          default: 0
          title: Deep
        ultra:
          type: integer
          default: 0
          title: Ultra
        tasks:
          type: integer
          default: 0
          title: Tasks
        retests:
          type: integer
          default: 0
          title: Retests
        validations:
          type: integer
          default: 0
          title: Validations
        pull_review:
          type: integer
          default: 0
          title: Pull Review
      type: object
      required:
        - total
        - balanced
        - deep
        - ultra
        - tasks
        - retests
        - validations
        - pull_review
      title: PublicBillingCreditUsage
      additionalProperties: false
    PublicBillingAssessmentCounts:
      properties:
        total:
          type: integer
          title: Total
          default: 0
        balanced:
          type: integer
          default: 0
          title: Balanced
        deep:
          type: integer
          default: 0
          title: Deep
        ultra:
          type: integer
          default: 0
          title: Ultra
        pull_review:
          type: integer
          default: 0
          title: Pull Review
      type: object
      required:
        - total
        - balanced
        - deep
        - ultra
        - pull_review
      title: PublicBillingAssessmentCounts
      additionalProperties: false
    PublicBillingActivityCount:
      properties:
        total:
          type: integer
          title: Total
          default: 0
      type: object
      required:
        - total
      title: PublicBillingActivityCount
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key generated from the MindFort dashboard. Pass as `Authorization:
        Bearer <your-api-key>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.