Me
- 1 endpoint
Get me#
GET /me
Answers what the request's credential is: an API key or a session, its role, and the space (organization and mode) it acts in, after On-Behalf-Of. An SDK calls it to check its key (a test key in production, the wrong organization). A session also gets its user, the spaces it may switch to, and its re-authentication window while it lasts; a session without an organization gets those only (no role, no space). Any valid credential, from either app; none → 401.
- 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/me \ -H "X-API-Key: $QBITFLOW_API_KEY"# 200: a Me// One client per API key, shared by the whole program. A blank key, one not starting with// sk_, or one with a space or a control character, throws a ValidationError (nothing is sent).const client = new QBitFlow( process. env. QBITFLOW_API_KEY ?? ''); // The recommended start-up check: what is this key, and which mode is it in? An// AuthenticationError for an unknown or revoked key.const me = await client.me();console.log(`${me.role} key, test mode: ${me.space?.test}`);# One client per API key, shared by the whole program. ValidationError: not an sk_… key.client = qbitflow. QBitFlow( os. environ["QBITFLOW_API_KEY"]) # The recommended start-up check: what is this key, and which mode is it in?me = client.me() # AuthenticationError for an unknown or revoked keyif me.space is not None: print( f"{me. space. organization_name}, role {me.role}, test mode {me.space.test}")// One client per API key, shared by the whole program: it is safe for concurrent use.client, err := qbitflow. NewClient( os. Getenv( "QBITFLOW_API_KEY"))if err != nil { log.Fatal(err) // a *qbitflow.ValidationError: no key, or not an sk_… key} // The recommended start-up check: what is this key, and which mode is it in?me, err := client.Me(ctx)if err != nil { log.Fatal(err) // a *qbitflow.AuthenticationError for an unknown or revoked key}if me.Space != nil { fmt.Printf("%s, role %s, test mode %v\n", me.Space.OrganizationName, me.Role, me.Space.Test)}// One client per API key, shared by the whole application.$client = new \QBitFlow\QBitFlow(apiKey: (string) getenv('QBITFLOW_API_KEY')); // The recommended start-up check: which space and mode is this key in?$me = $client->me(); // an AuthenticationException for an unknown or revoked keyprintf("%s, role %s, %s mode\n", $me->space?->organizationName ?? '?', $me->role ?? '?', $me->space?->test ? 'test' : 'live');Response
A Me.
9 fields of Me
credentialstringapiKey or session
One of:
apiKeyAn API key (X-API-Key)sessionA signed-in person's access token (Authorization: Bearer, the dashboard or qbf.cash)
apiKeyUuidstringOptionalThe key, for an API key (as GET /api-keys lists it)
userUuidstringOptionalWho signed in, for a session. Absent for an API key: a key acts for its space, not for the person who created it
rolestringOptionalWhat the request may do in the space: owner, admin, user (a member, or an owner or admin acting as one) or handle (qbf.cash). An API key is at most admin. Absent for a session without an organization
onBehalfOfUserUuidstringOptionalThe member an organization key (On-Behalf-Of) or an owner or admin (the dashboard) acts as: the space is that member's. Absent otherwise
spaceEntryOptionalThe space the request reads and writes in, as GET /account/spaces describes one (its test says the mode; member names the member of a personal space). Absent for a session without an organization (an account removed from its last one, or not in one yet): it creates one (POST /organization) or accepts an invitation
11 fields of
EntryuuidstringIts only id (a UUIDv7)
organizationUuidstringThe organization
userUuidstringOptionalThe member of a personal space; omitted for the shared space
testbooleantrustedAtstringOptionalAbsent (nil) while the organization holds this member's funds (held funds). Always set on a shared space
createdAtstringorganizationNamestringName of the space's organization
rolestringThe user's role in the organization: owner, admin, user or handle
memberMemberOptionalThe member whose space it is (its userUuid), named: who an owner or admin acting in it acts as. Absent for the organization's own space
4 fields of
MemberuserUuidstringThe member (as GET /members lists them)
firstNamestringlastNamestringAbsent when the account has none
emailstring
organizationFeePercentnumberOptionalThe organization's fee on the member's payments in this space, in bps ("0": none). Written as organizationFeePercent. Absent for the organization's own space (it takes no fee from itself)
staffViewbooleanTrue on the entry of a staff view (QBitFlow staff reading the space from the console, read-only: docs/api routes/account.md § The staff view); false on every space of your own
userUserOptionalWho signed in, as GET /account answers
6 fields of
UseruuidstringIts only id (a UUIDv7)
firstNamestringThe person's first name
lastNamestringTheir last name
emailstringcreatedAtstringupdatedAtstring
spacesarray of EntryEvery space the account enters in this app, as GET /account/spaces lists them ([] without an organization, and for an API key)
11 fields of each
EntryuuidstringIts only id (a UUIDv7)
organizationUuidstringThe organization
userUuidstringOptionalThe member of a personal space; omitted for the shared space
testbooleantrustedAtstringOptionalAbsent (nil) while the organization holds this member's funds (held funds). Always set on a shared space
createdAtstringorganizationNamestringName of the space's organization
rolestringThe user's role in the organization: owner, admin, user or handle
memberMemberOptionalThe member whose space it is (its userUuid), named: who an owner or admin acting in it acts as. Absent for the organization's own space
4 fields of
MemberuserUuidstringThe member (as GET /members lists them)
firstNamestringlastNamestringAbsent when the account has none
emailstring
organizationFeePercentnumberOptionalThe organization's fee on the member's payments in this space, in bps ("0": none). Written as organizationFeePercent. Absent for the organization's own space (it takes no fee from itself)
staffViewbooleanTrue on the entry of a staff view (QBitFlow staff reading the space from the console, read-only: docs/api routes/account.md § The staff view); false on every space of your own
reauthenticatedUntilstringOptionalWhile the session's re-authentication lasts: when it ends. Until then, the changes that need one (403 reauth_required) go through without asking again. Absent when there is none, or it ended
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 · The answer (Me).
Read all 2
Authentication
- Any valid credential, from either app: an API key (organization's or member's, with or without
On-Behalf-Of), a dashboard session, a qbf.cash session. None, or an invalid one →401unauthorized.
The answer (Me)
credential:apiKeyorsession.- An API key:
apiKeyUuidis the key (asGET /api-keyslists it). NouserUuid: a key acts for its space, not for the person who created it (GET /accountstill answers that person).spacesis[], anduserandreauthenticatedUntilare absent. - A session:
userUuidis who signed in,userthe account (asGET /accountanswers it),spacesthe spaces it may switch to (asGET /account/spaceslists them), andreauthenticatedUntilwhile its re-authentication lasts. NoapiKeyUuid. roleis what the request may do in its space:owneroradminin the organization's space (an organization key isadmin),userin a member's space (the member, or an owner, admin or organization key acting as them),handlefor qbf.cash.onBehalfOfUserUuidis the member acted as, when an organization key sendsOn-Behalf-Ofor an owner or admin switched into a member's space; absent otherwise.spaceis the request's space in the one shape every space has (Entry, asGET /account/spacesandLogin.spacewrite it):uuid,organizationUuid,organizationName,role(the caller's own role in the organization: an owner acting as a member staysownerhere, while the top-levelroleisuser),test(the mode: a test key answerstrue),createdAt,trustedAt(absent while the organization holds the member's funds), and for a member's spaceuserUuid,organizationFeePercent(a string,"0"when none; absent on the organization's own space) andmember. The space is the one every other route of the request reads and writes (spaces).space.membernames the member whose space it is:userUuid,firstName,lastName,email. It is there whoever reads it (the member, or the team acting as them: what an "acting as" banner shows, with no admin route to call). Absent in the organization's own space.space.staffView(a boolean, always present) isfalsefor every credential of your own, an API key always;trueonly with the token of a QBitFlow staff view (the staff console's read-only view of a merchant's space: Account and credential § The staff view), whosespaceis the viewed space (space.roleowner; in a member's space the top-levelroleisuser, withonBehalfOfUserUuid).- A session without an organization gets no
roleand nospace. - Nothing is changed or recorded (an API key's
lastUsedAtaside, as on any request).
The codes named here
- 401unauthorized
missing / invalid JWT or API key, an ended login