Users
3 calls. Every request needs the Authorization header: see the overview.
users.list
Section titled “users.list”GET /usersEvery user of the tenant (Tenant.Admin).
Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.
Response: User[] (200)
curl -X GET "https://api.maitento.com/users" \ -H "Authorization: $MAITENTO_AUTH"const users = await mt.users.list();mt.users.list()users.update
Section titled “users.update”PUT /users/by-id/{id}Grants or removes admin, enables or disables a user (Tenant.Admin).
Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | uuid | yes |
Request body: UserUpdateRequest
| Field | Type | Required | Description |
|---|---|---|---|
isAdmin | boolean | True to make the user a tenant admin (Tenant.Admin); false for an ordinary member (Tenant.User). | |
isEnabled | boolean | Whether the user may sign in. |
Response: no body (204)
curl -X PUT "https://api.maitento.com/users/by-id/<id>" \ -H "Authorization: $MAITENTO_AUTH" \ -H "Content-Type: application/json" \ -d '{"isAdmin":false,"isEnabled":false}'await mt.users.update("b814ac02-0000-4000-8000-000000000001", { isAdmin: false, isEnabled: true });mt.users.update("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b", is_admin=False, is_enabled=True)users.self
Section titled “users.self”GET /users/selfThe caller: user, tenant and roles. user.id is the user id an API key is written with ("<userId>:<secret>").
Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.
Response: CurrentUserResponse (200)
curl -X GET "https://api.maitento.com/users/self" \ -H "Authorization: $MAITENTO_AUTH"const { user, tenant, roles } = await mt.users.self();mt.users.self()