Discussions

Ask a Question
Back to all

trouble with implementing live avatar in custom mode

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 writes ws_url to a local artifact file, which is missing as a consequence).

Expected behavior

  1. POST /v1/sessions/token returns a valid session token (and related session identifiers).
  2. POST /v1/sessions/start (Authorization: Bearer <session_token>) returns the connection details including ws_url for CUSTOM mode.
  3. We then connect to ws_url to 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

What we need from you

  1. Please confirm the exact request schema for POST /v1/sessions/token in CUSTOM mode:

    • Where mode must appear (top-level vs nested)
    • Allowed values for mode and whether they are case-sensitive
    • Any required fields that are conditionally required for CUSTOM mode
  2. If there has been a recent schema change/regression: please confirm and share the updated expected payload.

Attachments (redacted)

  1. step12e_report.json (shows the 422 status and error message)
  2. step12e.stderr.log (full stderr for the run)
  3. token_request_body_redacted.json (exact payload we send, with secrets removed)
  4. 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