Account and credential
- 1 endpoint
A user is an identity (first name, last name, email, password), in no organization: where they work are their memberships and spaces (spaces). People are managed from /team, /members and /invitations. Signing in with a provider is auth.md (/auth/oidc, /auth/providers).
Get account#
GET /account
The user the request acts for: with a session, the signed-in user, whatever space they are in (a member's space an owner or admin switched to, an account without an organization, a staff view: the staff member); with an API key, the member it acts for (On-Behalf-Of, or a member's own key), or the user who created an organization key.
- Auth
- X-API-Key: any key
- On-Behalf-Of
- Honored: acts in the member's space
- Idempotency-Key
- Ignored
- Success
- 200
request.sh
curl https://api.qbitflow.app/v2/account \ -H "X-API-Key: $QBITFLOW_API_KEY"# 200: a UserResponse
A User.
uuidstringIts only id (a UUIDv7)
firstNamestringThe person's first name
lastNamestringTheir last name
emailstringcreatedAtstringupdatedAtstring
Errors
The common codes only, as any route (what each means):
- 401unauthorized
- 403forbidden
- 403policy_disabled
- 404not_found
- 429rate_limit_exceeded
- 500internal
- 504timeout
Edge cases
The contract's rules for these routes: Authentication & roles · The account — GET /account, PATCH /account · Status-code summary.
Read all 3
Authentication & roles
Every other route under /account and /auth is not on the SDK surface (dashboard-only: an API key → 404): signing in, password resets, the email confirmation, sessions, identities, referral.
GET /account/referral and /account/referral/stats are under the members.referralCode policy: a member has their own referral code while the organization's members.referralCode policy allows it (on by default; off → 403 policy_disabled); the organization always has one. A member's code is inert while the policy is off: signing up with it succeeds without a referral (no error), whether an organization (POST /organization/sign-up/confirm, POST /auth/oidc/organization, POST /organization) or a qbf.cash handle (POST /handles/claim/confirm, POST /auth/oidc/handle); referrals made earlier stay and keep earning. A qbf.cash handle sign-up (the same two routes) with an unknown code now proceeds without a referral too (it answered 500).
The account — GET /account, PATCH /account
GET /account→200User(uuid,firstName,lastName,email,createdAt,updatedAt): with a session, the signed-in user, whatever space the session is in (a member's space an owner or admin switched to, a staff view: the staff member); with an API key, the member it acts for (On-Behalf-Of, or a member's own key), or the user who created an organization key. The organization, role and mode are the session's (Login.space,GET /account/spaces), not the user's.PATCH /account(the signed-in user's own account; an API key →404): only the fields sent change; an absent field is unchanged.firstName,lastName(2 to 100 characters,namerule),password(8 to 72 characters of the allowed set) andemail. None can be cleared:""is refused like any invalid value (400validation_failedon the field).emailorpasswordneed a recent re-authentication (403reauth_required); the names don't. A newpasswordends the user's other logins, and the account's address is told. A new email is only applied once confirmed from the new address: the response keeps the current one, and the new address gets a confirmation link or, if it already has an account, an email saying so (the same answer either way). Answers200User.- One pending email change. A new
emailreplaces the pending one, whatever the address: the earlier link stops working. A password reset orPOST /auth/logout-allcancels it too, so a change asked for with a stolen session doesn't outlive the owner's recovery. - Account changes are told. A new password, a password reset, an email change (to the previous address) and a sign-in provider linked or removed send an "account changed" email to the account's address, with a link to reset the password if it wasn't them. The email names the kind of change only.
Status-code summary
401unauthenticated, invalid credentials, or a session whose login or membership is gone;staff_view_ended(a staff view's token once the view ended).403signing in to the other app's account (or, on qbf.cash, an account without a handle);no_organization: a session without an organization on a route that needs one;reauth_required/invalid_password(re-authentication);staff_view_read_only(the referral routes in a staff view).404a dashboard-only route with an API key; a space the session can't enter.400validation failure,invalid_confirmation_token.409an email confirmed after another account took it;last_sign_in_method;refresh_conflict.204removing an identity.
The codes named here
- 400validation_
failed path/query/body failed binding or validation, or a business rule about one input (a field named in
errors) - 403policy_
disabled a member doing what their organization's policy doesn't allow them, reads of what the policy governs included