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

# Add Respondent

> API endpoint for adding a new respondent with quality check data



## OpenAPI

````yaml POST /v2/addRespondent
openapi: 3.0.1
info:
  title: API Documentation
  description: API Documentation for Redem 3.0
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.redem.io
security:
  - apiKeyAuth: []
tags:
  - name: Survey
    description: Survey management
  - name: Respondent
    description: Respondent management
paths:
  /v2/addRespondent:
    post:
      tags:
        - Respondent
      summary: Add a new respondent
      description: API endpoint for adding a new respondent with quality check data
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddRespondentRequest_v2'
            example:
              respondentId: RESP497770
              surveyName: Global Vacation Insights 2024
              dataPoints:
                - qualityCheck: OES
                  dataPointId: Q1
                  question: Where did you spend your last vacation?
                  answer: We were at Lake Garda in Italy
                  keywords:
                    - Beach
                    - Mountains
                    - Lake
                    - Museums
                    - Europe
                    - Asia
                    - Destination
                  activateDuplicateDetection: true
                  allowedLanguages:
                    - en
                    - de
                    - it
                - qualityCheck: TS
                  dataPointId: durationQ1
                  duration: 42670
                - qualityCheck: GQS
                  dataPointId: Q2
                  gridAnswersPattern:
                    - 7
                    - 8
                    - 9
                    - 1
                    - 3
                    - 5
                    - 2
                    - 5
                    - 9
                    - 6
                  patternCheckEnabled: true
                - qualityCheck: OES
                  dataPointId: Q3
                  question: What was the most memorable part of your last vacation?
                  answer: Italian cuisine, especially pizza and fine wine.
                  keywords:
                    - Cuisine
                    - Food
                    - Art
                    - Adventure
                    - History
                    - Landscape
                    - Culture
                  activateDuplicateDetection: true
                  allowedLanguages:
                    - en
                    - de
                    - it
                - qualityCheck: TS
                  dataPointId: durationQ3
                  duration: 69720
                - qualityCheck: CHS
                  dataPointId: CHS_Question
                  surveyDescription: >-
                    This survey aims to understand travel preferences and
                    vacation experiences of European travelers, focusing on
                    accommodation choices, transportation methods, and budget
                    allocation.
                  interviewData:
                    - questionId: Q1
                      question: What mode of transport did you use?
                      answer: Car
                    - questionId: Q2
                      question: How many days did you stay?
                      answer: 5
                    - questionId: Q3
                      question: Did you travel with family?
                      answer: 'yes'
                    - questionId: Q4
                      question: >-
                        What was your approximate total budget for the trip (in
                        EUR)?
                      answer: 1500
                    - questionId: Q5
                      question: What type of accommodation did you stay in?
                      answer: Hotel
                - qualityCheck: GQS
                  dataPointId: Q4
                  gridAnswersPattern:
                    - 2
                    - 1
                    - 4
                    - 3
                    - 5
                    - 2
                    - 3
                    - 1
                    - 1
                    - 1
                  patternCheckEnabled: false
                - qualityCheck: TS
                  dataPointId: totalDuration
                  duration: 256843
                - qualityCheck: BAS
                  dataPointId: interactionsQ1
                  interactionData:
                    - interactionType: KEYSTROKE
                      value: W
                      timestamp: '2024-12-01T06:22:59.809Z'
                    - interactionType: KEYSTROKE
                      value: We
                      timestamp: '2024-12-01T06:22:59.833Z'
                    - interactionType: KEYSTROKE
                      value: 'We '
                      timestamp: '2024-12-01T06:22:59.909Z'
                    - interactionType: KEYSTROKE
                      value: We w
                      timestamp: '2024-12-01T06:22:59.962Z'
                    - interactionType: KEYSTROKE
                      value: We we
                      timestamp: '2024-12-01T06:23:00.024Z'
                    - interactionType: KEYSTROKE
                      value: We were
                      timestamp: '2024-12-01T06:23:00.086Z'
                    - interactionType: KEYSTROKE
                      value: 'We were '
                      timestamp: '2024-12-01T06:23:00.148Z'
                    - interactionType: KEYSTROKE
                      value: We were a
                      timestamp: '2024-12-01T06:23:00.210Z'
                    - interactionType: KEYSTROKE
                      value: We were at
                      timestamp: '2024-12-01T06:23:00.272Z'
              activateCleaning: true
              cleaningSettings:
                redemScore: 60
                OES:
                  activate: true
                  score: 40
                  minDataPoints: 2
                  categories:
                    GENERIC_ANSWER:
                      activate: false
                      minDataPoints: 2
                    NO_INFORMATION:
                      activate: false
                      minDataPoints: 2
                    BAD_LANGUAGE:
                      activate: true
                      minDataPoints: 2
                    NONSENSE:
                      activate: true
                      minDataPoints: 2
                    DUPLICATE_ANSWER:
                      activate: false
                      minDataPoints: 1
                    DUPLICATE_RESPONDENT:
                      activate: false
                      minDataPoints: 1
                    WRONG_TOPIC:
                      activate: true
                      minDataPoints: 2
                    WRONG_LANGUAGE:
                      activate: true
                      minDataPoints: 2
                    AI_GENERATED_ANSWER:
                      activate: true
                      minDataPoints: 2
                CHS:
                  activate: true
                  score: 20
                GQS:
                  activate: true
                  score: 10
                  minDataPoints: 2
                TS:
                  activate: true
                  score: 20
                BAS:
                  activate: true
                  score: 10
                  minDataPoints: 2
                  categories:
                    UNNATURAL_TYPING:
                      activate: true
                      minDataPoints: 1
                    COPY_AND_PASTE:
                      activate: true
                      minDataPoints: 2
                    UNNATURAL_MOVEMENT:
                      activate: true
                      minDataPoints: 2
              synchronousResponse: true
      responses:
        '200':
          description: >-
            When a request is successfully processed, the API returns a 200 OK
            status code along with the expected data. The structure of the
            response depends on the synchronousResponse parameter provided in
            the request body, which determines whether the response is
            synchronous (results of the respondent evaluation are returned
            immediately) or asynchronous (a respondent is created and the
            results of the respondent evaluation are available later through a
            separate endpoint).
          content:
            application/json:
              schema:
                oneOf:
                  - title: Synchronous Response
                    description: >-
                      **Synchronous Response** 


                      This response mode is triggered when `synchronousResponse`
                      is set to `true`. 

                       In this mode, the system generates a detailed response containing all quality parameters of the respondent. The request will wait (`await`) until the full response is ready before proceeding.
                    type: object
                    properties:
                      success:
                        type: boolean
                        description: >-
                          A variable indicating whether the **operation was
                          successful**.
                        enum:
                          - true
                          - false
                      message:
                        type: string
                        description: >-
                          A variable that **human-readable message** providing
                          additional context or confirmation of the requested
                          action.
                      results:
                        type: object
                        description: >-
                          This variable includes **all quality parameters
                          associated with a respondent**.
                        properties:
                          respondentId:
                            type: string
                            description: A variable that **indicates the respondent**.
                          status:
                            type: string
                            description: >-
                              A variable that represents the current state of
                              the respondent evaluation. For synchronous
                              responses, this value will always be `COMPLETED`. 
                            enum:
                              - COMPLETED
                          respondentQuality:
                            $ref: '#/components/schemas/RespondentResults'
                            description: >-
                              This variable includes **all quality parameters
                              associated with a respondent**. 

                               **💡Important:** Even if a respondent fails evaluation, the response will still be returned with results with an error code of `-999` instead of valid scores. 

                               **⭕ Note:** The value `-999` is a predefined code returned by **ReDem** whenever a respondent cannot be evaluated. This applies to all quality scores, **including ReDem Score (R-Score), OES, GQS, CHS, TS, and BAS**.
                  - title: Asynchronous Response
                    description: >-
                      **Asynchronous Response** 


                      This response mode is triggered when `synchronousResponse`
                      is set to `false`. 

                       In this case, the system generates a detailed response and processes it asynchronously, meaning the request will not wait (`await`) for the evaluation to complete. Instead, the evaluation is performed in the background, and the status of the respondent can be retrieved later using the [Get Respondent Status](/api-reference/endpoints/v2/getRespondent) endpoint.
                    type: object
                    properties:
                      success:
                        type: boolean
                        description: >-
                          A variable indicating whether the **operation was
                          successful**.
                        enum:
                          - true
                          - false
                      message:
                        type: string
                        description: >-
                          A variable that **human-readable message** providing
                          additional context or confirmation of the requested
                          action.
                      results:
                        type: object
                        description: >-
                          This variable includes **all quality parameters
                          associated with a respondent**.
                        properties:
                          respondentId:
                            type: string
                            description: A variable that **indicates the respondent**.
                          status:
                            type: string
                            description: >-
                              A variable that represents the **current state of
                              the respondent evaluation**.
                            enum:
                              - QUEUED
              examples:
                Synchronous Response:
                  summary: Synchronous Response Example
                  value:
                    success: true
                    message: Respondent Evaluated successfully
                    results:
                      respondentId: RESP497770
                      status: COMPLETED
                      respondentQuality:
                        isExcluded: true
                        reasonsForExclusion:
                          - Open Ended Score Threshold
                          - Coherence Score Threshold
                        redemScore: 85
                        qualityScoreSummary:
                          - qualityCheck: OES
                            score: 80
                          - qualityCheck: CHS
                            score: 75
                            reason: >-
                              The user shows several inconsistencies and
                              contradictions, such as different ...
                            incoherentQuestions:
                              - Q1
                              - Q2
                          - qualityCheck: GQS
                            score: 85
                          - qualityCheck: TS
                            score: 70
                          - qualityCheck: BAS
                            score: 75
                        dataPointsSummary:
                          - qualityCheck: OES
                            dataPointId: Q1
                            score: 85
                            category: VALID_ANSWER
                          - qualityCheck: TS
                            dataPointId: durationQ1
                            score: 95
                          - qualityCheck: GQS
                            dataPointId: Q2
                            score: 90
                          - qualityCheck: OES
                            dataPointId: Q3
                            score: 75
                            category: VALID_ANSWER
                          - qualityCheck: TS
                            dataPointId: durationQ3
                            score: 50
                          - qualityCheck: CHS
                            dataPointId: CHS_Question
                            score: 75
                            reason: >-
                              The user shows several inconsistencies and
                              contradictions, such as different ...
                          - qualityCheck: GQS
                            dataPointId: Q4
                            score: 80
                          - qualityCheck: TS
                            dataPointId: totalDuration
                            score: 65
                          - qualityCheck: BAS
                            dataPointId: interactionsQ1
                            score: 75
                            category: NATURAL_TYPING
                Asynchronously Response:
                  summary: Asynchronous Response Example
                  value:
                    success: true
                    message: Respondent Queued for Evaluation
                    results:
                      respondentId: RESP497770
                      status: QUEUED
        '400':
          description: >-
            When a request fails due to invalid input or other errors, the API
            returns a 400 Bad Request status code. The response includes a
            descriptive `message` explaining the issue and an `error` object
            containing additional details to aid in diagnosing and resolving the
            problem.
          content:
            application/json:
              schema:
                oneOf:
                  - title: Validation Error
                    description: >-
                      Indicating a validation failure, the response includes a
                      `message` field specifying the issue and an `errors`
                      object listing the missing or incorrect fields to help
                      clients resolve them. 

                       **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.
                    type: object
                  - title: ID already exists
                    description: >-
                      If the system detects a duplicate `respondentId` within
                      the same survey, it returns an error. The `respondentId`
                      serves as a unique identifier for each respondent within a
                      survey, ensuring they are distinguishable. 

                       **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.
                    type: object
                  - title: Survey has been stopped
                    description: >-
                      If a respondent addition request is made for a survey that
                      is **stopped**, the system returns an error. A **stopped**
                      survey no longer accepts new respondents, preventing
                      further additions. 

                       **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.
                    type: object
                  - title: Insufficient credit balance
                    description: >-
                      If there are **not enough credits available to add a
                      respondent**, the system returns an error. Adding
                      respondents requires sufficient credits, and if the limit
                      is reached, no further respondents can be added. 

                       **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.
                    type: object
                  - title: Respondent processing timed out
                    description: >-
                      If processing a respondent **exceeds 20 seconds**, the
                      system returns an error. If the processing time surpasses
                      this threshold, the request continues in the background,
                      but an error response is returned. 

                       **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.
                    type: object
              examples:
                Validation Error:
                  value:
                    success: false
                    message: Validation Error
                    errors:
                      '0': '"surveyName" is required'
                      '1': '"dataPoints[0].dataPointId" is required'
                ID already exists:
                  value:
                    success: false
                    message: ID already exists
                    errors: {}
                Survey has been stopped:
                  value:
                    success: false
                    message: Survey has been stopped
                    errors: {}
                Insufficient credit balance:
                  value:
                    success: false
                    message: Insufficient credit balance
                    errors: {}
                Respondent processing timed out:
                  value:
                    success: false
                    message: Respondent processing timed out
                    errors: {}
        '429':
          description: >-
            Too Many Requests. This API key exceeded the configured per-minute
            rate limit. Standard keys are limited to 600 requests per minute for
            addRespondent; premium keys may be configured for higher limits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: rate_limit_exceeded
                  message:
                    type: string
                    example: This API key exceeded 600 requests per minute.
                  statusCode:
                    type: number
                    example: 429
              example:
                error: rate_limit_exceeded
                message: This API key exceeded 600 requests per minute.
                statusCode: 429
