Create Account
Accounts can be used to access the enterprise API or the user interface (UI) using an email address and password.
Create Account (Protected Route)
In this example, we will create a new account via the protected route /v1/admin/account/register
. You can
also create a new account via the unprotected route /v1/account/register
. If you don't want to allow unprotected
creation please disable the account-registration
feature via the feature manager.
Please make sure to use a Super Admin when using this endpoint.
Endpoint:/v1/admin/account/register
| API Reference
Example Request
curl -X 'POST' \
'https://enterprise-sandbox.waltid.dev/v1/admin/account/register' \
-H 'accept: */*' \
-H 'Authorization: Bearer {yourToken}' \
-H 'Content-Type: application/json' \
-d '{
"profile": {
"name": "Max Mustermann",
"email": "max.mustermann@example.org",
"addressCountry": "AT",
"address": "Liechtensteinstraße 111/115, 1090 Vienna"
},
"preferences": {
"timeZone": "UTC",
"languagePreference": "EN"
},
"initialAuth": {
"type": "email",
"identifier": {
"type": "email",
"email": "max.mustermann@example.org"
},
"data": {
"type": "email",
"password": "password123456"
}
}
}'
Body
{
"profile": {
"name": "Max Mustermann",
"email": "max.mustermann@example.org",
"addressCountry": "AT",
"address": "Liechtensteinstraße 111/115, 1090 Vienna"
},
"preferences": {
"timeZone": "UTC",
"languagePreference": "EN"
},
"initialAuth": {
"type": "email",
"identifier": {
"type": "email",
"email": "max.mustermann@example.org"
},
"data": {
"type": "email",
"password": "password123456"
}
}
}
Body Parameters
profile
: Object - User's personal informationname
: String - Full name of the useremail
: String - User's email addressaddressCountry
: String - Two-letter country codeaddress
: String - Full postal address
preferences
: Object - User's system preferencestimeZone
: String - Preferred time zonelanguagePreference
: String - Preferred language code
initialAuth
: Object - Authentication informationtype
: String -email
identifier
: Object - Authentication identifier detailstype
: String -email
email
: String - Email used for identification
data
: Object - Authentication credentialstype
: String -email
password
: String - User's password
Response
{
"_id": "5e4eb66b-36c3-46bc-bc03-9a5eefc582f0",
"type": "USER",
"profile": {
"name": "Max Mustermann",
"email": "max.mustermann@example.org",
"addressCountry": "AT",
"address": "Liechtensteinstraße 111/115, 1090 Vienna"
},
"accountPreferences": {
"timeZone": "UTC",
"languagePreference": "EN"
},
"flags": [],
"roles": {}
}
Create Account (Unprotected Route)
In this example, we will create a new account via the unprotected route /v1/account/register
. If you don't want to
allow unprotected creation please disable the account-registration
feature via the feature manager.
Endpoint:/v1/account/register
Example Request
curl -X 'POST' \
'https://enterprise-sandbox.waltid.dev/v1/account/register' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"profile": {
"name": "Max Mustermann",
"email": "max.mustermann@example.org",
"addressCountry": "AT",
"address": "Liechtensteinstraße 111/115, 1090 Vienna"
},
"preferences": {
"timeZone": "UTC",
"languagePreference": "EN"
},
"initialAuth": {
"type": "email",
"identifier": {
"type": "email",
"email": "max.mustermann@example.org"
},
"data": {
"type": "email",
"password": "password123456"
}
}
}'
Body
{
"profile": {
"name": "Max Mustermann",
"email": "max.mustermann@example.org",
"addressCountry": "AT",
"address": "Liechtensteinstraße 111/115, 1090 Vienna"
},
"preferences": {
"timeZone": "UTC",
"languagePreference": "EN"
},
"initialAuth": {
"type": "email",
"identifier": {
"type": "email",
"email": "max.mustermann@example.org"
},
"data": {
"type": "email",
"password": "password123456"
}
}
}
Body Parameters
profile
: Object - User's personal informationname
: String - Full name of the useremail
: String - User's email addressaddressCountry
: String - Two-letter country codeaddress
: String - Full postal address
preferences
: Object - User's system preferencestimeZone
: String - Preferred time zonelanguagePreference
: String - Preferred language code
initialAuth
: Object - Authentication informationtype
: String -email
identifier
: Object - Authentication identifier detailstype
: String -email
email
: String - Email used for identification
data
: Object - Authentication credentialstype
: String -email
password
: String - User's password
Response Codes
201
- Your account has been registered successfully.