Invite a user
https://lemurseye.com/api/v1/usersCreates an account in your company and emails the person a link to choose their password. The link lasts 3 days and lands them in the console. Until they use it, the person shows as pendingPassword: true.
The company is always yours (taken from the token), never from the body.
If the email cannot be sent, the account is still created and you get a temporary password instead (invited: false): hand it over yourself. It is shown only in this response, and must be changed at first sign-in.
Permission: users:write (a person only, never an API key). The token is sent as Authorization: Bearer <token>; see Authentication.
Body (JSON)
emailstringrequiredTheir email address. Must not belong to any existing account.
namestringFull name.
rolesstring[]Roles to hold:
owner,manager,viewer,installer, from List roles. Empty means they can sign in but see nothing.deliverystringinvite(default) emails the link;passwordskips the email and returns a temporary password.forAppbooleanAn account for the phone app: it gets a permanent password (returned once) and no email. Default
false.
Response
201 The account, and how it was delivered.
Response fields
idstringThe new user's id.
emailstringTheir email.
rolesstring[]The roles given.
invitedbooleantruewhen the set-password email went out.temporaryPasswordstring | nullSet only when no email was sent (
delivery: password,forApp, or the email failed). Shown once, never stored: hand it over now.
Errors
A refusal by the rules comes back as { "error": "...", "code": "..." }: branch on code, show error. Where no message is listed, only the status code is returned.
- 400
emailis missing, or a role is not one your company can assign (for exampleplatform-admin). - 409
email_takenAn account already uses this email address. If it is an invitation here that was never accepted, resend it or delete it first.The address has an account, here or in another company (which one is never said).
- 401
No token, or it has expired.
- 403
The token lacks the permission above.