components:
  schemas:
    AddRespondentRequest_v2:
      description: |-
        Request body for adding a new respondent 

         **🔒 Authentication:** This endpoint can be accessed using both `PRIVATE` and `PUBLIC` API key types
      required:
        - respondentId
        - surveyName
        - dataPoints
      type: object
      properties:
        respondentId:
          type: string
          description: >-
            **The unique identifier for a respondent**, making it easy to
            distinguish them from others in the survey. The respondent ID can be
            freely chosen for flexibility.


            **💡 Important:** The system utilizes this ID, combined with the
            survey name, to uniquely identify the respondent within a survey.
            This allows the same respondent ID to participate in multiple
            surveys without conflicts. 


            If the combination of survey name and respondent ID already exists,
            an error will be displayed. 

             **🔦 Tip:** You can use the same respondent ID as in the survey tool to easily identify the respondent later.
          example: RESP497770
        surveyName:
          type: string
          description: >-
            **The name of the survery**, which helps identify different surveys.
            The survey name can be assigned freely. 


            **💡Important:** If the survey name already exists, the system will
            add the respondent under the appropriate survey. If the survey name
            is new, a new survey will be created, and the respondent will be
            added to the new survey. 

             **⭕ Note:** Each survey identifier must be unique. 

             **🔦 Tip:** you can simply make survey name unique by adding a timestamp. 
             As Example: `Global Vacation Insights - 1709040600`
        dataPoints:
          type: array
          items:
            $ref: '#/components/schemas/DataPoint_v2'
          description: >-
            An array of data points used for quality checks on each respondent.
            For the Coherence Score (CHS), only a single data point is allowed,
            which must contain the entire interview.

             🧪 **Validations:** 
             - A **maximum of 10** `OES` data points are allowed per respondent. 
             - A **maximum of 100** `TS` data points are allowed per respondent. 
             - A **maximum of 20** `GQS` data points are allowed per respondent. 
             - A **maximum of 1 with 300 question/answer pairs** `CHS` data point is allowed per respondent. 

             Exceeding these limits will trigger validation errors. Ensure that the number of data points per respondent remains within the allowed limits.
        activateCleaning:
          type: boolean
          description: |-
            **Indicates whether cleaning should be applied to the respondent**. 

             **💡Important:** To get an indicator whether respondents should be removed from the sample, ensure this variable is set to true. 

             When cleaning is enabled, the response will include the variable isExcluded, which indicates whether the respondent has been excluded based on the applied criteria.
          example: true
          default: false
        cleaningSettings:
          $ref: '#/components/schemas/CleaningSettings'
          description: >-
            Cleaning settings define the rules for determining whether a
            respondent should be excluded and marked as low quality. If a
            **respondent’s scores fall below the threshold, they will be
            excluded and flagged as low quality**.

             **💡Important:** If no custom cleaning settings are defined and cleaning is enabled, the system will apply ReDem’s recommended cleaning settings. You can view the recommended settings here: [ReDem Recommended Cleaning Settings](/knowledge-base/features/cleaning-and-review#redem-recommended-cleaning-settings) 
             
             For more details on how cleaning works, refer to the [Data Cleaning](/knowledge-base/features/cleaning-and-review) section.
        synchronousResponse:
          type: boolean
          description: >-
            **Indicates whether the response should be processed
            synchronously**. 

             - Set to `true` if you need an immediate response. 
             - Set to false if you don’t need to wait; you can later check the respondent’s status using the [Get Respondent Status endpoint](/api-reference/endpoints/v2/getRespondent).
          example: true
          default: true
    RespondentResults:
      description: Complete quality assessment for a respondent
      type: object
      properties:
        isExcluded:
          type: boolean
          description: >-
            **Indicates whether a respondent is excluded based on the cleaning
            settings specified in the request**. If cleaning is not activated,
            the respondent is always included by default.
          example: false
        reasonsForExclusion:
          type: array
          items:
            type: string
          description: >-
            **Reasons for exclusion** will only be available if the respondent
            is excluded based on the cleaning settings specified in the request.
            If the respondent is not excluded, the array will be empty.
        redemScore:
          type: number
          description: >-
            **A weighted average score** (0–100) calculated based on the applied
            quality scores.. 

             For more information refer to the [ReDem Score](/quality-checks/redem-score) section.
          example: 85
        qualityScoreSummary:
          type: array
          items:
            $ref: '#/components/schemas/QualityCheckResponse'
          description: An object containing detailed results for each quality score applied
        dataPointsSummary:
          type: array
          items:
            $ref: '#/components/schemas/DataPointsQualityResponse'
          description: >-
            Detailed results of quality checks performed at the individual data
            point level.
    DataPoint_v2:
      description: >-
        An array of data points used to perform quality checks on each
        respondent.
      type: object
      discriminator:
        propertyName: qualityCheck
        mapping:
          OES: '#/components/schemas/OESDataPoint'
          TS: '#/components/schemas/TSDataPoint'
          GQS: '#/components/schemas/GQSDataPoint'
          CHS: '#/components/schemas/CHSDataPoint_v2'
          BAS: '#/components/schemas/BASDataPoint_V2'
          DES: '#/components/schemas/DESDataPoint'
      oneOf:
        - $ref: '#/components/schemas/OESDataPoint'
        - $ref: '#/components/schemas/TSDataPoint'
        - $ref: '#/components/schemas/GQSDataPoint'
        - $ref: '#/components/schemas/CHSDataPoint_v2'
        - $ref: '#/components/schemas/BASDataPoint_V2'
        - $ref: '#/components/schemas/DESDataPoint'
    CleaningSettings:
      description: Configuration for data cleaning and review process
      type: object
      properties:
        redemScore:
          type: number
          description: Minimum acceptable ReDem score (0-100)
          example: 60
        OES:
          type: object
          properties:
            activate:
              type: boolean
              description: >-
                Indicates whether **OES** should be applied as a cleaning
                parameter.
              example: true
            score:
              type: number
              description: Minimum score threshold for OES checks
              example: 40
            minDataPoints:
              type: number
              description: Minimum number of data points required
              example: 2
            categories:
              type: object
              properties:
                GENERIC_ANSWER:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                NO_INFORMATION:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                BAD_LANGUAGE:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                NONSENSE:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                DUPLICATE_ANSWER:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                DUPLICATE_RESPONDENT:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                WRONG_TOPIC:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                WRONG_LANGUAGE:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                AI_GENERATED_ANSWER:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
        CHS:
          type: object
          properties:
            activate:
              type: boolean
              description: >-
                Indicates whether **CHS** should be applied as a cleaning
                parameter.
              example: true
            score:
              type: number
              description: Minimum score threshold for CHS checks
              example: 30
        GQS:
          type: object
          properties:
            activate:
              type: boolean
              description: >-
                Indicates whether **GQS** should be applied as a cleaning
                parameter.
              example: true
            score:
              type: number
              description: Minimum score threshold for GQS checks
              example: 20
            minDataPoints:
              type: number
              description: Minimum number of data points required
              example: 2
        TS:
          type: object
          properties:
            activate:
              type: boolean
              description: >-
                Indicates whether **TS** should be applied as a cleaning
                parameter.
              example: true
            score:
              type: number
              description: Minimum score threshold for TS checks
              example: 20
        BAS:
          type: object
          properties:
            activate:
              type: boolean
              description: >-
                Indicates whether **BAS** should be applied as a cleaning
                parameter.
              example: true
            score:
              type: number
              description: Minimum score threshold for BAS checks
              example: 20
            categories:
              type: object
              properties:
                UNNATURAL_TYPING:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                COPY_AND_PASTE:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
                UNNATURAL_MOVEMENT:
                  type: object
                  properties:
                    activate:
                      type: boolean
                    minDataPoints:
                      type: number
    QualityCheckResponse:
      description: Aggregated results for a quality score type
      type: object
      properties:
        qualityCheck:
          type: string
          enum:
            - OES
            - TS
            - GQS
            - CHS
            - BAS
            - DES
          description: '**The specific type of quality check** applied to a respondent.'
          example: OES
        score:
          type: number
          description: >-
            A **numerical score from 0 to 100** that represents the overall
            result of a specific quality check. It is calculated based on the
            combined evaluation of all data point scores of the same quality
            type. `-999` means no real aggregated score could be calculated.
          example: 78
        reason:
          type: string
          description: >-
            **The reason behind the score** — available only when the quality
            score type is set to `CHS`.
          example: >-
            The user shows several inconsistencies and contradictions, such as
            different ...
        incoherentQuestions:
          type: array
          items:
            type: string
          description: >-
            **List of incoherent questions** identified during the CHS quality
            check. This will be only available if the quality score type is set
            to `CHS` 

             **⭕ Note:** The questions are named in numerical order, reflecting the sequence in which they were presented to the respondent.
          example:
            - Q1
            - Q2
        missingScoreReason:
          type: string
          enum:
            - TIMEOUT
            - RATE_LIMIT
            - CONTENT_FILTER
            - MAX_RETRIES
            - UNAVAILABLE
            - INSUFFICIENT_RESPONDENTS
            - MISSING_DURATION
            - INSUFFICIENT_INTERACTION
            - INSUFFICIENT_DEMOGRAPHICS
          description: >-
            Explains why a score is `-999`. Set on **CHS** `qualityScoreSummary`
            when Coherence Score could not be calculated (CHS has no datapoint
            summary). Not set on other aggregated quality-check scores.
          example: TIMEOUT
    DataPointsQualityResponse:
      description: Quality check results for a single datapoint
      type: object
      properties:
        qualityCheck:
          type: string
          enum:
            - OES
            - TS
            - GQS
            - CHS
            - BAS
            - DES
          description: '**Type of quality check** performed for the data point'
          example: OES
        dataPointId:
          type: string
          description: '**A unique identifier of the data point**'
          example: Q1
        score:
          type: number
          description: >-
            **Quality score for the data point**, ranging from 0 to 100. `-999`
            means the check did not produce a real score.
          example: 85
        category:
          type: string
          description: >-
            **Quality category** for the data point, this will be only available
            if the quality check type is set to `OES` or `BAS`
          example: VALID_ANSWER
        reason:
          type: string
          description: >-
            **Explanation** for the score, this will be only available if the
            quality check type is set to `GQS`
          example: Straightliner, Partial Straightliner
        missingScoreReason:
          type: string
          enum:
            - TIMEOUT
            - RATE_LIMIT
            - CONTENT_FILTER
            - MAX_RETRIES
            - UNAVAILABLE
            - INSUFFICIENT_RESPONDENTS
            - MISSING_DURATION
            - INSUFFICIENT_INTERACTION
            - INSUFFICIENT_DEMOGRAPHICS
          description: Explains why the datapoint score is `-999`.
          example: INSUFFICIENT_RESPONDENTS
    OESDataPoint:
      type: object
      title: OES
      properties:
        qualityCheck:
          type: string
          description: >-
            A variable that **specifies the type of quality check applied to the
            data point**, determining how it will be assessed and evaluated.
          enum:
            - OES
        dataPointId:
          type: string
          x-mintlify-id: oes-data-point-id
          description: >-
            **A unique identifier assigned to each data point**, allowing users
            to pick a customized name. This name will be used to identify and
            reference the data point later within the system.
          example: Q1
        question:
          type: string
          description: >-
            **Contains the title or text of the open-ended question**, which is
            used directly to evaluate respondent quality.  

             This variable is required only when the quality check type is set to `OES`. For all other quality check types, it will be ignored, even if provided. 

             🧪 **Validations:**  
             - The question must not exceed **500 characters**.
          example: Where did you spend your last vacation?
        answer:
          type: string
          description: >-
            A variable that holds the **respondent's answer to an open-ended
            question**, which is the main part we use for evaluation. 

             This variable is required only when the quality check type is set to `OES`. For all other quality check types, it will be ignored, even if provided.
          example: We were at Lake Garda in Italy
        keywords:
          type: array
          items:
            type: string
          description: >-
            **Keywords are used to perform `wrong topic` checks** and help
            evaluate whether responses are relevant to the topic. 


            The wrong topic check is always enabled. If no keywords are
            provided, the system uses the question title for evaluation. When
            keywords are provided, they enhance the context and improve the
            accuracy of the check. 

             For more details on how this works, refer to the [Wrong Topic Check](/quality-checks/open-ended-score#wrong-topic) section. 

             🧪 **Validations:**  
             - A **maximum of 20** keywords are allowed for each question.
          example:
            - Beach
            - Mountains
            - Lake
        activateDuplicateDetection:
          type: boolean
          description: >-
            A variable that indicates **whether duplicate checks are performed
            on the respondent's answers**. 

             This checks if an answer is identical to another respondent's answer or if a respondent provided the same answer to multiple questions. 

             By default, duplicate checks are active, but you can deactivate them by setting this variable to `false`.
          example: true
          default: true
        allowedLanguages:
          type: array
          items:
            type: string
          description: >-
            **Specifies the list of languages allowed for responses**. Answers
            provided in languages not on this list will be marked as `wrong
            language`. The specified languages are respondent-based.

             If no languages are specified, the wrong language check will not be performed. 

             **🔦 Tip:** To ensure accurate language detection, set the expected language to the one the respondent used to complete the questionnaire. 

             For more details on how this works, refer to the [Wrong Language Check](/quality-checks/open-ended-score#wrong-language) section. 

             🧪 **Validations:**  
             - Allowed languages should be represented using **two-letter ISO 639-1 language codes.**
          example:
            - en
            - de
            - it
        ignoreAllowedLanguageError:
          type: boolean
          default: false
          example: false
          description: >-
            When `true`, invalid `allowedLanguages` and
            `skipTranslationLanguages` codes (wrong format or non-ISO 639-1) are
            dropped instead of rejecting the request. Valid codes are kept. If
            every code in a field is invalid, that field is removed. Defaults to
            `false`. This does not change wrong-language scoring when valid
            `allowedLanguages` codes remain.
        ignoreEmptyAnswer:
          type: boolean
          default: false
          example: false
          description: >-
            When `true`, this OES datapoint is removed from the respondent if
            `answer` is empty (including whitespace-only). If every OES
            datapoint is removed, OES is skipped. Defaults to `false`.
        shouldTranslate:
          type: boolean
          default: false
          example: true
          description: >-
            When `true`, ReDem translates non-valid, non-English OES answers to
            English during quality evaluation (API **v3** only). Defaults to
            `false`. Valid and English answers are not translated. See the ReDem
            Credits documentation for translation credit rules.
        skipTranslationLanguages:
          type: array
          items:
            type: string
          description: >-
            ISO 639-1 language codes that should **not** be translated when
            `shouldTranslate` is `true` (API **v3** only). Answers detected in
            these languages are left as-is. English is never translated
            regardless of this list. Use the same two-letter codes as
            `allowedLanguages`.
          example:
            - de
            - fr
      required:
        - dataPointId
        - qualityCheck
        - answer
        - question
    TSDataPoint:
      type: object
      title: TS
      properties:
        qualityCheck:
          type: string
          description: >-
            A variable that **specifies the type of quality check applied to the
            data point**, determining how it will be assessed and evaluated.
          enum:
            - TS
        dataPointId:
          type: string
          description: >-
            **A unique identifier assigned to each data point**, allowing users
            to pick a customized name. This name will be used to identify and
            reference the data point later within the system.
          example: Q1
        duration:
          type: number
          description: >-
            This variable captures the **time a respondent has spent on a
            question or a specific section of the survey**. The duration can be
            provided in seconds or milliseconds. 

             **💬 Recommendation:** Send the duration for each question rather than the total survey duration to ensure more accurate analysis.
          example: 42670
      required:
        - dataPointId
        - qualityCheck
        - duration
    GQSDataPoint:
      type: object
      title: GQS
      properties:
        qualityCheck:
          type: string
          description: >-
            A variable that **specifies the type of quality check applied to the
            data point**, determining how it will be assessed and evaluated.
          enum:
            - GQS
        dataPointId:
          type: string
          description: >-
            **A unique identifier assigned to each data point**, allowing users
            to pick a customized name. This name will be used to identify and
            reference the data point later within the system.
          example: Q1
        gridAnswersPattern:
          type: array
          items:
            type: number
          description: >-
            A variable that contains all the **answers provided by a specific
            respondent for a particular grid question**. 

             The grid pattern should be sent in the same order as the respondent saw it in the survey, especially for randomized grid questions, to ensure accurate analysis. 

             🧪 **Validations:**  
             - A **minimum of 5** answers are allowed for each grid question. 
             - Pattern checks beyond straightlining are applied only for grids with **7 or more** answers. 
             - Each answer must be provided as a **numeric value**.
          example:
            - 5
            - 4
            - 3
            - 5
            - 4
        patternCheckEnabled:
          type: boolean
          default: false
          description: >-
            Whether to activate Grid Question Score pattern checking for this
            data point. This field is only processed when `qualityCheck` is
            `GQS`.
          example: false
      required:
        - dataPointId
        - qualityCheck
        - gridAnswersPattern
    CHSDataPoint_v2:
      type: object
      title: CHS
      properties:
        qualityCheck:
          type: string
          description: >-
            A variable that **specifies the type of quality check applied to the
            data point**, determining how it will be assessed and evaluated.
          enum:
            - CHS
        dataPointId:
          type: string
          description: >-
            **A unique identifier assigned to each data point**, allowing users
            to pick a customized name. This name will be used to identify and
            reference the data point later within the system. Note that there
            can be only one CHS datapoint per respondent. This datapoint should
            contain the entire interview. 

             **Note:** We strongly recommend to send the same `dataPointId` for all respondents in the survey.
          example: CHS_DataPoint
        interviewData:
          type: array
          items:
            $ref: '#/components/schemas/InterviewData_v2'
          description: >-
            This variable aggregates all relevant question-answer pairs used to
            evaluate the respondent's coherence. 

             🧪 **Validations:**  
             - A **maximum of 300** question/answer pairs are allowed per respondent.
          example:
            - questionId: Q1
              question: What type of accommodation did you stay in?
              answer: Hotel
        surveyDescription:
          type: string
          description: >-
            **Additional context about the purpose and intent of the survey.**
            This optional field provides supplementary information that helps
            improve the quality and accuracy of the Coherence Score evaluation
            by giving the AI model better context about the survey's
            objectives. 

             🧪 **Validations:** If provided, it must contain a minimum of **20 characters** and a maximum of **500 characters**.
          example: >-
            This survey aims to understand travel preferences and vacation
            experiences of European travelers, focusing on accommodation
            choices, transportation methods, and budget allocation.
        ignoreEmptyAnswers:
          type: boolean
          default: false
          example: false
          description: >-
            When `true`, questions with no answer (empty or whitespace-only) are
            removed from `interviewData` before validation and storage. If no
            questions remain, the CHS datapoint is dropped and CHS is skipped.
            Defaults to `false`.
      required:
        - dataPointId
        - qualityCheck
        - interviewData
    BASDataPoint_V2:
      type: object
      title: BAS
      properties:
        qualityCheck:
          type: string
          description: >-
            A variable that **specifies the type of quality check applied to the
            data point**, determining how it will be assessed and evaluated.
          enum:
            - BAS
        dataPointId:
          type: string
          description: >-
            **A unique identifier assigned to each data point**, allowing users
            to pick a customized name. This name will be used to identify and
            reference the data point later within the system.
          example: Q1
        interactionData:
          type: array
          items:
            $ref: '#/components/schemas/InteractionData_V2'
          description: >
            This variable compiles all relevant information about the
            interaction of the respondent with the data point. 

             🔦 **Tip:** Need a template to extract typing or mouse patterns directly from individual browsers? See the [example implementations](/api-reference/others/behavior-tracking). 

             ⭕ **Note:** 
             - Typing needs at least **3** `KEYSTROKE` or `COPY_AND_PASTE` events to compute a typing score. Mouse behaviour can be scored on its own when `MOUSE_MOVEMENT` or `MOUSE_CLICK` events are present. 
             - ReDem only uses the **last 300** mouse events (`MOUSE_MOVEMENT` and `MOUSE_CLICK` together) per data point. Cap client-side tracking at the same limit. 
          example:
            - interactionType: KEYSTROKE
              value: W
              timestamp: '2024-12-01T06:22:59.833Z'
      required:
        - dataPointId
        - qualityCheck
        - interactionData
    DESDataPoint:
      type: object
      title: DES
      description: >-
        Duplicate Entrance Score datapoint. Available on **API v3 only**. At
        most one DES datapoint per respondent.
      properties:
        qualityCheck:
          type: string
          description: Must be `DES` for Duplicate Entrance Score evaluation.
          enum:
            - DES
        dataPointId:
          type: string
          description: >-
            **Identifier for the DES datapoint**. Defaults to `DES` if omitted
            in the API. Only one DES datapoint is allowed per respondent.
          example: DES
          default: DES
        entranceTime:
          type: string
          format: date-time
          description: >-
            **Optional ISO 8601 timestamp** of when the respondent entered the
            survey. Used as the reference time for the peer comparison window.
            If omitted, ReDem uses the current timestamp when the request is
            received.
          example: '2026-07-28T12:00:00.000Z'
        ip:
          type: string
          description: >-
            **Optional respondent IP address**. If any peer in the comparison
            window has the same IP, DES returns score `0` with category
            `DUPLICATE_IP`. IP-only DES (no demographics, or fewer than 4) is
            valid.
          example: 203.0.113.10
        demographics:
          type: array
          description: >-
            Demographic fields used for duplicate entrance comparison. Optional
            when `ip` is provided.


            🧪 **Validations:**

            - **0–10** items accepted

            - **Fewer than 4** and **no IP** → request is accepted, but DES is
            scored as invalid (`N/A`)

            - **Fewer than 4** **with IP** → IP-only check (`DUPLICATE_IP` /
            `VALID_ENTRANT`)

            - **More than 10** → validation error

            - Each `type` must be **unique** in the array (prefer custom type
            strings over repeating `"other"`)


            Recommended `type` values: `age`, `ageRange`, `yearOfBirth`,
            `gender`, `country`, `city`, `zip`, `ethnicity`, `salaryRange`,
            `jobTitle`, `other`, or any custom string.


            **Scoring note:** `age` and `yearOfBirth` use numeric similarity
            (±3). All other types use exact match. See the Duplicate Entrance
            Score knowledge base page.
          maxItems: 10
          items:
            type: object
            required:
              - type
              - answer
            properties:
              type:
                type: string
                description: >-
                  Demographic field type. Must be unique within `demographics`.
                  Free-form string. Recommended values include `age`,
                  `ageRange`, `yearOfBirth`, `gender`, `country`, `city`, `zip`,
                  `ethnicity`, `salaryRange`, `jobTitle`, and `other`. Only
                  `age` and `yearOfBirth` use similarity (±3); all other types
                  are exact match.
                example: age
              answer:
                type: string
                description: Demographic field value as a string.
                example: '34'
          example:
            - type: age
              answer: '34'
            - type: gender
              answer: female
            - type: country
              answer: AT
            - type: city
              answer: Vienna
      required:
        - qualityCheck
    InterviewData_v2:
      description: Structure for interview-based questions
      type: object
      required:
        - questionId
        - question
        - answer
      properties:
        questionId:
          type: string
          description: A unique identifier for the question
          example: Q1
        question:
          type: string
          description: '**Contains the title or text of the question**.'
          example: What type of accommodation did you stay in?
        answer:
          oneOf:
            - type: number
            - type: string
          description: A variable that stores the **respondent’s answer to the question**.
          example: Hotel
    InteractionData_V2:
      description: >-
        This variable compiles all relevant information about the interaction of
        the respondent with the data point. 

         🔦 **Tip:** Need a template to extract typing or mouse patterns directly from individual browsers? See the [example implementations](/api-reference/others/behavior-tracking).
      type: object
      required:
        - value
        - interactionType
        - timestamp
      properties:
        interactionType:
          type: string
          description: >-
            The type of interaction the respondent had with the data point. The
            shape of `value` depends on this field.
          enum:
            - KEYSTROKE
            - COPY_AND_PASTE
            - MOUSE_MOVEMENT
            - MOUSE_CLICK
        value:
          description: >+
            The value of the interaction. Its shape depends on
            `interactionType`: a string for `KEYSTROKE` and `COPY_AND_PASTE`,
            coordinates for `MOUSE_MOVEMENT`, and click metadata for
            `MOUSE_CLICK`. 

          oneOf:
            - title: KEYSTROKE
              type: string
              description: >-
                Used when `interactionType` is `KEYSTROKE`. Should include the
                final value once the interaction is complete.
              example: W
            - title: COPY_AND_PASTE
              type: string
              description: >-
                Used when `interactionType` is `COPY_AND_PASTE`. Should include
                the final value once the interaction is complete.
              example: W
            - title: MOUSE_MOVEMENT
              type: object
              description: Used when `interactionType` is `MOUSE_MOVEMENT`.
              properties:
                x:
                  type: integer
                  description: The horizontal pointer position in pixels.
                'y':
                  type: integer
                  description: The vertical pointer position in pixels.
              required:
                - x
                - 'y'
              example:
                x: 512
                'y': 384
            - title: MOUSE_CLICK
              type: object
              description: Used when `interactionType` is `MOUSE_CLICK`.
              properties:
                width:
                  type: integer
                  description: The width of the clicked element in pixels.
                height:
                  type: integer
                  description: The height of the clicked element in pixels.
                offsetX:
                  type: integer
                  description: >-
                    The horizontal click position relative to the clicked
                    element.
                offsetY:
                  type: integer
                  description: The vertical click position relative to the clicked element.
                x:
                  type: integer
                  description: The horizontal click position in viewport pixels.
                'y':
                  type: integer
                  description: The vertical click position in viewport pixels.
                pointerType:
                  type: string
                  nullable: true
                  enum:
                    - mouse
                    - pen
                    - touch
                    - null
                  description: >-
                    The pointer that produced the click (`mouse`, `pen`, or
                    `touch`). Optional. Omitted, empty, and any other value are
                    stored as `null`.
              required:
                - width
                - height
                - offsetX
                - offsetY
                - x
                - 'y'
              example:
                width: 320
                height: 48
                offsetX: 120
                offsetY: 24
                x: 512
                'y': 384
                pointerType: mouse
        timestamp:
          type: string
          description: >-
            The timestamp of the interaction. The timestamp is in the format
            `YYYY-MM-DDTHH:MM:SS.SSSZ`.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: api-key

````

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