I have a problem with stalwart-cli (stalwart V 0.16.6)

Your question

I have made this template, but it doesn’t work.
whats wrong with it?

stalwart-cli --url STALWART_URL --user [email protected] --password passwort create Account/User
–field name=someuser
–field domainId=somedomain
–field ‘credentials={“0”:{“@type”:“Password”,“secret”:“passwort2”}}’
–field ‘memberGroupIds={}’
–field ‘roles={“@type”:“User”}’
–field ‘permissions={“@type”:“Inherit”}’
–field ‘quotas={“storage”:524288000}’
–field ‘aliases={}’
–field ‘encryptionAtRest={“@type”:“Disabled”}’

?
i get “builder error”

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

There are two issues in your command worth addressing:

1. The credentials field should be {} when creating, or use "secret" not "passwort2" as a placeholder issue

Actually the main structural problems are:

  • credentials={} is the correct form for the create call – the docs show passing an empty {} there, not inline JSON with a password. Setting the password separately (via update or the WebUI) is the typical pattern.
  • quotas={"storage":524288000} is fine, but the reference example uses quotas={}, so if the quotas field shape is strict, a nested key passed via --field may cause a parse error.
  • roles={"@type":"User"} is correct – the docs confirm this form.
  • **"builder error"** typically means the CLI could not construct the HTTP request, which can happen if the –urlvalue is wrong (e.g., missing scheme, trailing slash issues) or the JSON in one of the–field` values is malformed after shell expansion.

The minimal working example from the docs is:

stalwart-cli --url https://mail.example.com --user [email protected] --password passwort \
  create Account/User \
  --field name=someuser \
  --field 'domainId=<Domain id>' \
  --field 'credentials={}' \
  --field 'memberGroupIds={}' \
  --field 'roles={"@type":"User"}' \
  --field 'permissions={"@type":"Inherit"}' \
  --field 'quotas={}' \
  --field 'aliases={}' \
  --field 'encryptionAtRest={"@type":"Disabled"}'

Key differences from your version:

  • Use credentials={} (empty) rather than inline JSON with the password at create time.
  • Use quotas={} (empty) rather than a nested JSON object – set quota afterwards via update.
  • Make sure --url includes the full scheme, e.g. https://mail.example.com (not just a hostname).

For the domainId field, you need to pass the server-assigned ID of the domain object, not its name. Run stalwart-cli query Domain first to get the correct ID.

Docs reference: Account object reference and Creating objects (CLI)

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

It works! thank you.

i used “STALWART_URL”, but the variable was empty.

how can i add locale and timezone via stalwart-cli?