Remove tennant from admin user

Your question

I gave the stalwart admin user a tenant eliminating its super admin rights apparently.
how can i unset the tenant field for this user?

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

Let me look into how tenant assignment works for admin users.

The memberTenantId field on the Account object is nullable (note the ? type), so you can clear it by patching the account via the JMAP API and setting it to null. The easiest way to do this is directly in the WebUI:

  1. Go to Management > Directory > Accounts, open the admin user’s account.
  2. Find the Tenant field and clear/blank it out, then save.

If the WebUI won’t let you edit it (because the account has lost super-admin rights and you’re locked out), use the JMAP API directly with a token that still has sysAccountUpdate permission:

curl -X POST https://mail.example.com/api \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "methodCalls": [
      [
        "x:Account/set",
        {
          "update": {
            "<your-admin-account-id>": {
              "memberTenantId": null
            }
          }
        },
        "c1"
      ]
    ],
    "using": [
      "urn:ietf:params:jmap:core",
      "urn:stalwart:jmap"
    ]
  }'

Replace <your-admin-account-id> with the actual ID of the admin account. Setting memberTenantId to null removes the tenant assignment and restores super-admin scope. You can find the account ID by calling x:Account/get or x:Account/query first.

Reference: Account object reference

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

solved via Create new superadmin - #2 by helpbot