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

# Get Sync History

> Get recent sync runs and their failure trend without configuration or synced records.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples get /api/v1/apps/{app_id}/connectors/{connector_id}/sync_diagnostics/history
openapi: 3.1.0
info:
  description: The C1 API is a HTTP API for managing C1 resources.
  title: C1 API
  version: 0.1.0-alpha
servers:
  - description: The C1 API server for the current tenant.
    url: https://{tenantDomain}.conductor.one
    variables:
      tenantDomain:
        default: example
        description: The domain of the tenant to use for this request.
security:
  - bearerAuth: []
    oauth: []
paths:
  /api/v1/apps/{app_id}/connectors/{connector_id}/sync_diagnostics/history:
    get:
      tags:
        - Connector Sync Diagnostics
      summary: Get Sync History
      description: >-
        Get recent sync runs and their failure trend without configuration or
        synced records.
      operationId: c1.api.app.v1.ConnectorSyncDiagnosticsService.GetSyncHistory
      parameters:
        - in: path
          name: app_id
          required: true
          schema:
            description: Application containing the connector.
            type: string
        - in: path
          name: connector_id
          required: true
          schema:
            description: Connector whose runs are requested.
            type: string
        - in: query
          name: page_size
          schema:
            description: Maximum runs, up to 50; zero uses the default.
            format: int32
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/c1.api.app.v1.GetSyncHistoryResponse'
          description: >-
            GetSyncHistoryResponse contains newest-first runs and the trend
            within that window.
      x-codeSamples:
        - lang: go
          label: GetSyncHistory
          source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/conductorone/conductorone-sdk-go/pkg/models/shared\"\n\tconductoronesdkgo \"github.com/conductorone/conductorone-sdk-go\"\n\t\"github.com/conductorone/conductorone-sdk-go/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := conductoronesdkgo.New(\n        conductoronesdkgo.WithSecurity(shared.Security{\n            BearerAuth: \"<YOUR_BEARER_TOKEN_HERE>\",\n            Oauth: \"<YOUR_OAUTH_HERE>\",\n        }),\n    )\n\n    res, err := s.ConnectorSyncDiagnostics.GetSyncHistory(ctx, operations.C1APIAppV1ConnectorSyncDiagnosticsServiceGetSyncHistoryRequest{\n        AppID: \"<id>\",\n        ConnectorID: \"<id>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.GetSyncHistoryResponse != nil {\n        // handle response\n    }\n}"
