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

# Get Data Quality Batch Job Status

> Retrieves the current status and results of a batch evaluation job



## OpenAPI

````yaml GET /api/v1/data-quality/batch/{batchJobId}
openapi: 3.0.0
info:
  title: Followup Generation API
  version: 1.0.0
  description: API for generating followup questions based on survey responses
  contact:
    name: API Support
    email: justin@getaftercare.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://surveys.getaftercare.com
    description: Production server
  - url: https://staging.aftercareai.com
    description: Staging server
security:
  - ApiKeyAuth: []
tags:
  - name: Followups
    description: Operations related to followup question generation
  - name: Data Quality
    description: Operations related to response data quality evaluation
  - name: Coding
    description: Operations related to coding survey responses
paths:
  /api/v1/data-quality/batch/{batchJobId}:
    get:
      tags:
        - Data Quality
        - Batch
      summary: Get batch job status
      description: Retrieves the current status and results of a batch evaluation job
      operationId: getBatchJobStatus
      parameters:
        - name: batchJobId
          in: path
          required: true
          description: ID of the batch job to check
          schema:
            type: string
      responses:
        '200':
          description: Batch job status retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataQualityBatchResponse'
              example:
                batchJobId: 123e4567-e89b-12d3-a456-426614174000
                status: completed
                results:
                  items: []
                  nextCursor: null
        '400':
          description: Bad request - invalid input parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: INVALID_REQUEST
                message: Invalid request parameters
                details:
                  question: Question is required
        '403':
          description: Forbidden - Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: INVALID_API_KEY
                message: Invalid or missing API key
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: NOT_FOUND
                message: Requested resource not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: INTERNAL_ERROR
                message: An unexpected error occurred
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: const response = await api.quality.getBatchJobStatus();
        - lang: Python
          source: response = api.quality.getBatchJobStatus()
