Create a team member
Adds a staff account. Scope: team_members:write. Pick the flow with mode:
mode: "invite" (default) | mode: "create" | |
|---|---|---|
| How it works | Invitation email with an accept link - the member confirms on your branded accept page and the account activates | The account exists immediately - the member signs in right away with their email code (OTP) or social login |
| Starts as | status: "invited", origin: "invitation" | status: "active", origin: "direct" |
| Built for | Real people with their own inbox | Till/scanner accounts you provision for a store |
On activation the location assignment is written both to VEXiON and to the member’s auth-time enforcement metadata - the same mechanism the scanner app and every location-scoped request checks.
Location rules (enforced)
scanner→location_idsrequired, exactly one - a till account belongs to one store (422 scanner_requires_single_location)manager→ one or more; omitted = the organization’s default locationadmin→ must omitlocation_ids- admins implicitly see all locations (422 admin_has_all_locations)
Temporary staff (scanner only)
Set expires_at on a scanner for seasonal help: 24 h before expiry the member gets a heads-up email; at expiry all sessions are revoked (signed out within ~5 minutes), access is removed, status flips to expired, and a confirmation email goes out. Other roles → 422 expires_at_scanner_only.
Not on the API
- Revoking members - dashboard only; the API reads
status: "revoked"records - Delegated billing - dashboard only (needs the manager’s own billing consent)
Duplicate email (member or pending invite) → 409 already_member.
Email validation
Every address is validated by our identity provider before an account or an invitation is created, in both modes, so mode: "invite" and mode: "create" return the same status for the same address.
- Reserved and unroutable domains are refused.
@example.test,@something.invalidand similar return422 validation_failedwithfield_errors[0] = { param: "email", code: "invalid_format" }. Use a real, routable domain when you test. - An address that already holds an account or a pending invitation returns
409 already_member. - An unrecognised upstream failure (a provider outage rather than a bad address) returns
500and is alerted on internally. Only known validation failures are reported back to you as your input, so an outage is never silently blamed on your request. Retry with the sameIdempotency-Key.
Authorizations
Your secret API key as a Bearer token: Authorization: Bearer vxn_sk_.... Keys are created and scoped in the dashboard - see Authentication.
Headers
Required on every mutating POST. 24h byte-replay; 409 idempotency_key_conflict on body mismatch. See Idempotency.
8 - 255Body
Adds a staff account. mode picks the flow:
invite(default) - invitation email with an accept link;status: "invited"until the member acceptscreate- the account exists immediately (status: "active"); the member signs in right away with their email code (OTP) or social login. Built for till/scanner accounts.
Delegated billing is never configurable via API.
Sign-in email, unique per organization. Already a member or already invited → 409 already_member.
Role. Determines the location_ids cardinality rule.
admin, manager, scanner invite - email invitation; the member accepts the link and the account activates. create - active immediately; the member signs in with their email code (OTP) or social login, no acceptance step. Defaults to invite.
invite, create Given name (useful with mode: "create" - invited members fill their own).
100Family name.
100Role-bound: scanner → REQUIRED, exactly one (422 scanner_requires_single_location); manager → one or more, defaults to the organization's default location when omitted; admin → must be omitted (422 admin_has_all_locations).
100^loc_[A-Za-z0-9]+$Auto-expiry for temporary staff - scanner role only (422 expires_at_scanner_only): seasonal hires, one-day events. Must be in the future (422 expires_at_in_past). At expiry: sessions revoked (~5 min), access removed, status: "expired", confirmation email; heads-up email 24 h before. Omit or null = permanent.
Email language. Defaults to the organization language.
en, sk, cs, de Response
Team member created (invited or active per mode).
A staff account - dashboard and scanner access. Role lives in the auth provider; the location assignment is dual-written: a queryable mirror in VEXiON (surfaced as Location.team_members[]) plus auth-time enforcement metadata on the user account, which is what locks a scanner to their single store at every request. location_ids here is the ONE write path - both copies sync from it.
id and this resource's identity fields (first_name/last_name/email/language) are anchored to a registry row scoped to YOUR organization - the same person staffing another organization has a DIFFERENT id there, and a PATCH here never changes what that other organization sees for them. Manual transactions carry the acting member as Transaction.team_member_id - which is why revoked and expired members are preserved as records: history stays attributable forever. Members sign in with their email code (OTP) or social login.
Team member identifier, tm_ prefix. For an active member it is stable within your organization across role and location changes, and it is never shared with any other organization they may also staff. For a member still invited it belongs to the current invitation and changes when the invitation is re-sent, when a PATCH edits the invited member's name, role or expires_at (the invitation is re-issued and a new email sent), and when the invite is accepted; the previous id then returns 404. Key invited members by email.
^tm_[A-Za-z0-9]+$"tm_01HW9R6M4XQ2N8MTX1RVTM0001"
Always "team_member".
"team_member"Sign-in email, unique per organization.
"anna@demo-coffee.example"
What they can do:
admin- everything incl. billing, cards, team; implicit access to ALL locationsmanager- customers, notifications, scanner at assigned locations; no billing, no card editingscanner- POS scanner only, at exactly one location (a till account)
Role changes email the member automatically.
admin, manager, scanner "scanner"
Assigned locations - the write path for the location↔member relationship (Location.team_members[] is the read mirror). Cardinality is role-bound: admin → always [] (all locations implicit); manager → one or more; scanner → exactly one.
^loc_[A-Za-z0-9]+$Lifecycle:
invited- invitation email sent, account not yet created (invitation origin only)active- can sign in and actrevoked- removed by an admin (DELETE); sessions revoked, record preservedexpired-expires_atpassed; sessions revoked automatically, record preserved
Terminal states (revoked, expired) are not editable - add the person again with a new POST.
invited, active, revoked, expired "active"
How the account came to be: invitation - the member accepted an email invite on the branded accept page; direct - an API call created the account, active immediately with email-code (OTP) or social sign-in (typical for till/scanner accounts).
invitation, direct "direct"
Unix seconds.
1750000000
Given name. Null until the member fills their profile (invitation origin) or you supply it (direct origin).
"Anna"
Family name.
"Kováčová"
Unix seconds when this member auto-expires - the temporary-staff feature, available on the scanner role only (seasonal hires, one-day events; a till account that cleans itself up). Null = permanent, and always null for admin/manager. At expiry the platform revokes all sessions (signed out within ~5 minutes), removes access, sets status: "expired", and emails the member; a heads-up email goes out 24 h before. Extend or clear by PATCHing before expiry.
null
Email language for invitations and lifecycle notices. Defaults to the organization language.
en, sk, cs, de, null "sk"
When the invitation email was sent. Null for direct origin.
1750000000
When the account became active - invitation acceptance time, or creation time for direct origin. Null while invited.
1750003600
Unix seconds of last change.
1751500000