Endpoint
token query parameter and is verified during the WebSocket handshake — before the connection is accepted.
Authentication
Authentication uses the same JWT you obtain from the MediSync login flow. See Authentication for how to get a token.string
required
A valid MediSync JWT that identifies a user and carries permission to transcribe. Tokens from the standard login flow qualify.
1
Token is valid
The JWT signature and expiry are verified. An invalid, malformed, or expired token is rejected.
2
Token identifies a user
The token must resolve to a user identity. A token with no user identity is rejected.
3
Permission
The token must carry permission to transcribe.
If any of these checks fails, the socket is closed with code
1008 during the handshake — before the connection is accepted. No session_ready and no JSON error frame are delivered in this case; the close code is the signal.Handshake sequence
1
Open the socket
Connect to the endpoint with the
token query parameter set.2
Send the config frame (first message)
Your first message must be a single JSON
config text frame. Send it as soon as the socket opens. The server waits about 10 seconds for it; if none arrives it closes with a config_timeout error.3
Receive session_ready
The server replies with a
session_ready frame containing your session_id and the effective config. Only now should you begin streaming audio.4
Stream & finish
Send binary audio frames, then flush with
end_utterance and end with close. See Messages.Connect (full example)
Close codes
For a fatal application error after the socket is accepted (for example
session_conflict or overloaded), the server first sends a JSON error frame with "fatal": true and then closes the socket. Branch on the error code, not only on the close code. See Errors.Next steps
Session config
Every config field, defaults, and the
session_ready echo.Messages
Audio frames, control frames, and the transcript schema.