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

# Get Sync Status



## OpenAPI

````yaml /api-reference/openapi.json get /back-office/sync/historical/{connectionId}
openapi: 3.1.0
info:
  title: Payra API
  version: 1.0.0
  description: Documentação da API para Backoffice e Service
servers: []
security: []
paths:
  /back-office/sync/historical/{connectionId}:
    get:
      tags:
        - Sync
      summary: Get Sync Status
      operationId: getSyncStatus
      parameters:
        - schema:
            type: string
            description: Connection ID to check status for
          required: true
          description: Connection ID to check status for
          name: connectionId
          in: path
      responses:
        '200':
          description: Sync status retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - health_status_ok
                      - health_status_error
                      - validation_error
                      - bad_request
                      - unauthorized
                      - forbidden
                      - not_found
                      - method_not_allowed
                      - internal_server_error
                      - organization_not_found
                      - cannot_access_organization
                      - api_key_not_found
                      - resource_already_exists
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      connectionId:
                        type: string
                      jobId:
                        type: string
                      status:
                        type: string
                        enum:
                          - cancelled
                          - failed
                          - partial_success
                          - pending
                          - running
                          - success
                      syncMode:
                        type: string
                      startedAt:
                        type: string
                      completedAt:
                        type:
                          - string
                          - 'null'
                      recordsProcessed:
                        type:
                          - number
                          - 'null'
                      recordsSucceeded:
                        type:
                          - number
                          - 'null'
                      recordsFailed:
                        type:
                          - number
                          - 'null'
                      summary:
                        type:
                          - string
                          - 'null'
                      dateRangeStart:
                        type:
                          - string
                          - 'null'
                      dateRangeEnd:
                        type:
                          - string
                          - 'null'
                      invoiceIds:
                        type:
                          - array
                          - 'null'
                        items:
                          type: string
                      customerIds:
                        type:
                          - array
                          - 'null'
                        items:
                          type: string
                      jobType:
                        type:
                          - string
                          - 'null'
                        enum:
                          - sync_customer
                          - sync_invoice
                      duration:
                        type: number
                        description: Duration in seconds
                    required:
                      - connectionId
                      - jobId
                      - status
                      - syncMode
                      - startedAt
                      - completedAt
                      - recordsProcessed
                      - recordsSucceeded
                      - recordsFailed
                      - summary
                      - dateRangeStart
                      - dateRangeEnd
                      - invoiceIds
                      - customerIds
                      - jobType
                required:
                  - data
        '404':
          description: No sync jobs found for this connection or not connection found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - health_status_ok
                      - health_status_error
                      - validation_error
                      - bad_request
                      - unauthorized
                      - forbidden
                      - not_found
                      - method_not_allowed
                      - internal_server_error
                      - organization_not_found
                      - cannot_access_organization
                      - api_key_not_found
                      - resource_already_exists
                    default: not_found
                  message:
                    type: string
                  data: {}
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - health_status_ok
                      - health_status_error
                      - validation_error
                      - bad_request
                      - unauthorized
                      - forbidden
                      - not_found
                      - method_not_allowed
                      - internal_server_error
                      - organization_not_found
                      - cannot_access_organization
                      - api_key_not_found
                      - resource_already_exists
                    default: internal_server_error
                  message:
                    type: string
                  data: {}
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````