Update a role-play scenario
curl --request PUT \ --url "$UNEEQ_API_URL/external/v1/organization/$UNEEQ_ORG_ID/immersive-training/role-play/{immersiveTrainingID}" \ --header "Authorization: Bearer $UNEEQ_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "name": "Renewal price objection (advanced)", "time_limit_minutes": 20, "is_published": true}'const url = `${process.env.UNEEQ_API_URL}/external/v1/organization/${process.env.UNEEQ_ORG_ID}/immersive-training/role-play/{immersiveTrainingID}`;const response = await fetch(url, { method: 'PUT', headers: { Authorization: `Bearer ${process.env.UNEEQ_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "Renewal price objection (advanced)", "time_limit_minutes": 20, "is_published": true }),});console.log(response.status, await response.text());Edits a role-play (ROLE_PLAY) or private practice (PRACTICE) scenario in place. This is a partial update: send only the fields you want to change.
- An omitted field, or one sent as
null, keeps its stored value. - A text field sent as an empty string
""also keeps its stored value; text fields cannot be cleared through this endpoint. Two exceptions:learning_domain_idsent as""is rejected with 404, andsystem_promptsent as""keeps the stored prompt but still regeneratesprompt_summaryfrom the empty text. Omit fields you do not want to change. A value made only of spaces is not treated as empty and is stored as sent. endorsement_threshold,time_limit_minutesandmax_attemptsaccept0to clear the setting (no threshold, no time limit, unlimited attempts).tagsandteamsreplace the whole list when sent;[]removes all of them.assessmentsreplaces the set of attached library assessments when sent: attached assessments not in the list are detached. An empty list is rejected (omit the field instead).new_assessmentscreates assessments in the organization’s shared library and attaches them in addition.- Assessment weights are checked only across the active assessments sent in the request (
assessmentsplusnew_assessments); stored attachments are not counted. Weightednew_assessmentssent on their own must therefore sum to 100 by themselves. - Supporting documents are always kept.
A new system_prompt is stored verbatim and its prompt_summary is regenerated (one AI model call). If that call fails, a changed prompt is saved with an empty summary. Moving the scenario to another learning_domain_id detaches the previous domain’s default assessments; the prompt is not rewritten. Changing only persona_config_id also re-checks the scenario’s current learning domain, so it answers 404 if that domain has since been deleted.
For a PRACTICE scenario, tags, teams and endorsement_threshold cannot be set and is_published cannot be false.
Every successful update increments version. A Q&A scenario answers 404 here; use the Q&A endpoint.
A member’s private practice scenario can be edited here even though the get and delete endpoints answer 404 for it; the response body is then the only way to see its stored configuration.
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_HYPCX67vaupjhdTnId of a ROLE_PLAY or PRACTICE scenario.
Request Bodyrequired
Section titled “Request Bodyrequired”Partial update of a role-play or practice scenario. Omitted and null fields keep their stored value; so do empty-string fields, except as noted on learning_domain_id and system_prompt.
object
New scenario name.
Move the scenario to this learning domain of the organization. The previous domain’s default assessments are detached; the prompt is not rewritten. Omit it to keep the current domain; "" is rejected with 404.
Digital human available to the organization that plays the character.
New system prompt, stored verbatim; prompt_summary is regenerated. Omit it to keep the stored prompt; "" keeps the prompt but still regenerates prompt_summary, and a value of only spaces replaces the prompt.
New learner instructions.
New character name.
New character role.
New character location.
Deprecated and ignored. Every scenario offers every supported language. Still validated, so an unsupported locale is rejected with validation_failed; omit it.
Publish or unpublish. Cannot be false for PRACTICE.
New endorsement score from 1 to 100, or 0 to remove the endorsement. Not allowed for PRACTICE.
New time limit in minutes, or 0 to remove the limit.
New maximum attempts, or 0 for unlimited.
Replaces all tags; [] removes them. Not allowed (non-empty) for PRACTICE.
Replaces all team assignments; [] removes them. Not allowed (non-empty) for PRACTICE.
Replaces the set of attached library assessments; attached ones not listed are detached. Cannot be empty.
An existing assessment of the organization to attach to a scenario.
object
Assessment id.
Whether the assessment is used to score this scenario.
Weight in the overall score. If any active assessment has a weight, every active one must, and the weights must sum to exactly 100. The update endpoint enforces this across the active assessments sent in that request (stored attachments are not counted); the create endpoint currently does not.
Position of the assessment within this scenario, 0-based.
New assessments to create in the organization’s shared library and attach in addition.
An assessment to create in the organization’s shared library and attach to the scenario.
object
Assessment title.
What the assessment measures.
Scoring criteria.
Whether the assessment is used to score this scenario.
Weight in the overall score. If any active assessment has a weight, every active one must, and the weights must sum to exactly 100. The update endpoint enforces this across the active assessments sent in that request (stored attachments are not counted); the create endpoint currently does not.
Position of the assessment within this scenario, 0-based.
Label of a learning-resource link. Send together with resource_url, or neither.
Absolute http or https URL of a learning-resource link. Send together with resource_label, or neither.
Example
{ "name": "Renewal price objection (advanced)", "time_limit_minutes": 20, "is_published": true}Responses
Section titled “Responses”The updated scenario.
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:
immersiveTrainingIDis not a UUID (error_codevalidation_failed, message “invalid immersive training id”).- Malformed JSON, a wrong field type, an unknown field (for example
questionsorscenario_type), or an empty body (error_codeinvalid_request_body). - A field failed validation,
assessmentsis an empty list, orlocalesnames an unsupported locale (error_codevalidation_failed). - Assessment weights are invalid: among the active assessments sent in this request (stored attachments are not counted), when any has a weight, all must, each 0-100, summing to exactly 100 (no
error_code). - A new assessment’s resource link is half-filled (no
error_code). Aresource_urlthat is not an absolute http(s) URL, or an over-long label or URL, fails field validation (error_codevalidation_failed). - A
PRACTICEscenario would get tags, teams, an endorsement threshold or be unpublished (noerror_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 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"}- The scenario does not exist in the organization, was deleted, or is a Q&A scenario (“immersive training not found”).
- A tag id does not belong to the organization (
error_codevalidation_failed). - The new learning domain, persona or an attached assessment is not in the organization,
learning_domain_idis"", or the scenario’s current learning domain was deleted andpersona_config_idis being changed (noerror_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 loaded (“unable to get immersive training”) or saved (“unable to update 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"}
