# create_account_with_auth · FT4 Rell API · Chromia Docs (concept)

> function create_ account_ with_ auth(auth_ descriptor: auth_descriptor , account_ id: byte_ array?): account Standard way of creating a user account. Accou

Source: https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.accounts/create_account_with_auth/

FUNCTION

# create\_account\_with\_auth

```signature
function create_account_with_auth(auth_descriptor: auth_descriptor, account_id: byte_array?): account
```

[Source](https://gitlab.com/chromaway/ft4-lib/-/blob/development/rell/src/lib/ft4/core/accounts/module.rell#lines-409)

Standard way of creating a user account. Account registration strategies call this function.

Can only be called from an operation.

Throws `"RESTRICTED MAIN AUTH"` if the auth descriptor has expiration rules, i.e. if the
`rules` field is not equivalent to the value of `GTV_NULL`.

Throws if the auth descriptor is invalid. Common cases include:

* errors with the `args` field:
  + some required flags are missing
  + in multi-sig auth descriptors, the `required_signatures` field:
    - is 0 or less
    - is greater than the number of signers

**Parameters**

* **auth\_descriptor** — the main auth descriptor for the account.
* **account\_id** — optionally, the id for this account.

**See Also**

* [auth\_flags\_config.mandatory](https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.accounts/auth_flags_config/) — for the required flags
* [account\_auth\_descriptor.rules](https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.accounts/account_auth_descriptor/) — for the list of valid GTV representations of rules

[View this page on docs.chromia.com](https://docs.chromia.com/pages/ft4-rell/-f-t4%20-library/lib.ft4.core.accounts/create_account_with_auth.html)Generated API reference, mirrored from the live docs
