Skip to Content
Bryfo Docsv0.2.1
交互式 OpenAPI

Authentication

Session login/register, TOTP 2FA, OIDC SSO, GDPR export/delete, and X-Bryfo-Step-Up elevation.

GET
/api/v1/auth/providers

Response Body

Public authentication capabilities and maintenance banner

Example Request
curl -X GET 'https://mail.example.com/api/v1/auth/providers'
Example Response200
Empty
POST
/api/v1/auth/login

Request Body

application/json
  1. body
email*string
Formatemail
password*string
totp_code?string

6-digit TOTP code or single-use recovery code when totp_enabled=true

Response Body

Sets HttpOnly bryfo_session cookie and returns User profile

application/json
  1. response
user?
Example Request
curl -X POST 'https://mail.example.com/api/v1/auth/login' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "password": "string"}'
Example Response
{  "user": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "email": "user@example.com",    "display_name": "string",    "role": "admin",    "totp_enabled": true,    "has_password": true,    "is_active": true,    "screener_enabled": true,    "created_at": "2019-08-24T14:15:22Z"  }}
POST
/api/v1/auth/register

Request Body

application/json
  1. body
email*string
Formatemail
display_name?string
password*string
Length8 <= length <= 128
invite_code?string
verify_code?string
turnstile_token?string
tos_accepted?boolean

Response Body

Account created and session established

Example Request
curl -X POST 'https://mail.example.com/api/v1/auth/register' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "password": "stringst"}'
Example Response
Empty
GET
/api/v1/auth/me

Authorization

SessionCookie
cookiebryfo_session<token>

HttpOnly, SameSite=Lax session cookie (7-day sliding TTL, 30-day cap).

Response Body

Current user profile

application/json
  1. response
id*string
Formatuuid
email*string
Formatemail
display_name*string
role*string
Value in"admin""member"
totp_enabled*boolean
has_password*boolean
is_active*boolean
screener_enabled*boolean
created_at*string
Formatdate-time
Example Request
curl -X GET 'https://mail.example.com/api/v1/auth/me' \  --cookie 'bryfo_session='
Example Response200
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "email": "user@example.com",  "display_name": "string",  "role": "admin",  "totp_enabled": true,  "has_password": true,  "is_active": true,  "screener_enabled": true,  "created_at": "2019-08-24T14:15:22Z"}
POST
/api/v1/auth/step-up

Authorization

SessionCookie
cookiebryfo_session<token>

HttpOnly, SameSite=Lax session cookie (7-day sliding TTL, 30-day cap).

Request Body

application/json
  1. body
password?string
totp_code?string
recovery_code?string

Response Body

Step-up token minted (10-minute TTL)

Example Request
curl -X POST 'https://mail.example.com/api/v1/auth/step-up' \  --cookie 'bryfo_session=' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
Empty
GET
/api/v1/account/export

Authorization

SessionCookieStepUpToken
cookiebryfo_session<token>

HttpOnly, SameSite=Lax session cookie (7-day sliding TTL, 30-day cap).

headerX-Bryfo-Step-Up<token>

10-minute session-bound elevation token minted via POST /api/v1/auth/step-up.

Response Body

ZIP archive stream

Example Request
curl -X GET 'https://mail.example.com/api/v1/account/export' \  -H 'X-Bryfo-Step-Up: ' \  --cookie 'bryfo_session='
Example Response200
Empty