{ "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": [] } ], "components": { "securitySchemes": { "apiKeyAuth": { "type": "apiKey", "in": "header", "name": "api-key" } }, "schemas": { "InterviewData": { "description": "Structure for interview-based questions", "type": "object", "required": [ "question", "answer" ], "properties": { "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": { "description": "This variable compiles all relevant information about the interaction of the respondent with the data point. \n\n 🔦 **Tip:** Need a template to extract keystroke patterns directly from individual browsers? Contact us at [support@redem.io](mailto:support@redem.io)", "type": "object", "required": [ "value", "interactionType", "timestamp" ], "properties": { "interactionType": { "type": "string", "description": "The type of interaction the respondent had with the data point. \n\n ⭕ **Note:** Currently, the API supports `KEYSTROKE` and `COPY_AND_PASTE` interactions. Future updates will extend support to additional interactions, such as **mouse clicks, mouse movements**, and more.", "enum": [ "KEYSTROKE", "COPY_AND_PASTE" ] }, "value": { "type": "string", "description": "The value of the interaction, which should include the final value once the interaction is complete." }, "timestamp": { "type": "string", "description": "The timestamp of the interaction. The timestamp is in the format `YYYY-MM-DDTHH:MM:SS.SSSZ`." } } }, "DataPoint": { "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", "BAS": "#/components/schemas/BASDataPoint" } }, "oneOf": [ { "$ref": "#/components/schemas/OESDataPoint" }, { "$ref": "#/components/schemas/TSDataPoint" }, { "$ref": "#/components/schemas/GQSDataPoint" }, { "$ref": "#/components/schemas/CHSDataPoint" }, { "$ref": "#/components/schemas/BASDataPoint" } ] }, "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. \n\n 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. \n\n 🧪 **Validations:** \n - 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. \n\n 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. \n\nThe 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. \n\n For more details on how this works, refer to the [Wrong Topic Check](/quality-checks/open-ended-score#wrong-topic) section. \n\n 🧪 **Validations:** \n - 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**. \n\n This checks if an answer is identical to another respondent's answer or if a respondent provided the same answer to multiple questions. \n\n 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.\n\n If no languages are specified, the wrong language check will not be performed. \n\n **🔦 Tip:** To ensure accurate language detection, set the expected language to the one the respondent used to complete the questionnaire. \n\n For more details on how this works, refer to the [Wrong Language Check](/quality-checks/open-ended-score#wrong-language) section. \n\n 🧪 **Validations:** \n - 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. \n\n **💬 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**. \n\n 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. \n\n 🧪 **Validations:** \n - A **minimum of 5** answers are allowed for each grid question. \n - Pattern checks beyond straightlining are applied only for grids with **7 or more** answers. \n - 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": { "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. \n\n **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" }, "description": "This variable aggregates all relevant question-answer pairs used to evaluate the respondent's coherence. \n\n 🧪 **Validations:** \n - A **maximum of 300** question/answer pairs are allowed per respondent.", "example": [ { "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. \n\n 🧪 **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": { "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" }, "description": "This variable compiles all relevant information about the interaction of the respondent with the data point. \n\n 🔦 **Tip:** Need a template to extract keystroke patterns directly from individual browsers? Contact us at [support@redem.io](mailto:support@redem.io)", "example": [ { "interactionType": "KEYSTROKE", "value": "W", "timestamp": "2024-12-01T06:22:59.833Z" } ] } }, "required": [ "dataPointId", "qualityCheck", "interactionData" ] }, "AddRespondentRequest": { "description": "Request body for adding a new respondent \n\n **🔒 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.\n\n**💡 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. \n\nIf the combination of survey name and respondent ID already exists, an error will be displayed. \n\n **🔦 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. \n\n**💡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. \n\n **⭕ Note:** Each survey identifier must be unique. \n\n **🔦 Tip:** you can simply make survey name unique by adding a timestamp. \n As Example: `Global Vacation Insights - 1709040600`" }, "dataPoints": { "type": "array", "items": { "$ref": "#/components/schemas/DataPoint" }, "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.\n\n 🧪 **Validations:** \n - A **maximum of 10** `OES` data points are allowed per respondent. \n - A **maximum of 100** `TS` data points are allowed per respondent. \n - A **maximum of 20** `GQS` data points are allowed per respondent. \n - A **maximum of 1 with 300 question/answer pairs** `CHS` data point is allowed per respondent. \n\n 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**. \n\n **💡Important:** To get an indicator whether respondents should be removed from the sample, ensure this variable is set to true. \n\n 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": { "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**.\n\n **💡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) \n \n For more details on how cleaning works, refer to the [Data Cleaning](/knowledge-base/features/cleaning-and-review) section.", "$ref": "#/components/schemas/CleaningSettings" }, "synchronousResponse": { "type": "boolean", "description": "**Indicates whether the response should be processed synchronously**. \n\n - Set to `true` if you need an immediate response. \n - 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/v1/getRespondent).", "example": true, "default": true } } }, "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" } } }, "DataPointsQualityResponse_v3": { "description": "Quality check results for a single datapoint (v3, includes effort level for applicable OES categories).", "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" }, "effort": { "type": "string", "enum": [ "LOW", "MEDIUM", "HIGH" ], "description": "**Effort level detected for the response** (API v3 only). Available when `qualityCheck` is `OES` and the `category` is `VALID_ANSWER` or `NO_ANSWER`.", "example": "HIGH" }, "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" }, "translatedAnswer": { "type": "string", "description": "English translation of the open-end answer when `shouldTranslate` was `true` and translation succeeded.", "example": "We were at Lake Garda in Italy" }, "translationFailed": { "type": "boolean", "description": "True when translation was requested but failed. Present only when `shouldTranslate` was `true`.", "example": false }, "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" } } }, "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` \n\n **⭕ 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" } } }, "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.. \n\n 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." } } }, "RespondentResults_v3": { "allOf": [ { "$ref": "#/components/schemas/RespondentResults" }, { "type": "object", "properties": { "dataPointsSummary": { "type": "array", "items": { "$ref": "#/components/schemas/DataPointsQualityResponse_v3" }, "description": "Detailed results of quality checks performed at the individual data point level (includes `effort` for applicable OES categories)." }, "exclusionCategories": { "type": "object", "description": "Only available in **v3**. Categories that triggered a category-based exclusion. Present when a category exclusion fired. Keys are `OES`, `BAS`, and `DES`. Additional category values may be added without a new API version.", "properties": { "OES": { "type": "array", "items": { "type": "string" }, "description": "OES categories that triggered exclusion. Current values: `NO_ANSWER`, `BAD_LANGUAGE`, `GIBBERISH`, `DUPLICATE_ANSWER`, `DUPLICATE_RESPONDENT`, `OFF_TOPIC`, `WRONG_LANGUAGE`, `AI_SUSPECT`.", "example": [ "GIBBERISH" ] }, "BAS": { "type": "array", "items": { "type": "string" }, "description": "BAS categories that triggered exclusion. Current values: `UNNATURAL_TYPING`, `UNNATURAL_MOVEMENT`, `COPY_AND_PASTE`." }, "DES": { "type": "array", "items": { "type": "string" }, "description": "DES categories that triggered exclusion. Current values: `DUPLICATE_IP`, `DUPLICATE_ENTRANT`.", "example": [ "DUPLICATE_IP" ] } } } } } ] }, "AddSurveyRequest": { "description": "Request body for creating or customizing a survey", "required": [ "surveyName", "cleaningSettings" ], "type": "object", "properties": { "projectName": { "type": "string", "description": "Optional survey name for grouping surveys", "example": "customer-satisfaction-2024" }, "surveyName": { "type": "string", "description": "Unique identifier for the survey", "example": "customer-survey-2024" }, "cleaningSettings": { "$ref": "#/components/schemas/CleaningSettings", "example": { "ReDemSettings": true, "CustomSettings": { "redemScore": 80, "qualityChecks": [ { "type": "OES", "score": 70, "minimumAnswers": 5 } ] } } } } }, "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" } } } } } } } } }, "CleaningSettings_v3": { "description": "Configuration for data cleaning and review process (v3 with OES v3 categories)", "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": { "AI_SUSPECT": { "type": "object", "properties": { "activate": { "type": "boolean" }, "minDataPoints": { "type": "number" } } }, "BAD_LANGUAGE": { "type": "object", "properties": { "activate": { "type": "boolean" }, "minDataPoints": { "type": "number" } } }, "OFF_TOPIC": { "type": "object", "properties": { "activate": { "type": "boolean" }, "minDataPoints": { "type": "number" } } }, "NO_ANSWER": { "type": "object", "properties": { "activate": { "type": "boolean" }, "minDataPoints": { "type": "number" } } }, "WRONG_LANGUAGE": { "type": "object", "properties": { "activate": { "type": "boolean" }, "minDataPoints": { "type": "number" } } }, "GIBBERISH": { "type": "object", "properties": { "activate": { "type": "boolean" }, "minDataPoints": { "type": "number" } } }, "DUPLICATE_RESPONDENT": { "type": "object", "properties": { "activate": { "type": "boolean" }, "minDataPoints": { "type": "number" } } }, "DUPLICATE_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" } } } } } } }, "DES": { "type": "object", "description": "Cleaning settings for Duplicate Entrance Score (DES).", "properties": { "activate": { "type": "boolean", "description": "Indicates whether **DES** should be applied as a cleaning parameter.", "example": true }, "score": { "type": "number", "description": "Minimum score threshold for DES. Respondents below this score are excluded when DES cleaning is active. Recommended default: `40`.", "example": 40 }, "categories": { "type": "object", "description": "Optional category-based exclusion toggles. Off by default in recommended settings.", "properties": { "DUPLICATE_IP": { "type": "object", "properties": { "activate": { "type": "boolean" }, "minDataPoints": { "type": "number" } } }, "DUPLICATE_ENTRANT": { "type": "object", "properties": { "activate": { "type": "boolean" }, "minDataPoints": { "type": "number" } } } } } } } } }, "CreditCalculationRequest": { "description": "Request body for calculating the maximum number of credits needed for a respondent. Send exactly one of `GQSDataPoints` or `GQSAnswers`. Sending both returns 400.\n\n **🔒 Authentication:** Requires a **private** API key. Public keys may only call `addRespondent`.", "required": [ "OESDataPoints", "TSDataPoints", "CHSAnswers", "BASDataPoints" ], "type": "object", "properties": { "OESDataPoints": { "type": "number", "description": "**The number of data points** to be used for the Open-Ended Score (OES). \n **⭕ Note:** If no OES data points are available, this value can be set to `0`." }, "GQSDataPoints": { "type": "number", "description": "**The number of GQS data points** to price. Modular: `min(0.2 × n, 2)`. All-inclusive: `min(0.2 × max(0, n − 5), 2)`. Send this or `GQSAnswers`, not both." }, "GQSAnswers": { "type": "number", "description": "Legacy alias for GQS. Deprecated; prefer `GQSDataPoints`. Send this or `GQSDataPoints`, not both." }, "TSDataPoints": { "type": "number", "description": "**The number of data points** to be used for the Time Score (TS). \n **⭕ Note:** If no TS data points are available, this value can be set to `0`." }, "CHSAnswers": { "type": "number", "description": "**The number of data points** to be used for the Coherence Score (CHS). \n **⭕ Note:** If no CHS answers are available, this value can be set to `0`." }, "BASDataPoints": { "type": "number", "description": "**The number of data points** to be used for the Behavioral-Analytics Score (BAS). \n **⭕ Note:** If no BAS data points are available, this value can be set to `0`." }, "DESDataPoints": { "type": "number", "default": 0, "description": "**The number of data points** to be used for the Duplicate Entrance Score (DES). Optional; defaults to `0` if omitted. \n **⭕ Note:** If no DES data points are available, this value can be omitted or set to `0`." } } }, "CalculationBreakdown": { "description": "Detailed breakdown of the number of credits estimated for a respondent", "type": "object", "properties": { "OES": { "type": "object", "description": "Detailed breakdown of the number of OES credits estimated for a respondent", "properties": { "credits": { "type": "number", "description": "Number of OES credits estimated for a respondent" }, "dataPoints": { "type": "number", "description": "Number of OES data points estimated for a respondent" } } }, "GQS": { "type": "object", "description": "Detailed breakdown of the number of GQS credits estimated for a respondent", "properties": { "credits": { "type": "number", "description": "Number of GQS credits estimated for a respondent" }, "dataPoints": { "type": "number", "description": "Number of GQS data points. Present when the request used `GQSDataPoints`." }, "answers": { "type": "number", "description": "Echo of the request `GQSAnswers` value. Present when the request used `GQSAnswers`." } } }, "TS": { "type": "object", "description": "Detailed breakdown of the number of TS credits estimated for a respondent", "properties": { "credits": { "type": "number", "description": "Number of TS credits estimated for a respondent" }, "dataPoints": { "type": "number", "description": "Number of TS data points estimated for a respondent" } } }, "CHS": { "type": "object", "description": "Detailed breakdown of the number of CHS credits estimated for a respondent", "properties": { "credits": { "type": "number", "description": "Number of CHS credits estimated for a respondent" }, "answers": { "type": "number", "description": "Number of CHS interviews estimated for a respondent" } } }, "BAS": { "type": "object", "description": "Detailed breakdown of the number of BAS credits estimated for a respondent", "properties": { "credits": { "type": "number", "description": "Number of BAS credits estimated for a respondent" }, "answers": { "type": "number", "description": "Number of BAS data points estimated for a respondent" } } }, "DES": { "type": "object", "description": "Detailed breakdown of the number of DES credits estimated for a respondent", "properties": { "credits": { "type": "number", "description": "Number of DES credits estimated for a respondent" }, "dataPoints": { "type": "number", "description": "Number of DES data points estimated for a respondent" } } } } }, "GetRespondentRequest": { "description": "Request body for getting a respondent \n\n **🔒 Authentication:** Requires a **private** API key. Public keys may only call `addRespondent`.", "required": [ "surveyName", "respondentId" ], "type": "object", "properties": { "surveyName": { "type": "string", "description": "**The name of the survery**.", "example": "Global Vacation Insights 2024" }, "respondentId": { "type": "string", "description": "**The unique identifier for a respondent**, making it easy to distinguish them from others in the survey", "example": "RESP497770" } } }, "GetAllRespondentsRequest": { "description": "Request body for getting all respondents \n\n **🔒 Authentication:** Requires a **private** API key. Public keys may only call `addRespondent`.", "required": [ "surveyName" ], "type": "object", "properties": { "surveyName": { "type": "string", "description": "**The name of the survey**." } } }, "RestartSurveyRequest": { "description": "Request body for restarting a survey \n\n **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type", "required": [ "surveyName" ], "type": "object", "properties": { "surveyName": { "type": "string", "description": "**The name of the survey**." } } }, "StopSurveyRequest": { "description": "Request body for stopping a survey \n\n **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type", "required": [ "surveyName" ], "type": "object", "properties": { "surveyName": { "type": "string", "description": "**The name of the survey**." } } }, "AddRespondentRequest_v2": { "description": "Request body for adding a new respondent \n\n **🔒 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.\n\n**💡 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. \n\nIf the combination of survey name and respondent ID already exists, an error will be displayed. \n\n **🔦 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. \n\n**💡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. \n\n **⭕ Note:** Each survey identifier must be unique. \n\n **🔦 Tip:** you can simply make survey name unique by adding a timestamp. \n 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.\n\n 🧪 **Validations:** \n - A **maximum of 10** `OES` data points are allowed per respondent. \n - A **maximum of 100** `TS` data points are allowed per respondent. \n - A **maximum of 20** `GQS` data points are allowed per respondent. \n - A **maximum of 1 with 300 question/answer pairs** `CHS` data point is allowed per respondent. \n\n 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**. \n\n **💡Important:** To get an indicator whether respondents should be removed from the sample, ensure this variable is set to true. \n\n 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": { "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**.\n\n **💡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) \n \n For more details on how cleaning works, refer to the [Data Cleaning](/knowledge-base/features/cleaning-and-review) section.", "$ref": "#/components/schemas/CleaningSettings" }, "synchronousResponse": { "type": "boolean", "description": "**Indicates whether the response should be processed synchronously**. \n\n - Set to `true` if you need an immediate response. \n - 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 } } }, "AddRespondentRequest_v3": { "description": "Request body for adding a new respondent (v3 with OES v3 categories) \n\n **🔒 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.\n\n**💡 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. \n\nIf the combination of survey name and respondent ID already exists, an error will be displayed. \n\n **🔦 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. \n\n**💡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. \n\n **⭕ Note:** Each survey identifier must be unique. \n\n **🔦 Tip:** you can simply make survey name unique by adding a timestamp. \n As Example: `Global Vacation Insights - 1709040600`" }, "surveyPlatform": { "type": "string", "description": "**Optional platform identifier** for the source system where the respondent was collected (for example, SightX, Qualtrics, or custom panel tooling). This helps identify the origin of respondents created through API integrations. \n\n **Recommendation for integrators:** Always populate this field with a stable platform name for API-based survey tool integrations.", "example": "SightX" }, "referenceSurveyId": { "type": "string", "description": "**Optional external survey identifier** from your own system (for example, the project or survey id in your survey tool). When ReDem **creates** a new survey for the given `surveyName`, this value is stored on the survey. If the survey already exists, the existing stored value is **not** overwritten by a different `referenceSurveyId` in a later request." }, "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. For the Duplicate Entrance Score (DES), only a single data point is allowed.\n\n🧪 **Validations:** \n - A **maximum of 30** `OES` data points are allowed per respondent. \n - A **maximum of 500** `TS` data points are allowed per respondent. \n - A **maximum of 20** `GQS` data points are allowed per respondent. \n - A **maximum of 1 with 300 question/answer pairs** `CHS` data point is allowed per respondent. \n - A **maximum of 30** `BAS` data points are allowed per respondent. \n - A **maximum of 1** `DES` data point is allowed per respondent (v3 only). \n\nExceeding 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**. \n\n **💡Important:** To get an indicator whether respondents should be removed from the sample, ensure this variable is set to true. \n\n 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": { "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**.\n\n **💡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) \n \n For more details on how cleaning works, refer to the [Data Cleaning](/knowledge-base/features/cleaning-and-review) section.", "$ref": "#/components/schemas/CleaningSettings_v3" }, "synchronousResponse": { "type": "boolean", "description": "**Indicates whether the response should be processed synchronously**. \n\n - Set to `true` if you need an immediate response. \n - 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/v3/getRespondent).", "example": true, "default": true }, "respondentAttributes": { "type": "object", "description": "**Additional attributes** for the respondent. Contains a list of key-value pairs that can be used to add additional metadata to the respondent, such as the panel source or the market of a respondent. \n\n These values will be available in the ReDem App and in the result export. They can be used for further analysis of your data.", "example": { "panel": "Panel Name", "country": "United States" } }, "retentionDays": { "type": "number", "description": "**The number of days to retain the respondent's data**. \n\n Use this in case you have specific requirements for data retention. After the retention period is over the respondent will be deleted from ReDem. The data will be no longer available in our platform. The minimum value is 30 days.", "example": 30 } } }, "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" } ] }, "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. \n\n **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. \n\n 🧪 **Validations:** \n - 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. \n\n 🧪 **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" ] }, "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" } } }, "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. \n\n 🔦 **Tip:** Need a template to extract typing or mouse patterns directly from individual browsers? See the [example implementations](/api-reference/others/behavior-tracking). \n\n ⭕ **Note:** \n - 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. \n - 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. \n", "example": [ { "interactionType": "KEYSTROKE", "value": "W", "timestamp": "2024-12-01T06:22:59.833Z" } ] } }, "required": [ "dataPointId", "qualityCheck", "interactionData" ] }, "InteractionData_V2": { "description": "This variable compiles all relevant information about the interaction of the respondent with the data point. \n\n 🔦 **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`. \n\n", "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`." } } }, "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.\n\n🧪 **Validations:**\n- **0–10** items accepted\n- **Fewer than 4** and **no IP** → request is accepted, but DES is scored as invalid (`N/A`)\n- **Fewer than 4** **with IP** → IP-only check (`DUPLICATE_IP` / `VALID_ENTRANT`)\n- **More than 10** → validation error\n- Each `type` must be **unique** in the array (prefer custom type strings over repeating `\"other\"`)\n\nRecommended `type` values: `age`, `ageRange`, `yearOfBirth`, `gender`, `country`, `city`, `zip`, `ethnicity`, `salaryRange`, `jobTitle`, `other`, or any custom string.\n\n**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" ] }, "SurveyStructureQuestion": { "description": "A question from your survey platform questionnaire. Discriminated by `questionType` (`OpenEnd` | `Grid` | `Select`) — each variant has its own required and optional fields. `questionId` values must be unique across `surveyStructure`.", "discriminator": { "propertyName": "questionType", "mapping": { "OpenEnd": "#/components/schemas/SurveyStructureOpenEnd", "Grid": "#/components/schemas/SurveyStructureGrid", "Select": "#/components/schemas/SurveyStructureSelect" } }, "oneOf": [ { "$ref": "#/components/schemas/SurveyStructureOpenEnd" }, { "$ref": "#/components/schemas/SurveyStructureGrid" }, { "$ref": "#/components/schemas/SurveyStructureSelect" } ] }, "QualityCheckSuggestionsRequest": { "type": "object", "description": "Request body for generating quality-check suggestions for an API project setup.\n\n **🔒 Authentication:** This endpoint is only accessible via a [`PRIVATE` API key](/api-reference/api-specifications/api-keys#permission-levels).", "required": [ "surveyStructure" ], "properties": { "surveyPlatform": { "type": "string", "description": "Optional survey platform identifier (for example `SightX`, `qualtrics`). Stored for logging and support only; it does not change suggestions.", "example": "SightX" }, "allInclusive": { "type": "boolean", "default": true, "description": "When `true` (default), suggestion counts are capped to all-inclusive plan limits (OES 5, GQS 5, CHS 100 question slots). When `false`, higher API maxima are used (OES 30, GQS 20, CHS 300 slots)." }, "qualityChecks": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "enum": [ "OES", "GQS", "CHS", "BAS", "DES" ] }, "description": "Optional subset of quality checks to suggest. When omitted, suggestions run for OES, GQS, CHS, BAS, and DES.", "example": [ "OES", "GQS", "CHS", "BAS", "DES" ] }, "surveyStructure": { "type": "array", "maxItems": 500, "description": "Questionnaire structure used to suggest quality checks. Maximum **500** questions. Each item is a discriminated union on `questionType` (`OpenEnd`, `Grid`, or `Select`). Each `questionId` must be unique.", "items": { "$ref": "#/components/schemas/SurveyStructureQuestion" } } } }, "SuggestedOes": { "type": "object", "required": [ "questionId", "keywords", "enableDuplicateCheck" ], "properties": { "questionId": { "type": "string", "example": "Q1" }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "Suggested keywords for the OES datapoint.", "example": [ "price", "quality", "brand" ] }, "enableDuplicateCheck": { "type": "boolean", "description": "Whether duplicate answer / respondent detection should be enabled for this OES datapoint." } } }, "SuggestedGqs": { "type": "object", "required": [ "questionId", "enablePatternCheck" ], "properties": { "questionId": { "type": "string", "example": "Q2" }, "enablePatternCheck": { "type": "boolean", "description": "Whether to enable the GQS pattern check for this suggested grid." } } }, "SuggestedChs": { "type": "object", "required": [ "questionIds", "surveyDescription" ], "description": "Suggested Coherence Score configuration.", "properties": { "questionIds": { "type": "array", "items": { "type": "string" }, "description": "Suggested question IDs to include in the CHS interview.", "example": [ "Q3", "Q2" ] }, "surveyDescription": { "type": "string", "description": "Suggested survey description for CHS context.", "example": "A survey about brand preference and product choice among shoppers." } } }, "SuggestedBas": { "type": "object", "required": [ "questionId", "keystrokes", "mouse" ], "properties": { "questionId": { "type": "string", "description": "Question to track. Open ends come from suggested OES questions. Grids come from suggested GQS questions with 5 or more items.", "example": "Q1" }, "keystrokes": { "type": "boolean", "description": "`true` for open ends. `false` for grids.", "example": true }, "mouse": { "type": "boolean", "description": "`true` for grids with 5 or more items. `false` for open ends.", "example": false } } }, "SuggestedDes": { "type": "object", "required": [ "type", "questionId" ], "description": "Suggested Duplicate Entrance Score demographic mapping.", "properties": { "type": { "type": "string", "description": "Recommended DES demographic type.", "enum": [ "age", "ageRange", "yearOfBirth", "gender", "country", "city", "zip", "ethnicity", "salaryRange", "jobTitle" ], "example": "ageRange" }, "questionId": { "type": "string", "description": "Survey question ID to map to this demographic type.", "example": "Q3" } } }, "QualityCheckSuggestionsResults": { "type": "object", "required": [ "OES", "GQS", "CHS", "BAS", "DES", "cleaningSettings" ], "properties": { "OES": { "type": "array", "items": { "$ref": "#/components/schemas/SuggestedOes" }, "description": "Suggested open-ended checks." }, "GQS": { "type": "array", "items": { "$ref": "#/components/schemas/SuggestedGqs" }, "description": "Suggested grid checks." }, "CHS": { "type": "object", "required": [ "questionIds", "surveyDescription" ], "description": "Suggested Coherence Score configuration.", "properties": { "questionIds": { "type": "array", "items": { "type": "string" }, "description": "Suggested question IDs to include in the CHS interview.", "example": [ "Q3", "Q2" ] }, "surveyDescription": { "type": "string", "description": "Suggested survey description for CHS context.", "example": "A survey about brand preference and product choice among shoppers." } } }, "BAS": { "type": "array", "items": { "$ref": "#/components/schemas/SuggestedBas" }, "description": "Suggested behavior tracking targets. Open ends use `keystrokes: true`. Grids with 5 or more items use `mouse: true`." }, "DES": { "type": "array", "items": { "$ref": "#/components/schemas/SuggestedDes" }, "description": "Suggested DES demographic mappings (`type` + `questionId`). Empty when DES was not requested or no suitable demographics were found." }, "cleaningSettings": { "description": "Recommended default cleaning settings for API v3 projects (includes DES). Same shape as [`cleaningSettings` on Add Respondent](/api-reference/endpoints/v3/addRespondent#body-cleaning-settings).", "allOf": [ { "$ref": "#/components/schemas/CleaningSettings_v3" } ] } } }, "SurveyStructureOpenEnd": { "type": "object", "title": "OpenEnd", "description": "Open-ended question. Candidate for **OES** / **BAS** suggestions.\n\nOnly `questionId`, `questionType`, and `question` are accepted for this type — do not send `items`, `answerOptions`, `isMultiSelect`.", "required": [ "questionId", "questionType", "question" ], "properties": { "questionId": { "type": "string", "minLength": 1, "description": "Unique question identifier within `surveyStructure`.", "example": "Q1" }, "questionType": { "type": "string", "enum": [ "OpenEnd" ], "description": "Must be `OpenEnd`." }, "question": { "type": "string", "minLength": 1, "description": "Full question text.", "example": "Why did you choose this product?" } } }, "SurveyStructureGrid": { "type": "object", "title": "Grid", "description": "Grid / matrix question. Candidate for **GQS** / **CHS** suggestions.\n\n`items` and `answerOptions` are required. `isMultiSelect` is optional (default `false`).", "required": [ "questionId", "questionType", "question", "items", "answerOptions" ], "properties": { "questionId": { "type": "string", "minLength": 1, "description": "Unique question identifier within `surveyStructure`.", "example": "Q2" }, "questionType": { "type": "string", "enum": [ "Grid" ], "description": "Must be `Grid`." }, "question": { "type": "string", "minLength": 1, "description": "Full question text.", "example": "Please rate the following brands." }, "items": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "Row / item labels shown in the grid. At least one item required.", "example": [ "Brand A", "Brand B", "Brand C", "Brand D", "Brand E" ] }, "answerOptions": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "Column / scale labels. At least one option required.", "example": [ "Very poor", "Poor", "Neutral", "Good", "Excellent" ] }, "isMultiSelect": { "type": "boolean", "default": false, "description": "Whether respondents can select multiple answers per row. Defaults to `false`.", "example": false } } }, "SurveyStructureSelect": { "type": "object", "title": "Select", "description": "Single- or multi-select closed question. Candidate for **CHS** suggestions.\n\n`answerOptions` is required. `isMultiSelect` is optional (default `false`). Do not send `items` for this type.", "required": [ "questionId", "questionType", "question", "answerOptions" ], "properties": { "questionId": { "type": "string", "minLength": 1, "description": "Unique question identifier within `surveyStructure`.", "example": "Q3" }, "questionType": { "type": "string", "enum": [ "Select" ], "description": "Must be `Select`." }, "question": { "type": "string", "minLength": 1, "description": "Full question text.", "example": "Which age group are you in?" }, "answerOptions": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "Answer choices. At least one option required.", "example": [ "18-24", "25-34", "35-44", "45-54", "55+" ] }, "isMultiSelect": { "type": "boolean", "default": false, "description": "Whether respondents can select multiple answers. Defaults to `false`.", "example": false } } } }, "responses": { "ValidationError": { "description": "Validation Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": false }, "message": { "type": "string", "example": "Validation Error" }, "errors": { "type": "object", "description": "Keyed by error index or field name; each value is a human-readable description of the validation issue.", "additionalProperties": { "type": "string" }, "example": { "0": "\"surveyName\" is required" } } } }, "example": { "success": false, "message": "Validation Error", "errors": { "0": "\"surveyName\" is required" } } } } }, "UnauthorizedError": { "description": "Unauthorized Access", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "number", "example": 401 }, "message": { "type": "string", "example": "UNAUTHORIZED" } } } } } }, "DuplicateError": { "description": "Duplicate Respondent Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "number", "example": 409 }, "message": { "type": "string", "example": "DUPLICATE_RESPONDENT" } } } } } }, "ServerError": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "number", "example": 500 }, "message": { "type": "string", "example": "INTERNAL_SERVER_ERROR" } } } } } }, "ProjectNotFoundError": { "description": "Project Not Found Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "number", "example": 404 }, "message": { "type": "string", "example": "PROJECT_NOT_FOUND" } } } } } }, "RespondentNotFoundError": { "description": "Respondent Not Found Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "number", "example": 404 }, "message": { "type": "string", "example": "RESPONDENT_NOT_FOUND" } } } } } } } }, "tags": [ { "name": "Survey", "description": "Survey management" }, { "name": "Respondent", "description": "Respondent management" } ], "paths": { "/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" }, "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": [ { "question": "What mode of transport did you use?", "answer": "Car" }, { "question": "How many days did you stay?", "answer": 5 }, { "question": "Did you travel with family?", "answer": "yes" }, { "question": "What was your approximate total budget for the trip (in EUR)?", "answer": 1500 }, { "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": { "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 } } } }, "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** \n\nThis response mode is triggered when `synchronousResponse` is set to `true`. \n\n 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**. \n\n **💡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. \n\n **⭕ 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** \n\nThis response mode is triggered when `synchronousResponse` is set to `false`. \n\n 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/v1/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. \n\n **⭕ 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. \n\n **⭕ 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. \n\n **⭕ 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. \n\n **⭕ 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. \n\n **⭕ 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": {} } } } } } } } } }, "/getRespondent": { "post": { "tags": [ "Respondent" ], "summary": "Get respondent results", "description": "Retrieve the quality check results and status for a specific respondent.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetRespondentRequest" }, "example": { "surveyName": "Global Vacation Insights 2024", "respondentId": "RESP497770" } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API responds with a `200 OK` status code and the expected data. The structure of the response varies based on the respondent's status.", "content": { "application/json": { "schema": { "oneOf": [ { "title": "Respondet Completed", "description": "This response mode available when respondent status is `COMPLETED`. \n\n In this case, the system generates a comprehensive, quality assessment of the respondent.", "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 respondents who have been successfully evaluated, this value will always be `COMPLETED`." }, "respondentQuality": { "description": "This variable **represents respondent data that has been evaluated based on the quality checks specified in the /addRespondent request**. \n\n 💡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. \n\n **⭕ 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.", "$ref": "#/components/schemas/RespondentResults" } } } } }, { "title": "Respondent Processing", "description": "This response mode available when respondent status is `QUEUED`. \n\n In this case, the system will only return the status of the respondent, without the quality assessment of the respondent.", "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable that **indicates whether the operation was successful or not**.", "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "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 respondents who are still being processed, this value will always be `QUEUED`." } } } } } ] }, "examples": { "Respondent Completed": { "summary": "Respondent Completed Example", "value": { "success": true, "message": "Respondent quality successfully retrieved", "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 ..." }, { "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" } ] } } } }, "Respondent Processing": { "summary": "Respondent Processing Example", "value": { "success": true, "message": "Respondent quality successfully retrieved", "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Respondent not found", "description": "This error occurs when the **requested respondentId does not exist in the system**. It may happen if the respondent has not been added to the specified survey or if an incorrect ID was provided. \n\n **⭕ 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": "\"respondentId\" is required" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } }, "Respondent not found": { "value": { "success": false, "message": "Respondent not found", "errors": {} } } } } } } } } }, "/getAllRespondents": { "post": { "tags": [ "Respondent" ], "summary": "Get all respondents", "description": "Retrieve the quality check results and status for all respondents in a specific survey.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetAllRespondentsRequest" }, "example": { "surveyName": "Global Vacation Insights 2024" } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API responds with a `200 OK` status code and the expected data.", "content": { "application/json": { "schema": { "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": "array", "description": "This variable includes **all quality parameters associated with a respondent**.", "items": { "type": "object", "properties": { "respondentId": { "type": "string", "description": "**The unique identifier for a respondent**, making it easy to distinguish them from others in the survey.", "example": "RESP497770" }, "status": { "type": "string", "description": "A variable that **indicates the current state of the respondent**. \n\n **💡Important:** Even if a respondent fails evaluation, the response status will still be `COMPLETED`. \n\n **⭕ 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.", "enum": [ "COMPLETED", "QUEUED" ] }, "respondentQuality": { "description": "This variable **represents respondent data that has been evaluated according to the quality checks specified in the /addRespondent request**. \n\n **⭕ Note:** this variable will only available if the respondent status is `COMPLETED`.", "$ref": "#/components/schemas/RespondentResults" } } } } } }, "example": { "success": true, "message": "Respondents quality retrieved successfully", "results": [ { "respondentId": "RESP497770", "status": "COMPLETED", "respondentQuality": { "isExcluded": false, "reasonsForExclusion": [ "Open Ended Score Threshold", "Coherence Score Threshold" ], "redemScore": 85, "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 } ], "qualityScoreSummary": [ { "qualityCheck": "OES", "score": 80 }, { "qualityCheck": "CHS", "score": 75, "reason": "The user shows several inconsistencies and contradictions, such as different ..." }, { "qualityCheck": "GQS", "score": 85 }, { "qualityCheck": "TS", "score": 70 } ] } }, { "respondentId": "RESP497771", "status": "PROCESSING" }, { "respondentId": "RESP497772", "status": "PROCESSING" }, { "respondentId": "RESP497773", "status": "COMPLETED", "respondentQuality": { "isExcluded": false, "reasonsForExclusion": [], "redemScore": -999, "dataPointsSummary": [ { "qualityCheck": "OES", "dataPointId": "Q1", "score": -999, "category": "N/A" }, { "qualityCheck": "TS", "dataPointId": "durationQ1", "score": -999 }, { "qualityCheck": "GQS", "dataPointId": "Q2", "score": -999 }, { "qualityCheck": "OES", "dataPointId": "Q3", "score": -999, "category": "N/A" }, { "qualityCheck": "TS", "dataPointId": "durationQ3", "score": -999 }, { "qualityCheck": "CHS", "dataPointId": "CHS_Question", "score": -999, "reason": "N/A" }, { "qualityCheck": "GQS", "dataPointId": "Q4", "score": -999 }, { "qualityCheck": "TS", "dataPointId": "totalDuration", "score": -999 } ], "qualityScoreSummary": [ { "qualityCheck": "OES", "score": -999 }, { "qualityCheck": "CHS", "score": -999, "reason": "N/A" }, { "qualityCheck": "GQS", "score": -999 }, { "qualityCheck": "TS", "score": -999 } ] } } ] } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ 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" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } } } } } } } } }, "/stopSurvey": { "post": { "tags": [ "Survey" ], "summary": "Stop a survey", "operationId": "stopSurveyV2", "description": "API endpoint for stopping a survey. This can be triggered once the survey is completed.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StopSurveyRequest" }, "example": { "surveyName": "Global Vacation Insights 2024" } } } }, "responses": { "200": { "description": "Upon successful processing, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "surveyName": { "type": "string", "description": "A variable that **indicates the survey name**." }, "status": { "type": "string", "description": "A variable that **indicates the status of the survey**. \n\n **⭕ Note:** ReDem surveys have two possible statuses: `RUNNING` and `STOPPED`. The survey status will be updated to `STOPPED` once the survey is stopped." } } } } }, "example": { "success": true, "message": "Survey successfully stopped", "results": { "surveyId": "68e4f174adc679a59fe16324", "surveyName": "Global Vacation Insights 2024", "status": "STOPPED" } } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ 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" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } } } } } } } } }, "/restartSurvey": { "post": { "tags": [ "Survey" ], "summary": "Restart a survey", "operationId": "restartSurveyV3", "description": "API endpoint for restarting a survey. This can be triggered to resume a previously stopped survey.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RestartSurveyRequest" }, "example": { "surveyName": "Global Vacation Insights 2024" } } } }, "responses": { "200": { "description": "Upon successful processing, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "surveyId": { "type": "string", "description": "A variable that **indicates the unique survey identifier**." }, "surveyName": { "type": "string", "description": "A variable that **indicates the survey name**." }, "status": { "type": "string", "description": "A variable that **indicates the status of the survey**. \n\n **⭕ Note:** ReDem surveys have two possible statuses: `RUNNING` and `STOPPED`. The survey status will be updated to `RUNNING` once the survey is restarted." }, "previousStatus": { "type": "string", "description": "A variable that **indicates the previous status of the survey** before the restart." } } } } }, "example": { "success": true, "message": "Survey successfully restarted", "results": { "surveyId": "68e4f174adc679a59fe16324", "surveyName": "Global Vacation Insights 2024", "status": "RUNNING", "previousStatus": "STOPPED" } } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ 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" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } } } } } } } } }, "/creditCalculation": { "post": { "tags": [ "Respondent" ], "summary": "Calculate the maximum number of credits needed for a respondent", "operationId": "creditCalculationV2", "description": "API endpoint for calculating the required number of credits for a respondent.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditCalculationRequest" }, "example": { "OESDataPoints": 2, "GQSDataPoints": 7, "TSDataPoints": 2, "CHSAnswers": 25, "BASDataPoints": 2 } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "creditCalculation": { "description": "This variable **represents the detailed breakdown of the number of credits** calculated for a respondent.", "type": "object", "properties": { "totalCredits": { "type": "number", "description": "This variable **represents the total number of credits** calculated for a respondent." }, "calculationBreakdown": { "description": "This variable **represents the detailed breakdown of the number of credits** calculated for a respondent.", "$ref": "#/components/schemas/CalculationBreakdown" } } } } } } }, "example": { "success": true, "message": "Credit calculation successfully retrieved", "results": { "creditCalculation": { "totalCredits": 12, "calculationBreakdown": { "OES": { "credits": 4, "dataPoints": 2 }, "GQS": { "credits": 1.4, "dataPoints": 7 }, "TS": { "credits": 1, "dataPoints": 2 }, "CHS": { "credits": 4, "answers": 25 }, "BAS": { "credits": 4, "dataPoints": 2 } } } } } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Failed to calculate credits", "description": "This error occurs when the **system fails to calculate the credits**. \n\n **⭕ 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": "\"OESDataPoints\" is required", "1": "\"value\" must contain at least one of [GQSAnswers, GQSDataPoints]", "2": "\"TSDataPoints\" is required", "3": "\"CHSAnswers\" is required", "4": "\"BASDataPoints\" is required" } } }, "Failed to calculate credits": { "value": { "success": false, "message": "Failed to calculate credits", "errors": {} } } } } } } } } }, "/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": { "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 } } } }, "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** \n\nThis response mode is triggered when `synchronousResponse` is set to `true`. \n\n 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**. \n\n **💡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. \n\n **⭕ 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** \n\nThis response mode is triggered when `synchronousResponse` is set to `false`. \n\n 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. \n\n **⭕ 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. \n\n **⭕ 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. \n\n **⭕ 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. \n\n **⭕ 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. \n\n **⭕ 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": {} } } } } } } } } }, "/v2/getRespondent": { "post": { "tags": [ "Respondent" ], "summary": "Get respondent results", "description": "Retrieve the quality check results and status for a specific respondent.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetRespondentRequest" }, "example": { "surveyName": "Global Vacation Insights 2024", "respondentId": "RESP497770" } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API responds with a `200 OK` status code and the expected data. The structure of the response varies based on the respondent's status.", "content": { "application/json": { "schema": { "oneOf": [ { "title": "Respondet Completed", "description": "This response mode available when respondent status is `COMPLETED`. \n\n In this case, the system generates a comprehensive, quality assessment of the respondent.", "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 respondents who have been successfully evaluated, this value will always be `COMPLETED`." }, "respondentQuality": { "description": "This variable **represents respondent data that has been evaluated based on the quality checks specified in the /addRespondent request**. \n\n 💡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. \n\n **⭕ 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.", "$ref": "#/components/schemas/RespondentResults" } } } } }, { "title": "Respondent Processing", "description": "This response mode available when respondent status is `QUEUED`. \n\n In this case, the system will only return the status of the respondent, without the quality assessment of the respondent.", "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable that **indicates whether the operation was successful or not**.", "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "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 respondents who are still being processed, this value will always be `QUEUED`." } } } } } ] }, "examples": { "Respondent Completed": { "summary": "Respondent Completed Example", "value": { "success": true, "message": "Respondent quality successfully retrieved", "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 ..." }, { "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" } ] } } } }, "Respondent Processing": { "summary": "Respondent Processing Example", "value": { "success": true, "message": "Respondent quality successfully retrieved", "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Respondent not found", "description": "This error occurs when the **requested respondentId does not exist in the system**. It may happen if the respondent has not been added to the specified survey or if an incorrect ID was provided. \n\n **⭕ 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": "\"respondentId\" is required" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } }, "Respondent not found": { "value": { "success": false, "message": "Respondent not found", "errors": {} } } } } } } } } }, "/v2/getAllRespondents": { "post": { "tags": [ "Respondent" ], "summary": "Get all respondents", "description": "Retrieve the quality check results and status for all respondents in a specific survey.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetAllRespondentsRequest" }, "example": { "surveyName": "Global Vacation Insights 2024" } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API responds with a `200 OK` status code and the expected data.", "content": { "application/json": { "schema": { "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": "array", "description": "This variable includes **all quality parameters associated with a respondent**.", "items": { "type": "object", "properties": { "respondentId": { "type": "string", "description": "**The unique identifier for a respondent**, making it easy to distinguish them from others in the survey.", "example": "RESP497770" }, "status": { "type": "string", "description": "A variable that **indicates the current state of the respondent**. \n\n **💡Important:** Even if a respondent fails evaluation, the response status will still be `COMPLETED`. \n\n **⭕ 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.", "enum": [ "COMPLETED", "QUEUED" ] }, "respondentQuality": { "description": "This variable **represents respondent data that has been evaluated according to the quality checks specified in the /addRespondent request**. \n\n **⭕ Note:** this variable will only available if the respondent status is `COMPLETED`.", "$ref": "#/components/schemas/RespondentResults" } } } } } }, "example": { "success": true, "message": "Respondents quality retrieved successfully", "results": [ { "respondentId": "RESP497770", "status": "COMPLETED", "respondentQuality": { "isExcluded": false, "reasonsForExclusion": [ "Open Ended Score Threshold", "Coherence Score Threshold" ], "redemScore": 85, "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 } ], "qualityScoreSummary": [ { "qualityCheck": "OES", "score": 80 }, { "qualityCheck": "CHS", "score": 75, "reason": "The user shows several inconsistencies and contradictions, such as different ..." }, { "qualityCheck": "GQS", "score": 85 }, { "qualityCheck": "TS", "score": 70 } ] } }, { "respondentId": "RESP497771", "status": "PROCESSING" }, { "respondentId": "RESP497772", "status": "PROCESSING" }, { "respondentId": "RESP497773", "status": "COMPLETED", "respondentQuality": { "isExcluded": false, "reasonsForExclusion": [], "redemScore": -999, "dataPointsSummary": [ { "qualityCheck": "OES", "dataPointId": "Q1", "score": -999, "category": "N/A" }, { "qualityCheck": "TS", "dataPointId": "durationQ1", "score": -999 }, { "qualityCheck": "GQS", "dataPointId": "Q2", "score": -999 }, { "qualityCheck": "OES", "dataPointId": "Q3", "score": -999, "category": "N/A" }, { "qualityCheck": "TS", "dataPointId": "durationQ3", "score": -999 }, { "qualityCheck": "CHS", "dataPointId": "CHS_Question", "score": -999, "reason": "N/A" }, { "qualityCheck": "GQS", "dataPointId": "Q4", "score": -999 }, { "qualityCheck": "TS", "dataPointId": "totalDuration", "score": -999 } ], "qualityScoreSummary": [ { "qualityCheck": "OES", "score": -999 }, { "qualityCheck": "CHS", "score": -999, "reason": "N/A" }, { "qualityCheck": "GQS", "score": -999 }, { "qualityCheck": "TS", "score": -999 } ] } } ] } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ 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" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } } } } } } } } }, "/v2/stopSurvey": { "post": { "tags": [ "Survey" ], "summary": "Stop a survey", "operationId": "stopSurveyV3", "description": "API endpoint for stopping a survey. This can be triggered once the survey is completed.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StopSurveyRequest" }, "example": { "surveyName": "Global Vacation Insights 2024" } } } }, "responses": { "200": { "description": "Upon successful processing, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "surveyName": { "type": "string", "description": "A variable that **indicates the survey name**." }, "status": { "type": "string", "description": "A variable that **indicates the status of the survey**. \n\n **⭕ Note:** ReDem surveys have two possible statuses: `RUNNING` and `STOPPED`. The survey status will be updated to `STOPPED` once the survey is stopped." } } } } }, "example": { "success": true, "message": "Survey successfully stopped", "results": { "surveyId": "68e4f174adc679a59fe16324", "surveyName": "Global Vacation Insights 2024", "status": "STOPPED" } } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ 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" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } } } } } } } } }, "/v2/restartSurvey": { "post": { "tags": [ "Survey" ], "summary": "Restart a survey", "operationId": "restartSurveyV2", "description": "API endpoint for restarting a survey. This can be triggered to resume a previously stopped survey.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RestartSurveyRequest" }, "example": { "surveyName": "Global Vacation Insights 2024" } } } }, "responses": { "200": { "description": "Upon successful processing, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "surveyId": { "type": "string", "description": "A variable that **indicates the unique survey identifier**." }, "surveyName": { "type": "string", "description": "A variable that **indicates the survey name**." }, "status": { "type": "string", "description": "A variable that **indicates the status of the survey**. \n\n **⭕ Note:** ReDem surveys have two possible statuses: `RUNNING` and `STOPPED`. The survey status will be updated to `RUNNING` once the survey is restarted." }, "previousStatus": { "type": "string", "description": "A variable that **indicates the previous status of the survey** before the restart." } } } } }, "example": { "success": true, "message": "Survey successfully restarted", "results": { "surveyId": "68e4f174adc679a59fe16324", "surveyName": "Global Vacation Insights 2024", "status": "RUNNING", "previousStatus": "STOPPED" } } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ 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" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } } } } } } } } }, "/v2/deleteRespondents": { "post": { "tags": [ "Respondent" ], "summary": "Delete respondents", "operationId": "deleteRespondentsV2", "description": "Delete one or more respondents from a survey and remove all related data. If no respondents remain for the survey, the survey is deleted automatically.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Request body for deleting respondents \n\n **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type", "properties": { "surveyName": { "type": "string", "description": "The survey name." }, "respondentIds": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Array of respondent IDs to delete." } }, "required": [ "surveyName", "respondentIds" ] }, "example": { "surveyName": "Customer-Satisfaction-2025", "respondentIds": [ "R123", "R124" ] } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable indicating whether the **operation was successful**." }, "message": { "type": "string", "description": "A variable that **human-readable message** providing additional context or confirmation of the requested action." }, "results": { "type": "object", "description": "This object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "deleted": { "type": "object", "properties": { "respondent": { "type": "number" } } } } } } }, "example": { "success": true, "message": "Respondents deleted successfully", "results": { "deleted": { "respondent": 2 } } } } } }, "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": { "type": "object" }, "examples": { "Validation Error": { "value": { "success": false, "message": "Validation Error", "errors": { "0": "\"surveyName\" is required" } } } } } } } } } }, "/v2/deleteSurveys": { "post": { "tags": [ "Survey" ], "summary": "Delete surveys", "operationId": "deleteSurveysV2", "description": "Delete one or more surveys and all associated data that you own.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Request body for deleting surveys \n\n **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type", "properties": { "surveyNames": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Array of survey names to delete." } }, "required": [ "surveyNames" ] }, "example": { "surveyNames": [ "Customer-Satisfaction-2025", "NPS-Q3-2025" ] } } } }, "responses": { "200": { "description": "Successful deletion response.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable indicating whether the **operation was successful**." }, "message": { "type": "string", "description": "A variable that **human-readable message** providing additional context or confirmation of the requested action." }, "results": { "type": "object", "description": "This object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "x-additionalPropertiesName": "Survey Name", "properties": { "{Survey Name}": { "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable indicating whether the **operation was successful**." }, "deleted": { "type": "object", "description": "This object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "respondents": { "type": "number" } } } } } } } } }, "example": { "success": true, "message": "Surveys deleted successfully", "results": { "Customer-Satisfaction-2025": { "success": true, "deleted": { "respondents": 120 } }, "NPS-Q3-2025": { "success": false, "message": "Survey not found or not owned by user" } } } } } }, "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": { "type": "object" }, "examples": { "Validation Error": { "value": { "success": false, "message": "Validation Error", "errors": { "0": "\"surveyNames\" is required" } } } } } } } } } }, "/v2/creditCalculation": { "post": { "tags": [ "Respondent" ], "summary": "Calculate the maximum number of credits needed for a respondent", "operationId": "creditCalculationV3", "description": "API endpoint for calculating the required number of credits for a respondent.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditCalculationRequest" }, "example": { "OESDataPoints": 2, "GQSDataPoints": 7, "TSDataPoints": 2, "CHSAnswers": 25, "BASDataPoints": 2 } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "creditCalculation": { "description": "This variable **represents the detailed breakdown of the number of credits** calculated for a respondent.", "type": "object", "properties": { "totalCredits": { "type": "number", "description": "This variable **represents the total number of credits** calculated for a respondent." }, "calculationBreakdown": { "description": "This variable **represents the detailed breakdown of the number of credits** calculated for a respondent.", "$ref": "#/components/schemas/CalculationBreakdown" } } } } } } }, "example": { "success": true, "message": "Credit calculation successfully retrieved", "results": { "creditCalculation": { "totalCredits": 12, "calculationBreakdown": { "OES": { "credits": 4, "dataPoints": 2 }, "GQS": { "credits": 1.4, "dataPoints": 7 }, "TS": { "credits": 1, "dataPoints": 2 }, "CHS": { "credits": 4, "answers": 25 }, "BAS": { "credits": 4, "dataPoints": 2 } } } } } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Failed to calculate credits", "description": "This error occurs when the **system fails to calculate the credits**. \n\n **⭕ 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": "\"OESDataPoints\" is required", "1": "\"value\" must contain at least one of [GQSAnswers, GQSDataPoints]", "2": "\"TSDataPoints\" is required", "3": "\"CHSAnswers\" is required", "4": "\"BASDataPoints\" is required" } } }, "Failed to calculate credits": { "value": { "success": false, "message": "Failed to calculate credits", "errors": {} } } } } } } } } }, "/v2/updateRespondentsExcludedStatus": { "post": { "tags": [ "Respondent" ], "summary": "Update respondents excluded status", "operationId": "updateRespondentsExcludedStatus", "description": "Updates the exclusion status of respondents within a specific survey.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Request body for updating respondents excluded status \n\n **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type", "properties": { "surveyName": { "type": "string", "description": "The survey name." }, "respondentIds": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Array of respondent IDs to update the excluded status." } }, "required": [ "surveyName", "respondentIds" ] }, "example": { "surveyName": "Customer-Satisfaction-2025", "respondentIds": [ "R123", "R124" ] } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable indicating whether the **operation was successful**." }, "message": { "type": "string", "description": "A variable that **human-readable message** providing additional context or confirmation of the requested action." }, "results": { "type": "object", "description": "This object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "surveyName": { "type": "string", "description": "This is the name of the survey that the respondents belong to." }, "respondentIds": { "type": "array", "items": { "type": "string" }, "description": "Array of respondent IDs that were successfully updated." } } } } }, "example": { "success": true, "message": "Respondents excluded status updated successfully", "results": { "surveyName": "Customer-Satisfaction-2025", "respondentIds": [ "R123", "R124" ] } } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Respondent not found", "description": "This error occurs when the **requested respondentId does not exist under the specified survey**. It may happen if the respondent has not been added to the specified survey or if an incorrect ID was provided. \n\n **⭕ 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" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } }, "Respondents not found": { "value": { "success": false, "message": "The following respondents were not found in the survey 'Customer-Satisfaction-2025': 'R987', 'R986'", "errors": {} } } } } } } } } }, "/v3/updateRespondentsExcludedStatus": { "post": { "tags": [ "Respondent" ], "summary": "Update respondents excluded status", "operationId": "updateRespondentsExcludedStatusV3", "description": "Updates the exclusion status of respondents within a specific survey.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Request body for updating respondents excluded status \n\n **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type", "properties": { "surveyName": { "type": "string", "description": "The survey name." }, "respondentIds": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Array of respondent IDs to update the excluded status." } }, "required": [ "surveyName", "respondentIds" ] }, "example": { "surveyName": "Customer-Satisfaction-2025", "respondentIds": [ "R123", "R124" ] } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable indicating whether the **operation was successful**." }, "message": { "type": "string", "description": "A variable that **human-readable message** providing additional context or confirmation of the requested action." }, "results": { "type": "object", "description": "This object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "surveyName": { "type": "string", "description": "This is the name of the survey that the respondents belong to." }, "respondentIds": { "type": "array", "items": { "type": "string" }, "description": "Array of respondent IDs that were successfully updated." } } } } }, "example": { "success": true, "message": "Respondents excluded status updated successfully", "results": { "surveyName": "Customer-Satisfaction-2025", "respondentIds": [ "R123", "R124" ] } } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Survey not found", "description": "This error occurs when the **requested survey does not exist in the system**. It may happen if the survey name is incorrect, has been deleted, or was never created. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Respondent not found", "description": "This error occurs when the **requested respondentId does not exist under the specified survey**. It may happen if the respondent has not been added to the specified survey or if an incorrect ID was provided. \n\n **⭕ 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" } } }, "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } }, "Respondents not found": { "value": { "success": false, "message": "The following respondents were not found in the survey 'Customer-Satisfaction-2025': 'R987', 'R986'", "errors": {} } } } } } } } } }, "/v3/addRespondent": { "post": { "tags": [ "Respondent" ], "summary": "Add a new respondent", "description": "API endpoint for adding a new respondent with quality check data (v3 with OES v3 categories)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddRespondentRequest_v3" }, "example": { "respondentId": "RESP497770", "surveyName": "Global Vacation Insights 2024", "surveyPlatform": "SightX", "referenceSurveyId": "SV_ext_7f2a1c9e", "dataPoints": [ { "qualityCheck": "OES", "dataPointId": "Q1", "question": "Where did you spend your last vacation?", "answer": "Wir waren am Gardasee in Italien", "keywords": [ "Beach", "Mountains", "Lake", "Museums", "Europe", "Asia", "Destination" ], "activateDuplicateDetection": true, "allowedLanguages": [ "en", "de", "it" ], "shouldTranslate": true, "skipTranslationLanguages": [ "de" ] }, { "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" } ] }, { "qualityCheck": "DES", "dataPointId": "DES", "entranceTime": "2026-07-28T12:00:00.000Z", "ip": "203.0.113.10", "demographics": [ { "type": "age", "answer": "34" }, { "type": "gender", "answer": "female" }, { "type": "country", "answer": "AT" }, { "type": "city", "answer": "Vienna" } ] } ], "activateCleaning": true, "cleaningSettings": { "redemScore": 60, "OES": { "activate": true, "score": 40, "minDataPoints": 2, "categories": { "AI_SUSPECT": { "activate": true, "minDataPoints": 2 }, "BAD_LANGUAGE": { "activate": true, "minDataPoints": 2 }, "OFF_TOPIC": { "activate": true, "minDataPoints": 2 }, "NO_ANSWER": { "activate": false, "minDataPoints": 2 }, "WRONG_LANGUAGE": { "activate": true, "minDataPoints": 2 }, "GIBBERISH": { "activate": true, "minDataPoints": 2 }, "DUPLICATE_ANSWER": { "activate": false, "minDataPoints": 1 }, "DUPLICATE_RESPONDENT": { "activate": false, "minDataPoints": 1 } } }, "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 } } }, "DES": { "activate": true, "score": 40, "categories": { "DUPLICATE_IP": { "activate": false, "minDataPoints": 1 }, "DUPLICATE_ENTRANT": { "activate": false, "minDataPoints": 1 } } } }, "synchronousResponse": true, "respondentAttributes": { "panel": "Panel Name", "country": "United States" }, "retentionDays": 30 } } } }, "responses": { "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 } } } }, "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** \n\nThis response mode is triggered when `synchronousResponse` is set to `true`. \n\n 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_v3", "description": "This variable includes **all quality parameters associated with a respondent** (v3, including `effort` for applicable OES categories). \n\n **💡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. \n\n **⭕ 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** \n\nThis response mode is triggered when `synchronousResponse` is set to `false`. \n\n 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/v3/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" ], "exclusionCategories": { "OES": [ "GIBBERISH" ], "DES": [ "DUPLICATE_IP" ] }, "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", "effort": "HIGH" }, { "qualityCheck": "TS", "dataPointId": "durationQ1", "score": 95 }, { "qualityCheck": "GQS", "dataPointId": "Q2", "score": 90 }, { "qualityCheck": "OES", "dataPointId": "Q3", "score": 75, "category": "AI_SUSPECT" }, { "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" } ] } } } }, "Asynchronous 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. \n\n **⭕ 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. \n\n **⭕ 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. \n\n **⭕ 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. \n\n **⭕ 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. \n\n **⭕ 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": {} } } } } } } } } }, "/v3/getRespondent": { "post": { "tags": [ "Respondent" ], "summary": "Get respondent results", "description": "Retrieve the quality check results and status for a specific respondent.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetRespondentRequest" } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API responds with a `200 OK` status code and the expected data. The structure of the response varies based on the respondent's status.", "content": { "application/json": { "schema": { "oneOf": [ { "title": "Respondent Completed", "description": "This response mode is available when the respondent status is `COMPLETED`. In this case, the system returns the full quality assessment of the respondent.", "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 respondents who have been successfully evaluated, this value will always be `COMPLETED`." }, "respondentQuality": { "description": "This variable **represents respondent data that has been evaluated based on the quality checks specified in the /addRespondent request**. \n\n 💡Important: Even if a respondent fails evaluation, the response will still be returned with results and an error code of -999 instead of valid scores. \n\n **⭕ 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.", "$ref": "#/components/schemas/RespondentResults_v3" } } } } }, { "title": "Respondent Processing", "description": "This response mode is available when the respondent status is `QUEUED`. In this case, the system returns only the respondent status, without the quality assessment.", "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable that **indicates whether the operation was successful or not**.", "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "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 respondents who are still being processed, this value will always be `QUEUED`." } } } } } ] }, "examples": { "Respondent Completed": { "summary": "Respondent Completed Example (v3, includes OES effort)", "value": { "success": true, "message": "Respondent quality successfully retrieved", "results": { "respondentId": "RESP497770", "status": "COMPLETED", "respondentQuality": { "isExcluded": true, "reasonsForExclusion": [ "Open Ended Score Threshold", "Coherence Score Threshold" ], "exclusionCategories": { "OES": [ "GIBBERISH" ], "DES": [ "DUPLICATE_IP" ] }, "redemScore": 85, "qualityScoreSummary": [ { "qualityCheck": "OES", "score": 80 }, { "qualityCheck": "CHS", "score": 75, "reason": "The user shows several inconsistencies and contradictions, such as different ..." }, { "qualityCheck": "GQS", "score": 85 }, { "qualityCheck": "TS", "score": 70 }, { "qualityCheck": "BAS", "score": 75 } ], "dataPointsSummary": [ { "qualityCheck": "OES", "dataPointId": "Q1", "score": 85, "category": "VALID_ANSWER", "effort": "HIGH" }, { "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" } ] } } } }, "Respondent Processing": { "summary": "Respondent Processing Example", "value": { "success": true, "message": "Respondent quality successfully retrieved", "results": { "respondentId": "RESP497770", "status": "QUEUED" } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "404": { "$ref": "#/components/responses/RespondentNotFoundError" } } } }, "/v3/getAllRespondents": { "post": { "tags": [ "Respondent" ], "summary": "Get all respondents", "description": "Retrieve all respondents for a survey.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetAllRespondentsRequest" } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API responds with a `200 OK` status code and the expected data.", "content": { "application/json": { "schema": { "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": "array", "description": "This variable includes **all quality parameters associated with a respondent**.", "items": { "type": "object", "properties": { "respondentId": { "type": "string", "description": "**The unique identifier for a respondent**, making it easy to distinguish them from others in the survey.", "example": "RESP497770" }, "status": { "type": "string", "description": "A variable that **indicates the current state of the respondent**. \n\n **💡Important:** Even if a respondent fails evaluation, the response status will still be `COMPLETED`. \n\n **⭕ 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.", "enum": [ "COMPLETED", "QUEUED" ] }, "respondentQuality": { "description": "This variable **represents respondent data that has been evaluated according to the quality checks specified in the /addRespondent request**. \n\n **⭕ Note:** this variable will only be available if the respondent status is `COMPLETED`.", "$ref": "#/components/schemas/RespondentResults_v3" } } } } } }, "example": { "success": true, "message": "Respondents quality retrieved successfully", "results": [ { "respondentId": "RESP497770", "status": "COMPLETED", "respondentQuality": { "isExcluded": false, "reasonsForExclusion": [ "Open Ended Score Threshold", "Coherence Score Threshold" ], "redemScore": 85, "dataPointsSummary": [ { "qualityCheck": "OES", "dataPointId": "Q1", "score": 85, "category": "VALID_ANSWER", "effort": "HIGH" }, { "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 } ], "qualityScoreSummary": [ { "qualityCheck": "OES", "score": 80 }, { "qualityCheck": "CHS", "score": 75, "reason": "The user shows several inconsistencies and contradictions, such as different ..." }, { "qualityCheck": "GQS", "score": 85 }, { "qualityCheck": "TS", "score": 70 } ] } }, { "respondentId": "RESP497771", "status": "PROCESSING" }, { "respondentId": "RESP497772", "status": "PROCESSING" }, { "respondentId": "RESP497773", "status": "COMPLETED", "respondentQuality": { "isExcluded": false, "reasonsForExclusion": [], "redemScore": -999, "dataPointsSummary": [ { "qualityCheck": "OES", "dataPointId": "Q1", "score": -999, "category": "N/A" }, { "qualityCheck": "TS", "dataPointId": "durationQ1", "score": -999 }, { "qualityCheck": "GQS", "dataPointId": "Q2", "score": -999 }, { "qualityCheck": "OES", "dataPointId": "Q3", "score": -999, "category": "N/A" }, { "qualityCheck": "TS", "dataPointId": "durationQ3", "score": -999 }, { "qualityCheck": "CHS", "dataPointId": "CHS_Question", "score": -999, "reason": "N/A" }, { "qualityCheck": "GQS", "dataPointId": "Q4", "score": -999 }, { "qualityCheck": "TS", "dataPointId": "totalDuration", "score": -999 } ], "qualityScoreSummary": [ { "qualityCheck": "OES", "score": -999 }, { "qualityCheck": "CHS", "score": -999, "reason": "N/A" }, { "qualityCheck": "GQS", "score": -999 }, { "qualityCheck": "TS", "score": -999 } ] } } ] } } } }, "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": { "type": "object" }, "examples": { "Validation Error": { "value": { "success": false, "message": "Validation Error", "errors": { "0": "\"surveyName\" is required" } } } } } } } } } }, "/v3/stopSurvey": { "post": { "tags": [ "Survey" ], "summary": "Stop a survey", "operationId": "stopSurvey", "description": "Stop a survey to prevent further respondent additions.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StopSurveyRequest" }, "example": { "surveyName": "Global Vacation Insights 2024" } } } }, "responses": { "200": { "description": "Upon successful processing, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "surveyName": { "type": "string", "description": "A variable that **indicates the survey name**." }, "status": { "type": "string", "description": "A variable that **indicates the status of the survey**. \n\n **⭕ Note:** ReDem surveys have two possible statuses: `RUNNING` and `STOPPED`. The survey status will be updated to `STOPPED` once the survey is stopped." } } } } }, "example": { "success": true, "message": "Survey successfully stopped", "results": { "surveyId": "68e4f174adc679a59fe16324", "surveyName": "Global Vacation Insights 2024", "status": "STOPPED" } } } } }, "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": { "type": "object" }, "examples": { "Validation Error": { "value": { "success": false, "message": "Validation Error", "errors": { "0": "\"surveyName\" is required" } } } } } } } } } }, "/v3/restartSurvey": { "post": { "tags": [ "Survey" ], "summary": "Restart a survey", "operationId": "restartSurvey", "description": "Restart a previously stopped survey to allow new respondent additions.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RestartSurveyRequest" }, "example": { "surveyName": "Global Vacation Insights 2024" } } } }, "responses": { "200": { "description": "Upon successful processing, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "surveyId": { "type": "string", "description": "A variable that **indicates the unique survey identifier**." }, "surveyName": { "type": "string", "description": "A variable that **indicates the survey name**." }, "status": { "type": "string", "description": "A variable that **indicates the status of the survey**. \n\n **⭕ Note:** ReDem surveys have two possible statuses: `RUNNING` and `STOPPED`. The survey status will be updated to `RUNNING` once the survey is restarted." }, "previousStatus": { "type": "string", "description": "A variable that **indicates the previous status of the survey** before the restart." } } } } }, "example": { "success": true, "message": "Survey successfully restarted", "results": { "surveyId": "68e4f174adc679a59fe16324", "surveyName": "Global Vacation Insights 2024", "status": "RUNNING", "previousStatus": "STOPPED" } } } } }, "400": { "$ref": "#/components/responses/ValidationError" } } } }, "/v3/deleteRespondents": { "post": { "tags": [ "Respondent" ], "summary": "Delete respondents", "operationId": "deleteRespondentsV3", "description": "Delete one or more respondents from a survey and clean up related data.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Request body for deleting respondents \n\n **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type", "properties": { "surveyName": { "type": "string", "description": "The name of the survey." }, "respondentIds": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Array of respondent IDs to delete." } }, "required": [ "surveyName", "respondentIds" ] } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable indicating whether the **operation was successful**." }, "message": { "type": "string", "description": "A variable that **human-readable message** providing additional context or confirmation of the requested action." }, "results": { "type": "object", "description": "This object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "deleted": { "type": "object", "properties": { "respondent": { "type": "number" } } } } } } }, "example": { "success": true, "message": "Respondents deleted successfully", "results": { "deleted": { "respondent": 2 } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" } } } }, "/v3/deleteSurveys": { "post": { "tags": [ "Survey" ], "summary": "Delete surveys", "operationId": "deleteSurveysV3", "description": "Delete one or more surveys and all associated data that you own.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Request body for deleting surveys \n\n **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type", "properties": { "surveyNames": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Array of survey names to delete." } }, "required": [ "surveyNames" ] } } } }, "responses": { "200": { "description": "Successful deletion response.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable indicating whether the **operation was successful**." }, "message": { "type": "string", "description": "A variable that **human-readable message** providing additional context or confirmation of the requested action." }, "results": { "type": "object", "description": "This object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "x-additionalPropertiesName": "Survey Name", "properties": { "{Survey Name}": { "type": "object", "properties": { "success": { "type": "boolean", "description": "A variable indicating whether the **operation was successful**." }, "deleted": { "type": "object", "description": "This object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "respondents": { "type": "number" } } } } } } } } }, "example": { "success": true, "message": "Surveys deleted successfully", "results": { "Customer-Satisfaction-2025": { "success": true, "deleted": { "respondents": 120 } }, "NPS-Q3-2025": { "success": false, "message": "Survey not found or not owned by user" } } } } } }, "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": { "type": "object" }, "examples": { "Validation Error": { "value": { "success": false, "message": "Validation Error", "errors": { "0": "\"surveyNames\" is required" } } } } } } } } } }, "/v3/creditCalculation": { "post": { "tags": [ "Respondent" ], "summary": "Calculate the maximum number of credits needed for a respondent", "operationId": "creditCalculation", "description": "API endpoint for calculating the required number of credits for a respondent.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditCalculationRequest" }, "example": { "OESDataPoints": 2, "GQSDataPoints": 7, "TSDataPoints": 2, "CHSAnswers": 25, "BASDataPoints": 2 } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API returns a 200 OK status code along with the expected data.", "content": { "application/json": { "schema": { "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 object serves as a **container to hold the results for the requested data**, encapsulating all relevant information and outputs in a structured format.", "properties": { "creditCalculation": { "$ref": "#/components/schemas/CalculationBreakdown" } } } } }, "example": { "success": true, "message": "Credit calculation successfully retrieved", "results": { "creditCalculation": { "totalCredits": 12, "calculationBreakdown": { "OES": { "credits": 4, "dataPoints": 2 }, "GQS": { "credits": 1.4, "dataPoints": 7 }, "TS": { "credits": 1, "dataPoints": 2 }, "CHS": { "credits": 4, "answers": 25 }, "BAS": { "credits": 4, "dataPoints": 2 } } } } } } } }, "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" }, { "title": "Failed to calculate credits", "description": "This error occurs when the **system fails to calculate the credits**. \n\n **⭕ 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": "\"OESDataPoints\" is required", "1": "\"value\" must contain at least one of [GQSAnswers, GQSDataPoints]", "2": "\"TSDataPoints\" is required", "3": "\"CHSAnswers\" is required", "4": "\"BASDataPoints\" is required" } } }, "Failed to calculate credits": { "value": { "success": false, "message": "Failed to calculate credits", "errors": {} } } } } } } } } }, "/v3/recalculateRespondents": { "post": { "tags": [ "Respondent" ], "summary": "Recalculate Respondents", "operationId": "recalculateRespondentsV3", "description": "This endpoint allows you to recalculate specific quality checks for a list of respondents within a given survey. It is useful for re-running checks with updated parameters or if they were skipped previously. Note that this operation requires the survey to be created with API version v3 and after the feature release date (2025-12-02).", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Request body for recalculating respondents \n\n **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type", "properties": { "surveyName": { "type": "string", "description": "The name of the survey." }, "respondentIds": { "type": "array", "items": { "type": "string" }, "minItems": 1, "maxItems": 100, "description": "Array of respondent IDs to recalculate (max 100)." }, "selectedChecks": { "type": "object", "properties": { "CHS": { "type": "boolean", "description": "Coherence Score. Set to true to recalculate. Omit or set to false to skip." }, "OES": { "type": "boolean", "description": "Open Ended Score. Set to true to recalculate. Omit or set to false to skip." }, "TS": { "type": "boolean", "description": "Time Score. Set to true to recalculate. Omit or set to false to skip." }, "GQS": { "type": "boolean", "description": "Grid Question Score. Set to true to recalculate. Omit or set to false to skip." }, "BAS": { "type": "boolean", "description": "Behavior Analysis Score. Set to true to recalculate. Omit or set to false to skip." } }, "description": "Object specifying which quality checks to recalculate. At least one check must be set to true. Omitted checks are treated as false." }, "oesAllowedLanguages": { "type": "array", "items": { "type": "string" }, "description": "Optional list of allowed languages for Open Ended Score check. This will only be processed if 'OES' is set to true in selectedChecks." }, "activateDuplicateDetection": { "type": "boolean", "default": false, "description": "Whether to activate duplicate detection during recalculation. This will only be processed if 'OES' is set to true in selectedChecks." }, "patternCheckEnabled": { "type": "boolean", "default": false, "description": "Whether to activate Grid Question Score pattern checking. This will only be processed if 'GQS' is set to true in selectedChecks." } }, "required": [ "surveyName", "respondentIds", "selectedChecks" ] }, "example": { "surveyName": "Customer-Satisfaction-2025", "respondentIds": [ "R123", "R124" ], "selectedChecks": { "CHS": true, "OES": true }, "oesAllowedLanguages": [ "en", "de" ], "activateDuplicateDetection": true } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API returns a 200 OK status code along with the result.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates whether the operation was successful." }, "message": { "type": "string", "description": "A human-readable message." }, "results": { "type": "object", "properties": { "surveyName": { "type": "string", "description": "The name of the survey." }, "totalRespondents": { "type": "number", "description": "Total number of respondents processed." }, "estimatedCredits": { "type": "number", "description": "Estimated credits required for the recalculation." } } } } }, "example": { "success": true, "message": "Recalculation queued", "results": { "surveyName": "Customer-Satisfaction-2025", "totalRespondents": 2, "estimatedCredits": 10 } } } } }, "400": { "description": "When a request fails due to issues with the referenced resources (e.g., survey or respondent not found), the API returns a 400 Bad Request status code.", "content": { "application/json": { "schema": { "oneOf": [ { "title": "Survey not found", "description": "The requested survey does not exist.", "type": "object" }, { "title": "Respondent not found", "description": "No respondents found for provided IDs", "type": "object" }, { "title": "Some Respondents not found", "description": "Some respondents were not found in the survey for the provided IDs", "type": "object" } ] }, "examples": { "Survey not found": { "value": { "success": false, "message": "Survey not found", "errors": {} } }, "Respondent not found": { "value": { "success": false, "message": "No respondents found for provided IDs", "errors": {} } }, "Some Respondents not found": { "value": { "success": false, "message": "Some respondents not found: 'R123', 'R124'", "errors": {} } } } } } }, "422": { "description": "When a request fails due to validation errors, the API returns a 422 Unprocessable Entity status code.", "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. \n\n **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.", "type": "object" } ] }, "examples": { "Validation Failed": { "value": { "success": false, "message": "Validation Failed", "errors": { "0": "\"surveyName\" is required", "1": "\"respondentIds\" is required", "2": "\"respondentIds\" must contain at least 1 items", "3": "\"respondentIds\" must contain at most 100 items", "4": "\"selectedChecks\" is required", "5": "\"selectedChecks.CHS\" is required", "6": "\"selectedChecks.OES\" is required", "7": "\"selectedChecks.TS\" is required", "8": "\"selectedChecks.GQS\" is required", "9": "\"selectedChecks.BAS\" is required" } } } } } } } } } }, "/v3/changeCleaningSettings": { "post": { "tags": [ "Respondent" ], "summary": "Change cleaning settings", "operationId": "changeCleaningSettingsV3", "description": "Applies new cleaning settings to **all respondents** in a survey, or turns cleaning off for them. Scores are not recalculated and no credits are charged. Any saved AI explanation on an affected respondent is cleared.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Request body for changing cleaning settings.", "properties": { "surveyName": { "type": "string", "description": "The survey name." }, "activateCleaning": { "type": "boolean", "description": "`true` applies `cleaningSettings` and excludes respondents that fall below the thresholds. `false` turns cleaning off for all respondents and clears their exclusions." }, "cleaningSettings": { "type": "object", "description": "Cleaning thresholds stored on every respondent in the survey. Unknown keys are rejected.", "properties": { "redemScore": { "type": "number", "description": "Minimum ReDem Score (0-100). Respondents below this are excluded." }, "OES": { "type": "object", "description": "Open-Ended Score rules. Use `categories` with OES category names to exclude specific answer types.", "properties": { "activate": { "type": "boolean", "description": "Whether this check contributes to exclusion." }, "score": { "type": "number", "description": "Minimum score (0-100). Respondents below this are excluded." }, "minDataPoints": { "type": "number", "description": "Minimum number of data points needed before the check is applied." }, "categories": { "type": "object", "description": "Category-level exclusion rules.", "additionalProperties": { "type": "object", "properties": { "activate": { "type": "boolean", "description": "Whether this category excludes the respondent." }, "minDataPoints": { "type": "number", "description": "Minimum number of flagged data points before the category excludes the respondent." } }, "required": [ "activate", "minDataPoints" ], "additionalProperties": false } } }, "required": [ "activate", "score" ], "additionalProperties": false }, "BAS": { "type": "object", "description": "Behavioral Analytics Score rules. Categories: `UNNATURAL_TYPING`, `UNNATURAL_MOVEMENT`, `COPY_AND_PASTE`.", "properties": { "activate": { "type": "boolean", "description": "Whether this check contributes to exclusion." }, "score": { "type": "number", "description": "Minimum score (0-100). Respondents below this are excluded." }, "minDataPoints": { "type": "number", "description": "Minimum number of data points needed before the check is applied." }, "categories": { "type": "object", "description": "Category-level exclusion rules.", "additionalProperties": { "type": "object", "properties": { "activate": { "type": "boolean", "description": "Whether this category excludes the respondent." }, "minDataPoints": { "type": "number", "description": "Minimum number of flagged data points before the category excludes the respondent." } }, "required": [ "activate", "minDataPoints" ], "additionalProperties": false } } }, "required": [ "activate", "score" ], "additionalProperties": false }, "DES": { "type": "object", "description": "Duplicate Entrance Score rules. Categories: `DUPLICATE_IP`, `DUPLICATE_ENTRANT`.", "properties": { "activate": { "type": "boolean", "description": "Whether this check contributes to exclusion." }, "score": { "type": "number", "description": "Minimum score (0-100). Respondents below this are excluded." }, "categories": { "type": "object", "description": "Category-level exclusion rules.", "additionalProperties": { "type": "object", "properties": { "activate": { "type": "boolean", "description": "Whether this category excludes the respondent." }, "minDataPoints": { "type": "number", "description": "Minimum number of flagged data points before the category excludes the respondent." } }, "required": [ "activate", "minDataPoints" ], "additionalProperties": false } } }, "required": [ "activate", "score" ], "additionalProperties": false }, "TS": { "type": "object", "description": "Time Score rules.", "properties": { "activate": { "type": "boolean", "description": "Whether this check contributes to exclusion." }, "score": { "type": "number", "description": "Minimum score (0-100). Respondents below this are excluded." } }, "required": [ "activate", "score" ], "additionalProperties": false }, "GQS": { "type": "object", "description": "Grid-Question Score rules.", "properties": { "activate": { "type": "boolean", "description": "Whether this check contributes to exclusion." }, "score": { "type": "number", "description": "Minimum score (0-100). Respondents below this are excluded." }, "minDataPoints": { "type": "number", "description": "Minimum number of data points needed before the check is applied." } }, "required": [ "activate", "score" ], "additionalProperties": false }, "CHS": { "type": "object", "description": "Coherence Score rules.", "properties": { "activate": { "type": "boolean", "description": "Whether this check contributes to exclusion." }, "score": { "type": "number", "description": "Minimum score (0-100). Respondents below this are excluded." } }, "required": [ "activate", "score" ], "additionalProperties": false } }, "required": [ "redemScore" ], "additionalProperties": false } }, "required": [ "surveyName", "activateCleaning", "cleaningSettings" ] }, "example": { "surveyName": "Customer-Satisfaction-2025", "activateCleaning": true, "cleaningSettings": { "redemScore": 60, "GQS": { "activate": true, "score": 20, "minDataPoints": 2 } } } } } }, "responses": { "200": { "description": "When a request is successfully processed, the API returns a 200 OK status code along with the result.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Whether the operation succeeded." }, "message": { "type": "string", "description": "Human-readable summary." }, "results": { "type": "object", "properties": { "updated": { "type": "number", "description": "Number of respondents updated." }, "surveyName": { "type": "string", "description": "The survey name." } } } } }, "example": { "success": true, "message": "Successfully updated 120 respondents", "results": { "updated": 120, "surveyName": "Customer-Satisfaction-2025" } } } } }, "400": { "description": "The survey was not found, or the API key has no access to it. Returns a 400 Bad Request status code." }, "422": { "description": "Validation failed, for example a missing `redemScore` or an unknown field. Returns a 422 Unprocessable Entity status code." } } } }, "/v3/qualityCheckSuggestions": { "post": { "tags": [ "Respondent" ], "summary": "Quality Check Suggestions", "operationId": "qualityCheckSuggestionsV3", "description": "Generate smart quality-check suggestions from a survey questionnaire structure. Partners can use this to help their users set up API projects in ReDem with recommendations that align with ReDem best practices — reducing manual configuration effort for OES, GQS, CHS, BAS, and DES.\n\nUse the returned question IDs, keywords, and cleaning settings when calling `POST /v3/addRespondent`.\n\nTS is not suggested by this endpoint. Pass `qualityChecks` to limit which checks are suggested.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QualityCheckSuggestionsRequest" }, "example": { "surveyPlatform": "SightX", "allInclusive": true, "surveyStructure": [ { "questionId": "Q1", "questionType": "OpenEnd", "question": "Why did you choose this product?" }, { "questionId": "Q2", "questionType": "Grid", "question": "Please rate the following brands.", "items": [ "Brand A", "Brand B", "Brand C", "Brand D", "Brand E" ], "answerOptions": [ "Very poor", "Poor", "Neutral", "Good", "Excellent" ], "isMultiSelect": false }, { "questionId": "Q3", "questionType": "Select", "question": "Which age group are you in?", "answerOptions": [ "18-24", "25-34", "35-44", "45-54", "55+" ], "isMultiSelect": false } ] } } } }, "responses": { "200": { "description": "Suggestions generated successfully.", "content": { "application/json": { "schema": { "type": "object", "required": [ "success", "message", "results" ], "properties": { "success": { "type": "boolean", "example": true }, "message": { "type": "string", "example": "Quality check suggestions generated" }, "results": { "$ref": "#/components/schemas/QualityCheckSuggestionsResults" } } }, "example": { "success": true, "message": "Quality check suggestions generated", "results": { "OES": [ { "questionId": "Q1", "keywords": [ "price", "quality", "brand" ], "enableDuplicateCheck": true } ], "GQS": [ { "questionId": "Q2", "enablePatternCheck": true } ], "CHS": { "questionIds": [ "Q3", "Q2" ], "surveyDescription": "A survey about brand preference and product choice among shoppers." }, "BAS": [ { "questionId": "Q1", "keystrokes": true, "mouse": false }, { "questionId": "Q2", "keystrokes": false, "mouse": true } ], "DES": [ { "type": "ageRange", "questionId": "Q3" } ], "cleaningSettings": { "redemScore": 60, "OES": { "activate": true, "score": 40, "minDataPoints": 2 }, "CHS": { "activate": true, "score": 30 }, "GQS": { "activate": true, "score": 20, "minDataPoints": 2 }, "TS": { "activate": true, "score": 30 }, "BAS": { "activate": true, "score": 20, "minDataPoints": 2 }, "DES": { "activate": true, "score": 40 } } } } } } }, "422": { "description": "When a request fails due to validation errors, the API returns a 422 Unprocessable Entity status code.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": false }, "message": { "type": "string", "example": "Validation Failed" }, "errors": { "type": "object", "additionalProperties": { "type": "string" } } } } } } } } } } } }