Skip to content
On this page

Account

Account settings

Failover preference and the account state exposed by the session endpoint.

Failover preference

GET/account/settingsJWT or API key

Returns { "auto_fallback": true }. Patch the value with:

curl -X PATCH https://api.relayrouter.org/account/settings \
-H "Authorization: Bearer $JWT" \
-H 'content-type: application/json' \
-d '{"auto_fallback":false}'

The setting is cached for about 10 seconds per user. A PATCH invalidates the cache immediately. A single request can override failover with no_fallback: true.

Email preferences

GET /account/settings also returns email_prefs. A PATCH accepts a partial object; omitted keys keep their current value.

{
"auto_fallback": true,
"email_prefs": {
"security": true,
"usage": true,
"news": false,
"promotions": false
}
}
FieldTypeDescription
securitybooleanSign-in notices.
usagebooleanSpend-cap and daily-limit alerts.
newsbooleanAnnouncements.
promotionsbooleanOffers and marketing.

Transactional mail is not optional

Email verification, password reset, and receipts always send. Every non-transactional mail carries a signed unsubscribe link.

One-click unsubscribe

Every non-transactional email carries a signed link:

GET /email/unsubscribe?u=<user-id>&c=<category>&sig=<hmac>

c is one of security, usage, news, promotions. The signature is an HMAC-SHA256 of <user-id>:<category> with the server secret, so a link cannot be forged or replayed against another account. The endpoint is public, idempotent, and returns a small HTML confirmation page. A bad signature renders “Link invalid” with a link to settings.

Session state

GET /auth/me exposes the profile, balance, verification state, and network fee override. Quota fields such as token_limit and tokens_used are not returned yet.

JWT expiry

Sessions hard-expire at JWT_TTL_HOURS (default 24 h). There is no refresh token; catch 401 and send the user to sign in.