components:
  schemas:
    DataQualityBatchResponse:
      type: object
      required:
        - batchJobId
        - status
      properties:
        batchJobId:
          type: string
          description: Unique identifier for the batch processing job
        status:
          $ref: '#/components/schemas/BatchJobStatus'
        results:
          $ref: '#/components/schemas/BatchJobResults'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code
          example: INVALID_REQUEST
        message:
          type: string
          description: Error message
          example: Invalid request parameters
        details:
          type: object
          description: Additional error details
          example:
            question: Question is required
    BatchJobStatus:
      type: string
      enum:
        - queued
        - processing
        - completed
        - failed
      description: Status values for batch processing jobs
    BatchJobResults:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/RespondentEvaluation'
        nextCursor:
          type: string
          nullable: true
          description: Cursor for the next page of results
    RespondentEvaluation:
      type: object
      required:
        - numIssues
        - qualityScore
        - demeritScore
        - evaluations
      properties:
        responseIdentifier:
          type: string
          description: >-
            Optional identifier for the survey response. Aftercare can use this
            to asscociate survey entries for a single response.


            If a response identifier is not provided, Aftercare will generate
            one.
        numIssues:
          type: integer
          description: Number of quality issues detected
          minimum: 0
        qualityScore:
          type: number
          description: >-
            A score between 0 and 100 that represents the overall quality of the
            survey response.


            The score is an average of the quality scores across all survey
            entries.


            The lower the score, the greater the likelihood and severity of data
            quality issues.
          minimum: 0
          maximum: 100
        demeritScore:
          type: number
          description: >-
            A score between 0 and 100 that represents the overall quality of the
            survey response.


            The score is an average of the quality scores across all survey
            entries.


            The higher the score, the greater the likelihood and severity of
            data quality issues.
          minimum: 0
          maximum: 100
        evaluations:
          type: array
          items:
            $ref: '#/components/schemas/SurveyEntryEvaluation'
    SurveyEntryEvaluation:
      type: object
      required:
        - surveyEntry
        - numIssues
        - qualityScore
        - demeritScore
        - qualityIssueChecks
      properties:
        surveyEntry:
          $ref: '#/components/schemas/SurveyEntry'
        numIssues:
          type: integer
          description: Number of quality issues detected
          minimum: 0
        hasIssues:
          type: boolean
          description: If Aftercare has detected any quality issues for this survey entry
        qualityScore:
          type: number
          description: >-
            A score between 0 and 100 that represents the overall quality of the
            individual survey entry. (Deprecated: use demeritScore instead)
          minimum: 0
          maximum: 100
          deprecated: true
        demeritScore:
          type: number
          description: >-
            A score between 0 and 100 that represents the overall quality of the
            individual survey entry.


            The score is a weighted average of the quality issue scores.


            The higher the score, the greater the likelihood and severity of
            data quality issues.
          minimum: 0
          maximum: 100
        qualityIssueChecks:
          type: array
          items:
            $ref: '#/components/schemas/QualityIssueCheck'
    SurveyEntry:
      type: object
      required:
        - question
        - answer
      properties:
        question:
          type: string
          description: The question that was asked to the respondent
        questionContext:
          type: string
          description: >-
            A description of what you are trying to learn from the respondent
            for this question
        answer:
          type: string
          description: The answer to the question provided by the respondent
        questionIdentifier:
          type: string
          description: >-
            Optional unique identifier for the question.


            Aftercare will use this to build a data model to track questions
            across a survey
        parentQuestionIdentifier:
          type: string
          description: Optional identifier of a previous question in a follow-up thread
        keyEvents:
          type: array
          items:
            $ref: '#/components/schemas/SurveyEntryKeyStroke'
          description: An optional array of key strokes.
        pasteEvents:
          type: array
          items:
            $ref: '#/components/schemas/SurveyEntryPaste'
          description: An optional array of paste events.
        honeypotPhrase:
          type: string
          description: >-
            Optional string. If provided, Aftercare will check if the response
            contains any honey pot words.
    QualityIssueCheck:
      type: object
      required:
        - type
        - score
        - isIssue
      properties:
        type:
          $ref: '#/components/schemas/QualityIssueType'
        score:
          type: number
          description: >-
            Score between 0-100 for this quality issue.


            The higher the score, the greater the likelihood and severity of the
            quality issue.
          minimum: 0
          maximum: 100
        isIssue:
          type: boolean
          description: Indicates if this issue was detected
        evidence:
          type: string
          description: ' An optional string, evidence provides the reason for the quality issue score.'
    SurveyEntryKeyStroke:
      type: object
      required:
        - k
        - t
        - ht
        - c
      properties:
        k:
          type: string
          description: Key value (e.g., "a", "Enter")
        t:
          type: number
          description: Keydown timestamp (from performance.now())
        ht:
          type: number
          description: Hold time of the key
        c:
          type: string
          description: Physical key code (e.g., "KeyA", "Enter")
    SurveyEntryPaste:
      type: object
      required:
        - t
        - c
      properties:
        t:
          type: number
          description: Timestamp of the paste event
        c:
          type: string
          description: Clipboard content that was pasted
    QualityIssueType:
      type: string
      enum:
        - Nonsensical
        - Irrelevant
        - Low Effort
        - LLM Generated
        - Repeated Answers
        - Duplicate Answers
      description: >-
        Types of quality issues that can be detected in survey responses.


        * `Nonsensical` - Response lacks logical meaning or sense. Likely
        gibberish.

        * `Irrelevant` - Response does not address the question.

        * `Low Effort` - Respondent did not put in much effort to answer the
        question. Lacks detail or concrete examples.

        * `LLM Generated` - Response appears to be generated by AI.

        * `Self Duplicated` - Responses from the same respondent contain
        duplicated content across multiple answers. Only evaluated when multiple
        survey entries are provided or if a survey identifier and response
        identifier is provided.

        * `Shared Duplicate` - Responses contain duplicated content across
        different respondents for the same question. Only evaluated if survey
        identifiers and question identifiers are provided.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Aftercare-Key
      description: API key for authentication

````