> ## 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: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service Unavailable
          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 has not progressed for more than TWO of
            its own polling intervals. Previously the bar was three intervals OR
            600 seconds, whichever was larger, so a one-minute sync could miss
            ten consecutive runs and still read healthy while an hourly one got
            three. Read it beside intervals_since_last_sync and
            stale_after_seconds rather than on its own.
          default: false
        intervals_since_last_sync:
          anyOf:
            - type: number
            - type: 'null'
          title: Intervals Since Last Sync
          description: >-
            How overdue the sync is, measured in its OWN polling intervals:
            seconds_since_last_sync / polling_interval_seconds. 1.0 means one
            interval has elapsed, which is normal for a sync about to run. None
            when the sync has never run. Present so a caller can judge lateness
            without knowing where the threshold happens to sit.
          examples:
            - 0.4
            - 1
            - 3.15
        stale_after_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Stale After Seconds
          description: >-
            The threshold is_stale was evaluated against, in seconds, so the
            verdict can be checked rather than trusted. max(2 *
            polling_interval_seconds, 120).
          examples:
            - 600
            - 120
            - 7200
        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,
            running job not stalled. Because it folds in is_stale, a sync more
            than two intervals overdue reports healthy=false rather than true.
          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
        stalled:
          type: boolean
          title: Stalled
          description: >-
            The running job has made no progress: no heartbeat, or nothing
            discovered or synced, for longer than max(stale_after_seconds, 300).
            A first run that has not finished yet has no last sync to be stale
            against, so this is how it reports a stall. Folds into healthy.
          default: false
        stalled_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Stalled Reason
          description: Why the running job counts as stalled, when it does.
        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
    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.
  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, malformed,
        unknown, revoked, inactive or expired key returns 401; a key without the
        permission, scope or plan an operation needs returns 403.
    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`.

````

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