Users

Users belong to an organization and may have custom roles.

The users model

Properties

  • Name
    id
    Type
    string
    Description

    User UUID.

  • Name
    email
    Type
    string
    Description

    Login email.

  • Name
    fullName
    Type
    string
    Description

    Display name.

  • Name
    role
    Type
    string
    Description

    Legacy primary role.


GET/api/users

List users

Paginated staff list.

Query parameters

Query parameters: page, pageSize.

Request

GET
/api/users
curl -X GET http://localhost:3000/api/users \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "email": "doctor@clinic.example",
      "fullName": "Dr. Lee",
      "role": "DOCTOR",
      "isActive": true
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 10,
    "total": 1,
    "totalPages": 1
  }
}

POST/api/users

Create user

Invite or create user.

Request

POST
/api/users
curl -X POST http://localhost:3000/api/users \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "email": "new@clinic.example",
  "invitationSent": true
}

PATCH/api/users/:id

Update user

Update profile or role assignment.

Request

PATCH
/api/users/:id
curl -X PATCH http://localhost:3000/api/users/:id \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "fullName": "Dr. Lee",
  "role": "DOCTOR"
}

POST/api/users/:id/resend-invitation

Resend invitation

Resend invite email.

Request

POST
/api/users/:id/resend-invitation
curl -X POST http://localhost:3000/api/users/:id/resend-invitation \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "sent": true
}

GET/api/roles

List roles

Custom roles with deniedKeys.

Request

GET
/api/roles
curl -X GET http://localhost:3000/api/roles \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Front desk",
      "deniedKeys": [
        "patients.delete"
      ],
      "sortOrder": 0
    }
  ]
}

Was this page helpful?