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

# Get a job history record (with task detail)



## OpenAPI

````yaml /26.4/en/rest-api/openapi-v2.json get /v2/jobs/{job_id}/history/{history_id}
openapi: 3.0.3
info:
  title: CData Sync API
  description: >-
    REST API (v2) for CData Sync. The API lets you manage workspaces,
    connections, jobs, transformations, pipelines, and users, and to run and
    monitor data replication and transformation work.


    ## Base path

    All endpoints are served under the `/api.rsc` application path, e.g.
    `https://your-sync-host/api.rsc/v2/workspaces`.


    ## Authentication

    Requests are authenticated with an auth token passed in the
    `x-cdata-authtoken` header, or with HTTP Basic authentication using a Sync
    user's credentials. A token can be generated via `POST
    /v2/users/generate-token`.


    ## Response envelope

    Successful read/write responses return a JSON **array** of objects, even
    when a single resource is requested (the array then contains one element).
    `count` endpoints return an array containing a single `{ "count": <n> }`
    object. `DELETE` operations return `204 No Content`.


    ## Date/time format

    Date/time values are formatted as `yyyy-MM-dd'T'HH:mm:ssZZZ` (ISO-8601 with
    timezone offset). The format is also echoed in the `X-DateTime-Format`
    response header.


    ## Roles

    Most endpoints require the `cdata_user` role; workspace and user management
    endpoints require the `cdata_admin` role.
  version: '2.0'
servers:
  - url: '{baseUrl}'
    variables:
      baseUrl:
        default: https://sync.example.com/api.rsc/v2
        description: >-
          Base URL of your Sync instance, including scheme and application path
          (e.g. https://sync.example.com/api.rsc/v2).
security:
  - ApiKeyAuth: []
  - BasicAuth: []
tags:
  - name: Workspaces
    description: Manage workspaces and their child resources.
  - name: Connections
    description: Manage connections and inspect connection metadata.
  - name: Jobs
    description: Manage replication jobs, their tasks, history, and execution.
  - name: Transformations
    description: Manage transformations, their tasks, history, and execution.
  - name: Pipelines
    description: Manage pipelines, steps, events, history, and execution.
  - name: Users
    description: Manage users and generate auth tokens.
  - name: Vaults
    description: Manage vault registrations and the secrets stored in the Local vault.
  - name: Search
    description: Search accessible resources across workspaces.
paths:
  /v2/jobs/{job_id}/history/{history_id}:
    parameters:
      - $ref: '#/components/parameters/JobId'
      - name: history_id
        in: path
        required: true
        schema:
          type: string
    get:
      tags:
        - Jobs
      summary: Get a job history record (with task detail)
      operationId: getJobHistory
      responses:
        '200':
          description: Job history record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobHistory'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    JobId:
      name: job_id
      in: path
      required: true
      description: Job identifier.
      schema:
        type: string
  schemas:
    JobHistory:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
        details:
          type: string
        run_start_date:
          type: string
          format: date-time
        runtime:
          type: string
        status:
          type: string
        records_affected:
          type: integer
        instance_id:
          type: string
        tasks:
          type: array
          description: Present when requesting a single history record.
          items:
            $ref: '#/components/schemas/TaskHistory'
    TaskHistory:
      type: object
      additionalProperties: false
      properties:
        task_id:
          type: string
        job_history_id:
          type: string
        affected_rows:
          type: integer
        status:
          type: string
          description: >-
            The task run status, e.g. SUCCESS, RETRY SUCCESS, PARTIAL_SUCCESS,
            RETRY PARTIAL_SUCCESS, FAILED, RETRY FAILED, ERROR, or SKIPPED.
            PARTIAL_SUCCESS (and RETRY PARTIAL_SUCCESS) indicates that at least
            one chunk succeeded and at least one chunk failed.
        details:
          type: string
          description: >-
            A detailed message for the status. For failed or partial-success
            tasks this is the error message; for successful tasks it is a
            summary such as "Records affected: N". Returned as a flat string for
            backward compatibility.
        run_type:
          type: string
          nullable: true
          description: >-
            Replication run type reported by ReplicateEngine for upgraded jobs
            (`statusversion >= 26.3`), e.g. FULL_SNAPSHOT, INCREMENTAL_SNAPSHOT,
            PARTITIONED_SNAPSHOT, INCREMENTAL, or CDC. Null when unavailable.
        start_position:
          type: string
          nullable: true
          description: >-
            Position the run started from, such as a timestamp or CDC position.
            Null when unavailable.
        last_checkpoint:
          type: string
          nullable: true
          description: Last checkpoint reached by the run. Null when unavailable.
        records_inserted:
          type: integer
          format: int64
          nullable: true
          description: >-
            Records inserted by the run, summed across automatic retries that
            keep previous writes. Null when unavailable.
        records_merged:
          type: integer
          format: int64
          nullable: true
          description: >-
            Records merged by the run, summed across automatic retries that keep
            previous writes. Null when unavailable.
        records_deleted:
          type: integer
          format: int64
          nullable: true
          description: >-
            Records deleted by the run, summed across automatic retries that
            keep previous writes. Null when unavailable.
        error_message:
          type: string
          nullable: true
          description: >-
            Error message of a failed or partially successful completed run.
            Null otherwise.
        query:
          type: string
        table:
          type: string
        runtime:
          type: string
        run_start_at:
          type: string
          format: date-time
        run_end_at:
          type: string
          format: date-time
        instance_id:
          type: string
        error:
          type: string
    Error:
      type: object
      additionalProperties: false
      properties:
        code:
          type: integer
          description: HTTP status code.
        message:
          type: string
          description: Short status message.
        error:
          type: string
          description: Detailed error description.
        error_code:
          type: string
          description: >-
            Stable Vault error category when the failure originated from a Vault
            operation.
          enum:
            - INVALID_REFERENCE
            - PROVIDER_NOT_FOUND
            - ITEM_NOT_FOUND
            - PROVIDER_UNAVAILABLE
            - AUTHENTICATION_FAILED
            - PERMISSION_DENIED
            - TYPE_MISMATCH
            - INVALID_REGISTRATION
            - READ_ONLY
            - UNKNOWN
        provider_id:
          type: string
          description: Vault provider identifier when safe and applicable.
        item_name:
          type: string
          description: Vault item name when safe and applicable.
  responses:
    Forbidden:
      description: The caller does not have permission to access this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-cdata-authtoken
      description: A Sync user auth token. Generate one via POST /v2/users/generate-token.
    BasicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication with a Sync user's username and API Token.

````

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