Docs / API and agents

Team and users API

Organization admins invite and manage teammates; super admins suspend users and revoke sessions.

Routes#

Method and pathWhoWhat
POST /admin/userssession with users.inviteinvite a teammate with a role (customer teammates also need a customer role)
PATCH /admin/users/:idan administrator allowed to administer that user (same organization, or staff)change role (ORG_ADMIN, CREDIT_MANAGER, SALES_MANAGER, ACCOUNT_ADMIN, VENDOR_USER), permissions or status; 403 "You cannot modify this account.", a role invalid for the organization, or any staff role change here; 400 for an unknown permission
GET /internal/users, GET /internal/users/:idstaffuser directory and detail with access history
POST /internal/users/:id/accesssuper admin in their own staff sessionsuspend, reactivate or revoke sessions

Invite#

Body: email, role, optional permissions, customerRole only for APPLICANT teammates (buyer, buyer_manager, administrator). Send Idempotency-Key (header or body) so a retry does not invite twice. Membership is re-checked inside the transaction. An invited person joins only through the emailed invitation; company names and email text never grant membership.

StatusWhen
400invalid body, role and customer role mismatch, undeliverable email, bad key
403caller has no organization, is not an administrator, or lacks users.invite
413body above 16 KB
429more than 20 invitations per user per hour; more than 10 access changes per minute for staff

An email that already has an account is invited as a pending membership instead (accepted from their own session, see Organizations and memberships); 409 when that person is already a member, when the organization is linked to company SSO, or when the person's account is bound to another company's SSO.

PATCH /admin/users/:id acts on the membership the caller shares with the target: the role and permissions change that membership only, and status: DEACTIVATED removes the person from this organization (the account stays when they belong elsewhere). A person who is not a member of the caller's organization is a 404.