Discussions
trouble with implementing live avatar in custom mode
2 months ago by Christopher Sanitate
Hello LiveAvatar Support,
We are unable to create a LiveAvatar session because the token endpoint returns a 422 validation error related to the discriminator field mode.
Summary
- Endpoint: POST {LIVEAVATAR_API_BASE}/v1/sessions/token
- Result: HTTP 422
- Error message: “Request validation errors. body: Unable to extract tag using discriminator 'mode'”
- Because the token request fails, we cannot proceed to POST /v1/sessions/start and therefore never receive a
ws_url(our client normally writesws_urlto a local artifact file, which is missing as a consequence).
Expected behavior
- POST /v1/sessions/token returns a valid session token (and related session identifiers).
- POST /v1/sessions/start (Authorization: Bearer <session_token>) returns the connection details including
ws_urlfor CUSTOM mode. - We then connect to
ws_urlto continue the session.
Actual behavior
-
Step 1 fails consistently with 422, preventing session creation.
-
Error returned:
- code: 4000
- message: “Request validation errors. body: Unable to extract tag using discriminator 'mode'”
Time of occurrence
- 2026-01-26 22:19:57Z (from our run logs)
Environment
- OS: macOS
- Node.js: v22.20.0
- npm: 10.9.3
- Python (for tooling only): 3.12.4
- API Base: https://api.liveavatar.com
What we need from you
-
Please confirm the exact request schema for POST /v1/sessions/token in CUSTOM mode:
- Where
modemust appear (top-level vs nested) - Allowed values for
modeand whether they are case-sensitive - Any required fields that are conditionally required for CUSTOM mode
- Where
-
If there has been a recent schema change/regression: please confirm and share the updated expected payload.
Attachments (redacted)
- step12e_report.json (shows the 422 status and error message)
- step12e.stderr.log (full stderr for the run)
- token_request_body_redacted.json (exact payload we send, with secrets removed)
- token_request_headers_redacted.txt (headers minus secrets)
Thank you — if you need a minimal cURL reproduction, tell us the exact expected payload shape for CUSTOM mode and we will provide a one-command repro immediately.
Best regards,
Christopher