Create a Q&A scenario
curl --request POST \ --url "$UNEEQ_API_URL/external/v1/organization/$UNEEQ_ORG_ID/immersive-training/qa" \ --header "Authorization: Bearer $UNEEQ_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "name": "Product knowledge check", "learning_domain_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "persona_config_id": "9b2e4c1a-6f3d-4e8b-a1c2-5d7f8e9a0b1c", "participant_instructions": "Answer each question out loud as you would to a customer.", "locales": "en-US", "is_published": true, "question_ordering": "RANDOM", "questions_per_session": 2, "answer_clear_mode": "ALLOWED", "questions": [ { "question": "What is the maximum loyalty discount on a multi-year renewal?", "answer_criteria": "States that the maximum is 5% and that it applies only to multi-year renewals.", "order_position": 0 }, { "question": "When does a price increase require a value review?", "answer_criteria": "States that increases above 10% require a value review.", "order_position": 1, "time_limit_seconds": 90 }, { "question": "Who approves exceptions to the renewal policy?", "answer_criteria": "Names the regional sales director as the approver.", "order_position": 2 } ]}'const url = `${process.env.UNEEQ_API_URL}/external/v1/organization/${process.env.UNEEQ_ORG_ID}/immersive-training/qa`;const response = await fetch(url, { method: 'POST', headers: { Authorization: `Bearer ${process.env.UNEEQ_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "Product knowledge check", "learning_domain_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "persona_config_id": "9b2e4c1a-6f3d-4e8b-a1c2-5d7f8e9a0b1c", "participant_instructions": "Answer each question out loud as you would to a customer.", "locales": "en-US", "is_published": true, "question_ordering": "RANDOM", "questions_per_session": 2, "answer_clear_mode": "ALLOWED", "questions": [ { "question": "What is the maximum loyalty discount on a multi-year renewal?", "answer_criteria": "States that the maximum is 5% and that it applies only to multi-year renewals.", "order_position": 0 }, { "question": "When does a price increase require a value review?", "answer_criteria": "States that increases above 10% require a value review.", "order_position": 1, "time_limit_seconds": 90 }, { "question": "Who approves exceptions to the renewal policy?", "answer_criteria": "Names the regional sales director as the approver.", "order_position": 2 } ] }),});console.log(response.status, await response.text());Creates a spoken Q&A scenario (scenario type TECHNICAL_ACUMEN): a digital human asks the questions from a question bank and each spoken answer is scored against its answer_criteria. There is no conversation, system prompt, character or assessment, and the request itself makes no AI model call (the background hint extraction described below does use one).
Question bank rules:
- 1 to 50 questions; question text at most 2000 bytes and answer criteria at most 5000 bytes of UTF-8 text, neither blank.
- Weights are all-or-none: either no question has a
weight(equal weighting) or every question has one from 1 to 100. question_orderingdefaults toSEQUENTIAL.questions_per_sessionis allowed only withRANDOMand cannot exceed the number of questions.answer_clear_modedefaults toALLOWED.
After the response, speech-recognition hints are derived from the questions in the background. The endpoint is not idempotent.
Send persona_config_id. It is optional in validation, but every scenario must reference a digital human, so a request without one currently fails with 500 (“unable to create immersive training”).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ID of the organization the API key belongs to, for example org_HYPCX67vaupjhdTn.
Example
org_HYPCX67vaupjhdTnRequest Bodyrequired
Section titled “Request Bodyrequired”A spoken Q&A scenario built from a question bank.
object
Scenario name.
Learning domain of the organization the scenario belongs to.
Digital human available to the organization that reads the questions aloud. Not rejected when omitted, but the create then fails with 500, so always send it.
Instructions shown to the learner before starting.
Deprecated and ignored. Every scenario offers every supported language. Still validated, so an unsupported locale is rejected with validation_failed; omit it.
Publish to learners immediately.
Score a learner must reach to be endorsed. Omit for no endorsement.
Session time limit in minutes. Omit for no limit.
Maximum attempts per learner. Omit for unlimited.
DISALLOWED hides the learner’s option to clear a spoken answer before it is scored.
Ids of the organization’s tags.
Ids of the organization’s teams to assign the scenario to.
SEQUENTIAL asks the questions in order; RANDOM draws them at random.
With RANDOM only. Number of questions drawn per session; at most the number of questions. Omit to ask all.
The question bank, 1 to 50 questions. Weights are all-or-none.
One question of a Q&A question bank.
object
The question the digital human asks. Must not be blank. The limit is counted in bytes of UTF-8 text, so accented and non-Latin characters use up more of it.
What a good answer must contain. Must not be blank. The limit is counted in bytes of UTF-8 text, so accented and non-Latin characters use up more of it.
Relative weight. Either every question has a weight or none does.
Position of the question in the bank.
Time allowed to answer, in seconds. Omit for no per-question limit.
Example
{ "name": "Product knowledge check", "learning_domain_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "persona_config_id": "9b2e4c1a-6f3d-4e8b-a1c2-5d7f8e9a0b1c", "participant_instructions": "Answer each question out loud as you would to a customer.", "locales": "en-US", "is_published": true, "question_ordering": "RANDOM", "questions_per_session": 2, "answer_clear_mode": "ALLOWED", "questions": [ { "question": "What is the maximum loyalty discount on a multi-year renewal?", "answer_criteria": "States that the maximum is 5% and that it applies only to multi-year renewals.", "order_position": 0 }, { "question": "When does a price increase require a value review?", "answer_criteria": "States that increases above 10% require a value review.", "order_position": 1, "time_limit_seconds": 90 }, { "question": "Who approves exceptions to the renewal policy?", "answer_criteria": "Names the regional sales director as the approver.", "order_position": 2 } ]}Responses
Section titled “Responses”The scenario was created.
A full immersive training scenario.
object
Scenario id.
Reserved; currently always an empty string.
Scenario name.
Deprecated and always an empty string. A scenario’s former objective now starts its context.
The situation the scenario was written from: the scenario_context for a generated scenario, or the context entered when the scenario was created in the app. A scenario that had a separate objective starts with Training objective: …. Empty when none was given.
The digital human a scenario uses. A short form of the record returned by the digital human list.
object
Digital human id.
Identifier of the digital human on the Uneeq platform.
URL of the digital human’s preview image.
Always false here. Read it from the digital human list.
Always an empty string here. Read it from the digital human list.
Always false here. Read it from the digital human list.
Per-digital-human override for emotion and action tag instructions. Present only when set.
Description of the character’s personality. Empty for Q&A scenarios and authored role plays.
Name of the character the digital human plays. Empty for Q&A scenarios.
Role or job title of the character. Empty for Q&A scenarios.
Where the character is based. Empty for Q&A scenarios.
Personality archetype chosen by the generator. Empty for Q&A scenarios and authored role plays.
The system prompt the digital human follows. Empty for Q&A scenarios.
Short AI-written summary of the system prompt. Empty when none could be generated, and for Q&A scenarios.
AI summary of the supporting documents, when one was made. Absent otherwise.
Description of the supporting documents, when set. Absent otherwise.
Configuration version; starts at 1 and increases with every update.
Learning domain the scenario belongs to.
Organization that owns the scenario.
Whether learners can see and start the scenario. Always true for PRACTICE.
Instructions shown to the learner before starting.
Legacy field; not currently returned.
Creation time.
Display name of the creator, or the creator’s user id when no name is known. For a practice scenario, the owning member.
Deletion time; not returned, since deleted scenarios are not readable.
Last update time. Absent when the scenario was never updated.
Display name of the last editor, or their user id when no name is known.
Deprecated. Every scenario offers every supported language, so this always lists all supported locales, colon-separated (for example en-US:fr-FR:...), whatever was stored or sent.
Deprecated; always false. Scheduled for removal after 2027-03-15.
Deprecated and always true: every scenario uses generated_prompt verbatim as the digital human’s instructions.
Score from 1 to 100 a learner must reach to be endorsed. Absent when the scenario has no endorsement.
Session time limit in minutes. Absent when there is no limit.
Maximum attempts per learner. Absent means unlimited.
Q&A only (always ALLOWED on other types). DISALLOWED hides the learner’s option to clear a spoken answer before it is scored.
Endorsement tier the scenario is configured for; STANDARD when it has an endorsement threshold, otherwise NONE.
Kind of scenario. ROLE_PLAY is a conversation with a digital human, TECHNICAL_ACUMEN is a spoken Q&A, PRACTICE is a member’s private role play.
Q&A only. SEQUENTIAL asks questions in order; RANDOM draws them at random. Absent on other types.
Q&A only. Number of questions drawn per session when ordering is RANDOM. Absent means all.
Tags on the scenario.
object
Tag ID.
Tag name.
Display color, for example a hex code such as #F7F9FB.
Assessments attached to the scenario in their per-scenario order, followed by the learning domain’s default assessments that are not attached (shown with is_active false). Empty for Q&A scenarios unless the domain has defaults.
An assessment as attached to a scenario.
object
Assessment id.
Assessment title. Absent when empty.
What the assessment measures. Absent when empty.
Scoring criteria. Absent when empty.
Whether the assessment is used to score this scenario.
Whether this is a default assessment of the learning domain.
For an assessment attached to the scenario, its 0-based position within the scenario. For an unattached default assessment of the learning domain, its display order in the organization’s assessment library.
Weight of the assessment in the overall score. Absent when the scenario uses equal weighting.
Supporting documents attached to the scenario.
A supporting document attached to a scenario.
object
Document id.
File name of the document.
Q&A only. The current question bank, in order. Absent on other types and when the bank is empty.
One question in a Q&A scenario’s question bank.
object
Question id. Changes when the question bank is replaced.
The question the digital human asks.
What a good answer must contain; the spoken answer is scored against it.
Relative weight of the question. Absent when the bank uses equal weighting.
Position of the question in the bank.
Label of a learning-resource link for the question, when set.
URL of a learning-resource link for the question, when set.
Time allowed to answer, in seconds. Absent means no per-question limit.
Example
{ "persona_config": { "gender": "" }, "answer_clear_mode": "ALLOWED", "endorsement_level": "NONE", "scenario_type": "ROLE_PLAY", "question_ordering": "SEQUENTIAL"}The request was rejected:
- Malformed JSON, a wrong field type, an unknown field (for example
system_prompt,personality_nameoruser_email), or an empty body (error_codeinvalid_request_body). - A field failed validation (for example no
questions, an unknownquestion_ordering) orlocalesnames an unsupported locale (error_codevalidation_failed). - The question bank breaks a rule above: more than 50 questions, overlong or blank text, mixed or out-of-range weights,
questions_per_sessionwithoutRANDOMor larger than the bank (noerror_code). More than 200 questions, or question or answer text over 50,000 characters, fails field validation instead (error_codevalidation_failed).
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}The Authorization header is missing, or the API key is not valid for this organization. A key check that fails on the server is also reported as 401.
The body of an error returned before the request reaches an endpoint (authentication and rate limiting).
object
Human-readable explanation of what went wrong.
Example generated
{ "error": "example"}One or more teams do not belong to the organization. No error_code is set.
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}- A tag id does not belong to the organization (
error_codevalidation_failed). - The learning domain or persona is not in the organization (no
error_code).
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}The request body is larger than 512 KiB (error_code invalid_request_body).
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}The API key has sent too many requests. Wait for the number of seconds in Retry-After, then retry.
The body of an error returned before the request reaches an endpoint (authentication and rate limiting).
object
Human-readable explanation of what went wrong.
Example generated
{ "error": "example"}Headers
Section titled “Headers”Seconds to wait before retrying.
The scenario could not be saved (“unable to create immersive training”), or a lookup it depends on failed, for example “unable to look up the organization’s tags”, “unable to get learning domain”, “unable to get persona config” or “unable to assign team to training scenario”. No error_code is set.
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}
