Assignments place published scenarios prominently in a learner’s portal. They are persistent recommendations, not an access-control boundary.

Before you assign

You need:
  • A learner userId from GET /users.
  • A published scenario slug from GET /scenarios or the TrainerTwin dashboard.
Scenario and persona configuration remains dashboard-only.

Create an assignment

A new assignment returns 201:
practiceUrl is the learner’s direct practice link — send it through your own channel instead of (or alongside) the TrainerTwin email. Creating the same learner-scenario pair again is safe. TrainerTwin returns the existing assignment with created: false and does not send another email.
Assignment persistence succeeds even when email delivery fails. Check emailSent instead of retrying the assignment immediately.

Change an assignment

Move an assignment to another learner, scenario, or both:
A changed assignment sends a notification to the target learner and returns a new practiceUrl (the old link stops working). A no-op update returns changed: false, the existing practiceUrl, and sends no email.

Inspect an assignment

Returns the learner, scenario, current status (pending, used, expired, or cancelled), and practiceUrl.

Remove an assignment

Removing an assignment does not remove the scenario or historical practice sessions.