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

# Ocr Sync Stats

> Get OCR sync statistics for multiple data connectors from cached database values.

This endpoint only retrieves pre-calculated statistics from the database.
If stats are older than 15 minutes, a background task is triggered to refresh them.



## OpenAPI

````yaml /deasy-openapi-stainless.yml post /ocr/sync_stats
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: /rest/unstructured
security: []
paths:
  /ocr/sync_stats:
    post:
      tags:
        - Data Connectors
      summary: Ocr Sync Stats
      description: >-
        Get OCR sync statistics for multiple data connectors from cached
        database values.


        This endpoint only retrieves pre-calculated statistics from the
        database.

        If stats are older than 15 minutes, a background task is triggered to
        refresh them.
      operationId: ocr_sync_stats_ocr_sync_stats_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OCRSyncStatsRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '403':
          description: Missing token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while processing
            the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
      security:
        - BasicAuth: []
        - BearerAuth: []
          UserIdAuth: []
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from unstructured import UnstructuredClient

            client = UnstructuredClient(
                username=os.environ.get("UNSTRUCTURED_USERNAME"),  # This is the default and can be omitted
                password=os.environ.get("UNSTRUCTURED_PASSWORD"),  # This is the default and can be omitted
            )
            response = client.data_source.sync_stats(
                data_connector_names=["string"],
            )
            print(response)
        - lang: JavaScript
          source: >-
            import UnstructuredClient from 'unstructured-sdk';


            const client = new UnstructuredClient({
              authMethod: 'My Auth Method',
              username: process.env['UNSTRUCTURED_USERNAME'], // This is the default and can be omitted
              password: process.env['UNSTRUCTURED_PASSWORD'], // This is the default and can be omitted
            });


            const response = await client.dataSource.syncStats({
            data_connector_names: ['string'] });


            console.log(response);
components:
  schemas:
    OCRSyncStatsRequest:
      properties:
        data_connector_names:
          items:
            type: string
          type: array
          title: Data Connector Names
        force_refresh:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Force Refresh
          default: false
      type: object
      required:
        - data_connector_names
      title: OCRSyncStatsRequest
    HTTPError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: HTTPError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    BearerAuth:
      type: http
      scheme: bearer
    UserIdAuth:
      type: apiKey
      in: header
      name: X-User-ID

````