veil_get_session_status to check whether you are already logged in before prompting for credentials.
veil_get_session_status
Check whether there is an active Veil session for this installation. Use this at the start of any workflow. Inputs None. Outputsstring
required
authenticated when logged in, unauthenticated when not.object
Present when
status is authenticated. Contains id, email, onboardingStatus, accountType, username (null if not claimed), displayUsername, and activeMode (sandbox or live).string
ISO 8601 timestamp when the current session expires.
veil_request_otp
Send a one-time password to the user’s email to begin login. Inputsstring
required
Email address to send the login code to.
string
required
sent on success. rate_limited if too many requests were made recently. email_send_failed or error on failure.string
ID to pass to
veil_verify_otp along with the code.number
How long the code is valid.
number
Seconds to wait before retrying when
status is rate_limited.string
Error description on failure.
veil_verify_otp
Complete login by submitting the six-digit code from the user’s email. Inputsstring
required
From a previous
veil_request_otp call.string
required
The six-digit numeric code from the email.
string
required
logged_in on success. invalid, expired, too_many_attempts, already_used, or error on failure.object
Present when
status is logged_in. Contains id, email, isNewUser, onboardingStatus, and accountType.number
Remaining attempts when
status is invalid.string
Error description on failure.
veil_logout
Revoke the current Veil session. Safe to call when already logged out. Inputs None. Outputsstring
required
logged_out if there was an active session, not_logged_in if already logged out, error on failure.string
Error description when
status is error.veil_set_mode
Switch this installation between sandbox (test) and live (real money) modes.Mode switching affects only this installation. The dashboard and other paired devices are not changed. Use the dashboard’s mode toggle to change all surfaces at once.
veil_set_mode is a write operation, so it’s subject to a tighter rate limit than the read-only session tools.
Inputs
string
required
sandbox or live.string
required
switched on success, error on failure.string
The mode now active:
sandbox or live.string
Error description when
status is error.See also
- In-chat flow — how the login sequence fits into an offramp conversation