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

# Get Sync Metrics

> Operational metrics for a sync in one call.

Folds config totals + health/staleness + the DLQ failure breakdown (grouped
by normalized error reason) + the most-recent job's throughput into a single
response — so callers can see "is this sync healthy / is anything backlogged"
without stitching /jobs and /dlq or reading logs.



## OpenAPI

````yaml get /v1/buckets/{bucket_id}/syncs/{sync_config_id}/metrics
openapi: 3.1.0
info:
  title: Mixpeek API
  description: >-
    This is the Mixpeek API, providing access to various endpoints for data
    processing and retrieval.
  termsOfService: https://mixpeek.com/terms
  contact:
    name: Mixpeek Support
    url: https://mixpeek.com/contact
    email: info@mixpeek.com
  version: '0.82'
servers:
  - url: https://api.mixpeek.com
    description: Production
security:
  - BearerAuth: []
paths:
  /v1/buckets/{bucket_id}/syncs/{sync_config_id}/metrics:
    get:
      tags:
        - Bucket Syncs
      summary: Get Sync Metrics
      description: >-
        Operational metrics for a sync in one call.


        Folds config totals + health/staleness + the DLQ failure breakdown
        (grouped

        by normalized error reason) + the most-recent job's throughput into a
        single

        response — so callers can see "is this sync healthy / is anything
        backlogged"

        without stitching /jobs and /dlq or reading logs.
      operationId: >-
        get_sync_metrics_v1_buckets__bucket_id__syncs__sync_config_id__metrics_get
      parameters:
        - name: bucket_id
          in: path
          required: true
          schema:
            type: string
            title: Bucket Id
        - name: sync_config_id
          in: path
          required: true
          schema:
            type: string
            title: Sync Config Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncMetricsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
          NamespaceHeader: []
components:
  schemas:
    SyncMetricsResponse:
      properties:
        sync_config_id:
          type: string
          title: Sync Config Id
        status:
          type: string
          title: Status
          description: Sync config status (e.g. ACTIVE).
        is_active:
          type: boolean
          title: Is Active
        paused:
          type: boolean
          title: Paused
          default: false
        total_files_discovered:
          type: integer
          title: Total Files Discovered
          default: 0
        total_files_synced:
          type: integer
          title: Total Files Synced
          default: 0
        total_files_failed:
          type: integer
          title: Total Files Failed
          default: 0
        batches_created:
          type: integer
          title: Batches Created
          default: 0
        sync_run_counter:
          type: integer
          title: Sync Run Counter
          default: 0
        consecutive_failures:
          type: integer
          title: Consecutive Failures
          default: 0
        last_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error
        last_sync_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Sync At
        next_sync_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Sync At
        seconds_since_last_sync:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seconds Since Last Sync
          description: Age of last successful sync; None if never synced.
        is_stale:
          type: boolean
          title: Is Stale
          description: >-
            True when a continuous sync hasn't progressed within ~3x its polling
            interval.
          default: false
        failure_rate:
          type: number
          title: Failure Rate
          description: total_files_failed / total_files_discovered (0..1).
          default: 0
        healthy:
          type: boolean
          title: Healthy
          description: 'Composite: active, not paused, no consecutive failures, not stale.'
          default: true
        dlq_total:
          type: integer
          title: Dlq Total
          description: Objects stuck after all retries.
          default: 0
        dlq_by_error:
          additionalProperties:
            type: integer
          type: object
          title: Dlq By Error
          description: DLQ counts grouped by normalized error reason (IDs stripped).
        running_job:
          type: boolean
          title: Running Job
          default: false
        last_job:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Last Job
          description: >-
            Summary of the most recent job: status, files_synced/failed,
            throughput_files_per_min, duration_seconds.
      type: object
      required:
        - sync_config_id
        - status
        - is_active
      title: SyncMetricsResponse
      description: >-
        Operational metrics for a sync configuration, in one call.


        Folds together what previously required stitching the config + /jobs +
        /dlq:

        lifetime totals, health/staleness, the DLQ failure breakdown (grouped by

        normalized error reason), and the most-recent job's throughput. Lets
        callers

        answer "is this sync healthy and is anything backlogged?" without
        circumventing

        the API with kubectl/log spelunking.
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Always false for error responses
          default: false
        status:
          type: integer
          title: Status
          description: HTTP status code for this error
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: Error details payload
      type: object
      required:
        - status
        - error
      title: ErrorResponse
      description: Error response model.
      examples:
        - error:
            details:
              id: ns_123
              resource: namespace
            message: Namespace not found
            type: NotFoundError
          status: 404
          success: false
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error message
        type:
          type: string
          title: Type
          description: Stable error type identifier (machine-readable)
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Fine-grained error code for programmatic handling (e.g.,
            namespace_name_taken, feature_extractor_not_found). Present only
            when consumers may need to branch on a specific error condition.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Optional structured details to help debugging (validation errors,
            IDs, etc.)
      type: object
      required:
        - message
        - type
      title: ErrorDetail
      description: Error detail model.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Mixpeek API key, sent as `Authorization: Bearer mxp_sk_...`. Create one
        in Studio under Settings → API Keys, or with an admin key via `POST
        /v1/organizations/users/{user_email}/api-keys`. A missing header returns
        403; an invalid or revoked key returns 401.
    NamespaceHeader:
      type: apiKey
      in: header
      name: X-Namespace
      description: >-
        Namespace id (`ns_...`), not the namespace name. This scopes the request
        rather than authenticating it, and it is required on every operation
        marked `x-mixpeek-namespace-scoped`.

````