POST
/
api
/
v1
/
data-quality
const response = await api.quality.evaluate({
  surveyName: 'Customer Satisfaction',
  surveyEntries: [{
    question: 'How satisfied are you?',
    answer: 'I really love playing tennis with my friends on Fridays'
  }]
});
{
  "numIssues": 1,
  "qualityScore": 30,
  "evaluations": [
    {
      "surveyEntry": {
        "question": "How satisfied were you with our service?",
        "answer": "I really love playing tennis with my friends on Fridays"
      },
      "numIssues": 1,
      "qualityScore": 30,
      "qualityIssueChecks": [
        {
          "type": "Irrelevant",
          "score": 10,
          "isIssue": true
        },
        {
          "type": "Nonsensical",
          "score": 80,
          "isIssue": true
        },
        {
          "type": "Incomplete",
          "score": 60,
          "isIssue": false
        },
        {
          "type": "Low Effort",
          "score": 95,
          "isIssue": true
        },
        {
          "type": "LLM Generated",
          "score": 80,
          "isIssue": false
        },
        {
          "type": "Self Duplicated",
          "score": 30,
          "isIssue": false
        },
        {
          "type": "Shared Duplicate",
          "score": 30,
          "isIssue": false
        }
      ]
    }
  ],
  "aftercareResponseIdentifier": 12345
}

Authorizations

X-Aftercare-Key
string
header
required

API key for authentication

Body

application/json
surveyEntries
object[]
required

The collection of question-answer pairs to evaluate

A question and answer pair from a survey response

surveyName
string

The name of the survey as it will appear in the Aftercare platform

surveyDescription
string

A description of the survey purpose and background.

It will be used to give the AI more context around specific aspects of the survey (e.g. brand/product names, movie names, etc.)

surveyIdentifier
string

Optional unique identifier for the survey.

Aftercare will use this to build a data model to associate questions and answers with the survey.

responseIdentifier
string

Optional unique identifier for a respondent's entire response to a survey.

Aftercare will use this to build a data model tie together questions and answer pairs for a single response.

aftercareResponseIdentifier
number

Optional unique identifier for the survey response. If not provided, Aftercare will generate one.

This identifier is useful for tracking survey responses that are submitted in multiple parts or over time.

If both a responseIdentifier and aftercareResponseIdentifier are provided, Aftercare will use the aftercareResponseIdentifier.

qualityIssues
enum<string>[]

Optional array of specific quality issues to evaluate

Types of quality issues that can be detected in survey responses.

  • Nonsensical - Response lacks logical meaning or sense. Likely gibberish.
  • Irrelevant - Response does not address the question.
  • Low Effort - Respondent did not put in much effort to answer the question. Lacks detail or concrete examples.
  • LLM Generated - Response appears to be generated by AI.
  • Self Duplicated - Responses from the same respondent contain duplicated content across multiple answers. Only evaluated when multiple survey entries are provided or if a survey identifier and response identifier is provided.
  • Shared Duplicate - Responses contain duplicated content across different respondents for the same question. Only evaluated if survey identifiers and question identifiers are provided.
Available options:
Nonsensical,
Irrelevant,
Low Effort,
LLM Generated,
Repeated Answers,
Duplicate Answers

Response

200
application/json
Successfully evaluated survey quality
numIssues
integer
required

Number of quality issues detected across all survey entries

Required range: x >= 0
qualityScore
number
required

A score between 0 and 100 that represents the overall quality of the survey response.

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

The lower the score, the greater the likelihood and severity of data quality issues.

Required range: 0 <= x <= 100
evaluations
object[]
required
aftercareResponseIdentifier
number
required

Unique identifier for the survey response generated by Aftercare