Users and Authorised Users.
All paths and the root-user-vs-authorised-user distinction are verified against Weavr's published documentation.
Critical distinction
GET /users returns all users including root users. However,
modification operations (create, update, activate, deactivate) on
/users endpoints only apply to Authorised Users.
To modify root user details, use Weavr.Corporates.update/3 or
Weavr.Consumers.update/3.
Confirmed endpoints
GET /users— list all users (including root users)GET /users/{id}— get a userPOST /users— create an authorised userPATCH /users/{id}— update an authorised userPOST /users/{id}/activate— activate an authorised userPOST /users/{id}/deactivate— deactivate an authorised userPOST /users/{id}/invite/send— send (or resend) an invitePOST /users/{id}/enrolment/send— send enrolment (mobile OTP setup)
Summary
Functions
Activates an authorised user. POST /users/{id}/activate.
Creates an authorised user under the current identity.
Deactivates an authorised user. POST /users/{id}/deactivate.
Fetches a user (root or authorised) by id. GET /users/{id}.
Lists all users for the authenticated identity, including root users.
Sends an enrolment (mobile OTP device setup) notification to the user.
Sends (or re-sends) an invite to an authorised user.
Updates an authorised user's details. PATCH /users/{id}. Does not work on root users.
Functions
@spec activate(Weavr.Config.t(), String.t(), keyword()) :: :ok | {:error, Weavr.Error.t()}
Activates an authorised user. POST /users/{id}/activate.
@spec create(Weavr.Config.t(), map(), keyword()) :: {:ok, map()} | {:error, Weavr.Error.t()}
Creates an authorised user under the current identity.
POST /users
Key fields in attrs:
"name","surname","email"— required"mobile"— object with"countryCode"and"number""tag"— optional custom searchable field
@spec deactivate(Weavr.Config.t(), String.t(), keyword()) :: :ok | {:error, Weavr.Error.t()}
Deactivates an authorised user. POST /users/{id}/deactivate.
@spec get(Weavr.Config.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Weavr.Error.t()}
Fetches a user (root or authorised) by id. GET /users/{id}.
@spec list( Weavr.Config.t(), keyword() ) :: {:ok, map()} | {:error, Weavr.Error.t()}
Lists all users for the authenticated identity, including root users.
GET /users — supports opts[:filters] as query params
(e.g. offset, limit, email, active, createdFrom, createdTo, tag).
@spec send_enrolment(Weavr.Config.t(), String.t(), map(), keyword()) :: :ok | {:error, Weavr.Error.t()}
Sends an enrolment (mobile OTP device setup) notification to the user.
POST /users/{id}/enrolment/send — pass "channel" in attrs
(e.g. %{"channel" => "SMS"} or %{"channel" => "AUTHY"}).
@spec send_invite(Weavr.Config.t(), String.t(), keyword()) :: :ok | {:error, Weavr.Error.t()}
Sends (or re-sends) an invite to an authorised user.
POST /users/{id}/invite/send
@spec update(Weavr.Config.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, Weavr.Error.t()}
Updates an authorised user's details. PATCH /users/{id}. Does not work on root users.