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

# Get job stats over time

> Get job processing statistics over time.

Returns job metrics grouped by day, week, or month. Includes status
breakdown, processing times, and success rates.



## OpenAPI

````yaml openapi.json get /v1/stats/jobs
openapi: 3.1.0
info:
  title: DocIntell API
  description: >-

    # DocIntell API


    **Turn Documents into Data. Keep the Source Safe.**


    Financial document intelligence platform that turns PDFs into queryable data
    while keeping source files secure and compliant.


    ## Features


    - **Document Ingestion**: Upload PDFs with SEC 17a-4 compliant immutable
    storage

    - **Schema Projection**: Query extracted data with custom schemas (not data
    dumps!)

    - **Multi-Schema Support**: Same document, multiple query patterns

    - **Webhook Delivery**: Async notifications on job completion

    - **Row-Level Security**: Multi-tenant isolation built-in


    ## Authentication


    All API endpoints (except `/health`, `/`, `/docs`, and `/redoc`) require API
    key authentication.


    Include your API key in the `Authorization` header:


    ```

    Authorization: Bearer dk_live_<your_key>

    ```


    Test keys start with `dk_test_`, production keys with `dk_live_`.


    ## Rate Limiting


    Per-tenant rate limits:

    - **Document ingestion**: 100 documents/hour

    - **Projection queries**: 1,000 requests/hour

    - **Schema operations**: 10 creates/hour


    Rate limit info is returned in response headers:

    - `X-RateLimit-Limit`: Maximum requests allowed

    - `X-RateLimit-Remaining`: Remaining requests in window

    - `X-RateLimit-Reset`: Unix timestamp when limit resets


    ## Error Handling


    All errors follow RFC 7807 Problem Details format:


    ```json

    {
      "error": "error_code",
      "message": "Human-readable description",
      "details": {}
    }

    ```


    Common error codes:

    - `unauthorized` (401): Missing or invalid API key

    - `rate_limit_exceeded` (429): Too many requests

    - `invalid_file_type` (400): Only PDFs supported

    - `file_too_large` (413): File exceeds size limit (default 100MB,
    configurable via MAX_UPLOAD_SIZE_MB)

    - `job_not_found` (404): Job ID doesn't exist or doesn't belong to tenant


    ## Getting Started


    1. Obtain API key from dashboard

    2. Upload PDF: `POST /v1/documents`

    3. Poll status: `GET /v1/documents/{document_id}/status`

    4. Query results: `POST /v1/documents/{document_id}/project`


    Full documentation: [https://docs.docintel.com](https://docs.docintel.com)
        
  contact:
    name: DocIntell Support
    url: https://docintel.com/support
    email: support@docintel.com
  license:
    name: Proprietary
    url: https://docintel.com/terms
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Local development
  - url: https://api.docintell.com
    description: Production API
  - url: https://api-staging.docintell.com
    description: Staging environment
security:
  - bearerAuth: []
tags:
  - name: health
    description: Health check operations. Verify service and dependency connectivity.
    x-mint-tag-group: System
  - name: api_keys
    description: API key management operations. Create, list, and revoke API keys.
    x-mint-tag-group: Management
  - name: documents
    description: Document ingestion operations. Upload PDFs for extraction.
    x-mint-tag-group: Core
  - name: jobs
    description: >-
      Job status and query operations. Check extraction status and query
      results.
    x-mint-tag-group: Core
  - name: document-types
    description: >-
      Document type schemas. List and retrieve extraction schema definitions for
      financial document types.
  - name: webhooks
    description: >-
      Webhook configuration management. Create, update, and manage webhook
      endpoints for job completion notifications.
    x-mint-tag-group: Integrations
  - name: stats
    description: Analytics and metrics endpoints. Get document, job, and schema statistics.
  - name: views
    description: >-
      View management for consumption layer. Define field subsets for querying
      extraction data.
paths:
  /v1/stats/jobs:
    get:
      tags:
        - stats
      summary: Get job stats over time
      description: |-
        Get job processing statistics over time.

        Returns job metrics grouped by day, week, or month. Includes status
        breakdown, processing times, and success rates.
      operationId: get_stats_jobs_v1_stats_jobs_get
      parameters:
        - name: group_by
          in: query
          required: false
          schema:
            enum:
              - day
              - week
              - month
            type: string
            description: Time grouping interval
            default: day
            title: Group By
          description: Time grouping interval
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            description: 'Start date (ISO 8601, default: 30 days ago)'
            title: Start Date
          description: 'Start date (ISO 8601, default: 30 days ago)'
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            description: 'End date (ISO 8601, default: today)'
            title: End Date
          description: 'End date (ISO 8601, default: today)'
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - pending
                  - processing
                  - completed
                  - failed
              - type: 'null'
            description: Filter by job status
            title: Status
          description: Filter by job status
      responses:
        '200':
          description: Job processing metrics and status breakdown over time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsJobsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StatsJobsResponse:
      properties:
        period:
          $ref: '#/components/schemas/StatsPeriod'
          description: Time period covered
        group_by:
          type: string
          enum:
            - day
            - week
            - month
          title: Group By
          description: Grouping interval
        data:
          items:
            $ref: '#/components/schemas/JobStatsDataPoint'
          type: array
          title: Data
          description: Time series data points
        totals:
          $ref: '#/components/schemas/JobStatsTotals'
          description: Aggregated totals for the period
      type: object
      required:
        - period
        - group_by
        - data
        - totals
      title: StatsJobsResponse
      description: |-
        Response for job stats over time (GET /v1/stats/jobs).

        Job processing metrics and status breakdown over time.
      examples:
        - data:
            - avg_processing_time_seconds: 12.4
              by_status:
                completed: 32
                failed: 2
                pending: 0
                processing: 0
              date: '2025-12-06'
              p95_processing_time_seconds: 28.7
              total: 34
          group_by: day
          period:
            end: '2025-12-07'
            start: '2025-11-07'
          totals:
            avg_processing_time_seconds: 11.8
            by_status:
              completed: 148
              failed: 5
              pending: 2
              processing: 1
            success_rate: 0.967
            total: 156
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StatsPeriod:
      properties:
        start:
          type: string
          title: Start
          description: Start date (ISO 8601)
        end:
          type: string
          title: End
          description: End date (ISO 8601)
      type: object
      required:
        - start
        - end
      title: StatsPeriod
      description: Time period for stats queries.
      examples:
        - end: '2025-12-07'
          start: '2025-11-07'
    JobStatsDataPoint:
      properties:
        date:
          type: string
          title: Date
          description: Date for this data point (ISO 8601)
        total:
          type: integer
          title: Total
          description: Total jobs in this period
        by_status:
          $ref: '#/components/schemas/JobStatsByStatus'
          description: Job counts by status
        avg_processing_time_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Processing Time Seconds
          description: Average processing time in seconds
        p95_processing_time_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: P95 Processing Time Seconds
          description: 95th percentile processing time in seconds
      type: object
      required:
        - date
        - total
        - by_status
      title: JobStatsDataPoint
      description: Single data point for job stats time series.
      examples:
        - avg_processing_time_seconds: 12.4
          by_status:
            completed: 32
            failed: 2
            pending: 0
            processing: 0
          date: '2025-12-06'
          p95_processing_time_seconds: 28.7
          total: 34
    JobStatsTotals:
      properties:
        total:
          type: integer
          title: Total
          description: Total job count in period
        by_status:
          $ref: '#/components/schemas/JobStatsByStatus'
          description: Job counts by status in period
        success_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Success Rate
          description: Ratio of completed to total completed+failed (0.0-1.0)
        avg_processing_time_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Processing Time Seconds
          description: Average processing time in seconds
      type: object
      required:
        - total
        - by_status
      title: JobStatsTotals
      description: Aggregated totals for job stats.
      examples:
        - avg_processing_time_seconds: 11.8
          by_status:
            completed: 148
            failed: 5
            pending: 2
            processing: 1
          success_rate: 0.967
          total: 156
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    JobStatsByStatus:
      properties:
        pending:
          type: integer
          title: Pending
          description: Number of pending jobs
          default: 0
        processing:
          type: integer
          title: Processing
          description: Number of processing jobs
          default: 0
        completed:
          type: integer
          title: Completed
          description: Number of completed jobs
          default: 0
        failed:
          type: integer
          title: Failed
          description: Number of failed jobs
          default: 0
      type: object
      title: JobStatsByStatus
      description: Job counts grouped by status.
      examples:
        - completed: 1489
          failed: 19
          pending: 12
          processing: 3
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API Key authentication. Format: dk_test_<key> or dk_live_<key>'

````