Overview / System / Invite a user

Invite a user

post https://api.flactrum.com/v1/users

Users are invited, never created outright: the password is set by the person accepting the invitation. An API that could set someone else's password would be a way to take over an account.

Required scope users.write
Success status201
Returns One BrandUser object

Request body

FieldTypeDescription
name * string —
email * string Unique within this brand. Someone with an account in another brand can still be invited here.
role_id * string —
scope * string What the membership can see. scoped: the branches in branch_ids plus every branch in regions.
branch_id string|null Required when scope is branch.
region string|null Required when scope is region.
branch_ids array With scope scoped.
regions array With scope scoped.
employee_id string|null On invite: link the new account to this employee record (one without an account).
two_factor_required boolean Head office admin only; ignored for anyone else.

Response fields

FieldTypeDescription
id string Membership id — not the user id.
user_id string —
name string|null —
email string|null —
role_id string —
role string|null Role slug.
branch_id string|null Set when the membership is scoped to one branch.
region string|null Set when scoped to a region.
branch_ids array Every branch the membership covers directly.
regions array Every region the membership covers.
scope string Derived from the branches and regions; the same value the invite input takes. scoped means more than one branch or region.
two_factor_required boolean This person must use two-factor authentication.
two_factor_enabled boolean Whether they have set it up.
invitation_url string Only in the response to an invite or resend, and only to the caller: the one-time acceptance link, so it can be passed on by hand if the e-mail does not arrive. Never stored or listed.
status string —
joined_at string|null —

Examples

Recorded from the test suite — these are real requests and their real responses.

curl -X POST 'https://api.flactrum.com/v1/users' \
  -H 'Authorization: Bearer flk_your_key:your_secret' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Mert Öz",
    "email": "mert@ornek.com",
    "role_id": "01m43mx07jr79y23r0zk7havbz",
    "scope": "branch",
    "branch_id": "01m43mzpz8byn6q31mjrn95skh"
}'

HTTP 201 · application/json

{
    "data": {
        "id": "01m43mzq1b46qsaw68t27epptq",
        "user_id": "01m43mzq1b46qsaw68t27epptp",
        "name": "Mert Öz",
        "email": "mert@ornek.com",
        "role_id": "01m43mx07jr79y23r0zk7havbz",
        "role": "sube_muduru",
        "branch_id": "01m43mzpz8byn6q31mjrn95skh",
        "region": null,
        "branch_ids": [
            "01m43mzpz8byn6q31mjrn95skh"
        ],
        "regions": [],
        "scope": "branch",
        "two_factor_required": false,
        "two_factor_enabled": false,
        "status": "invited",
        "invited_at": "2026-10-04T14:27:16+00:00",
        "invitation_expires_at": "2026-10-11T14:27:16+00:00",
        "joined_at": null,
        "created_at": "2026-10-04T14:27:16+00:00",
        "updated_at": "2026-10-04T14:27:16+00:00",
        "invitation_url": "http://test-brand.localhost:8000/invite/H1HEyJttzdV14luqNIziTsivpYwpYCu6UW293tqSOQDy0hDV21BqQ0tAF0Qso0YN"
    },
    "meta": {
        "invitation_delivered": true
    }
}