POST
/
api
/
v1
/
followups
const response = await api.followups.generate({
  surveyName: 'Customer Satisfaction',
  question: 'How likely are you to recommend our service?',
  answer: 'Very likely, the customer service is excellent',
  identifiers: {
    surveyIdentifier: 'CSAT-2024-Q1',
    questionIdentifier: 'NPS-1'
  }
});
{
  "followupQuestion": "What specific aspects of our customer service impressed you the most?",
  "responseEvaluation": {
    "completeness": 75,
    "relevance": 90
  },
  "threadId": "7a54b8da-f65d-4946-9c9a-f202e0cc29c8",
  "responseIdentifier": "12345"
}

Authorizations

X-Aftercare-Key
string
header
required

API key for authentication

Headers

X-Request-Encoding
enum<string>
default:unicode

Specifies the encoding format of the request data. Use html if you are sending data that HTML entity encodes non-ASCII characters.

Available options:
unicode,
html
X-Response-Encoding
enum<string>
default:unicode

Specifies the preferred encoding format for the response data. Use html if you are expecting to receive data that HTML entity encodes non-ASCII characters.

Available options:
unicode,
html

Body

application/json
question
string
required

The question that was asked to the respondent

Example:

"How likely are you to recommend our service?"

answer
string
required

The answer to the question provided by the respondent

Example:

"Very likely, the customer service is excellent"

surveyName
string

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

Example:

"Customer Satisfaction"

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.)

Example:

"Quarterly survey tracking customer satisfaction and loyalty for the XYZ Company"

questionContext
string

A description of what you are trying to learn from the respondent for this question.

This will be used to give the AI guidance on what followup questions to ask.

Example:

"I want to understand specifically why a customer is convinced to recommend our service. If they are not recommending our service, I want to know why."

identifiers
object

Optional identifiers to tie responses to a specific survey and question. If provided, Aftercare will use these to generate analytics over your survey responses.

If included, both survey and question identifiers are required.

See the Aftercare Data Model to learn more.

threadId
string

A unique identifier for the follow-up response thread.

If provided, Aftercare will follow-up questions and answers in a thread with the original question and answer.

If not provided, Aftercare will automatically generate a new thread id you can use in a subsequent follow-up.

Example:

"7a54b8da-f65d-4946-9c9a-f202e0cc29c8"

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.

Example:

"12345"

guidanceBehavior
enum<string>
default:Succinct

Different ways Aftercare AI will generate follow-up questions based on non-applicable user input.

  • Succinct - The AI will not generate a follow-up question if the response is irrelevant or complete. This is the default behavior. This occurs when the relevance score is below 25 or the completeness score is above 70.
  • Redirection - The AI will return a follow-up question that redirects the user to answering the top-level question if it is irrelevant and incomplete. This occurs when the completeness score is above 70.
  • Verbose - The AI will return a follow-up question regardless of the relevance or completeness of the response. This is the most verbose behavior.
Available options:
Succinct,
Redirection,
Verbose
responseLanguage
string

Optional language to use for the followup question generation.

If not provided, Aftercare will respond appropriately to the user's language.

Example:

"esperanto"

Response

200
application/json
Successfully generated followup question
followupQuestion
string
required

The generated followup question

Example:

"What specific aspects of our customer service impressed you the most?"

responseEvaluation
object
required
threadId
string

The unique identifier for the follow-up thread

Example:

"7a54b8da-f65d-4946-9c9a-f202e0cc29c8"

responseIdentifier
string

Optional identifier for the survey response

Example:

"12345"