LemursEye
Documentation
API

Invite a user

POSThttps://lemurseye.com/api/v1/users

Creates 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)

  • emailstringrequired

    Their email address. Must not belong to any existing account.

  • namestring

    Full name.

  • rolesstring[]

    Roles to hold: owner, manager, viewer, installer, from List roles. Empty means they can sign in but see nothing.

  • deliverystring

    invite (default) emails the link; password skips the email and returns a temporary password.

  • forAppboolean

    An 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

  • idstring

    The new user's id.

  • emailstring

    Their email.

  • rolesstring[]

    The roles given.

  • invitedboolean

    true when the set-password email went out.

  • temporaryPasswordstring | null

    Set 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

    email is missing, or a role is not one your company can assign (for example platform-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.