components:
  schemas:
    c1.api.app.v1.GetSyncHistoryResponse:
      description: >-
        GetSyncHistoryResponse contains newest-first runs and the trend within
        that window.
      properties:
        runs:
          description: >-
            Recent completed and in-progress runs, deduplicated by lifecycle
            identifier.
          items:
            $ref: '#/components/schemas/c1.api.app.v1.SyncRunSummary'
          type:
            - array
            - 'null'
        streak:
          oneOf:
            - $ref: '#/components/schemas/c1.api.app.v1.SyncFailureStreak'
            - type: 'null'
      title: Get Sync History Response
      type: object
      x-speakeasy-name-override: GetSyncHistoryResponse
    c1.api.app.v1.SyncRunSummary:
      description: SyncRunSummary describes a run without configuration or synced records.
      properties:
        completedAt:
          format: date-time
          type:
            - string
            - 'null'
        confirmedValid:
          description: Whether a human confirmed this run's detected data drop as valid.
          type: boolean
        duration:
          format: duration
          type:
            - string
            - 'null'
        errorClass:
          description: Classification of the latest recorded error.
          enum:
            - SYNC_ERROR_CLASS_UNSPECIFIED
            - SYNC_ERROR_CLASS_AUTH_OR_SCOPE
            - SYNC_ERROR_CLASS_RATE_LIMIT
            - SYNC_ERROR_CLASS_TIMEOUT
            - SYNC_ERROR_CLASS_UPSTREAM_CONSISTENCY
            - SYNC_ERROR_CLASS_CONNECTOR_BUG
            - SYNC_ERROR_CLASS_STORAGE
            - SYNC_ERROR_CLASS_DATA_ANOMALY
            - SYNC_ERROR_CLASS_RUNTIME_REFUSED
            - SYNC_ERROR_CLASS_DEPLOYMENT
            - SYNC_ERROR_CLASS_UNKNOWN
          type: string
          x-speakeasy-unknown-values: allow
        errorSummary:
          description: Redacted latest error, capped at 256 bytes.
          type: string
        lambdaEnabled:
          description: Whether this run used hosted Lambda execution.
          type: boolean
        lifecycleId:
          description: Lifecycle identifier for this run.
          type: string
        releaseVersion:
          description: Connector release used by this run.
          type: string
        startedAt:
          format: date-time
          type:
            - string
            - 'null'
        status:
          description: Recorded lifecycle state.
          enum:
            - SYNC_LIFECYCLE_STATUS_UNSPECIFIED
            - SYNC_LIFECYCLE_STATUS_SYNCING
            - SYNC_LIFECYCLE_STATUS_ERRORED
            - SYNC_LIFECYCLE_STATUS_COMPLETED
            - SYNC_LIFECYCLE_STATUS_NOT_CONNECTED
            - SYNC_LIFECYCLE_STATUS_SKIPPED
            - SYNC_LIFECYCLE_STATUS_ERRORED_NO_DATA
          type: string
          x-speakeasy-unknown-values: allow
        syncRunStats:
          oneOf:
            - $ref: '#/components/schemas/c1.api.app.v1.ConnectorSyncRunStats'
            - type: 'null'
        syncType:
          description: Full or incremental sync mode.
          type: string
      title: Sync Run Summary
      type: object
      x-speakeasy-name-override: SyncRunSummary
    c1.api.app.v1.SyncFailureStreak:
      description: SyncFailureStreak summarizes only the returned history window.
      properties:
        failedRuns:
          description: Number of errored runs in the window.
          format: int32
          type: integer
        failureRatio:
          description: >-
            Failed runs divided by finished runs; zero when no qualifying runs
            are present.
          type: number
        finishedRuns:
          description: >-
            Number of terminal successful or errored runs used as the
            denominator.
          format: int32
          type: integer
        firstFailedAt:
          format: date-time
          type:
            - string
            - 'null'
        firstFailedLifecycleId:
          description: >-
            First failure after the most recent success in the window, absent if
            none is established.
          type: string
      title: Sync Failure Streak
      type: object
      x-speakeasy-name-override: SyncFailureStreak
    c1.api.app.v1.ConnectorSyncRunStats:
      description: The ConnectorSyncRunStats message.
      properties:
        c1zFileSizeBytes:
          description: The c1zFileSizeBytes field.
          format: int64
          readOnly: true
          type: string
        entitlements:
          description: The entitlements field.
          format: int64
          readOnly: true
          type: string
        entitlementsByResourceType:
          additionalProperties:
            format: int64
            type: string
          description: The entitlementsByResourceType field.
          readOnly: true
          type: object
        grants:
          description: The grants field.
          format: int64
          readOnly: true
          type: string
        grantsByResourceType:
          additionalProperties:
            format: int64
            type: string
          description: The grantsByResourceType field.
          readOnly: true
          type: object
        resourceTypes:
          description: The resourceTypes field.
          format: int64
          readOnly: true
          type: string
        resources:
          description: The resources field.
          format: int64
          readOnly: true
          type: string
        resourcesByResourceType:
          additionalProperties:
            format: int64
            type: string
          description: The resourcesByResourceType field.
          readOnly: true
          type: object
      title: Connector Sync Run Stats
      type: object
      x-speakeasy-name-override: ConnectorSyncRunStats
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    oauth:
      description: >-
        This API uses OAuth2 with the Client Credential flow.

        Client Credentials must be sent in the BODY, not the headers.

        For an example of how to implement this, refer to the
        [c1TokenSource.Token()](https://github.com/ConductorOne/conductorone-sdk-go/blob/3375fe7c0126d17e7ec4e711693dee7b791023aa/token_source.go#L101-L187)
        function.
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /auth/v1/token
      type: oauth2

````