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.


CURL

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 information
    • name: String - Full name of the user
    • email: String - User's email address
    • addressCountry: String - Two-letter country code
    • address: String - Full postal address
  • preferences: Object - User's system preferences
    • timeZone: String - Preferred time zone
    • languagePreference: String - Preferred language code
  • initialAuth: Object - Authentication information
    • type: String - email
    • identifier: Object - Authentication identifier details
      • type: String - email
      • email: String - Email used for identification
    • data: Object - Authentication credentials
      • type: 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.

CURL

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 information
    • name: String - Full name of the user
    • email: String - User's email address
    • addressCountry: String - Two-letter country code
    • address: String - Full postal address
  • preferences: Object - User's system preferences
    • timeZone: String - Preferred time zone
    • languagePreference: String - Preferred language code
  • initialAuth: Object - Authentication information
    • type: String - email
    • identifier: Object - Authentication identifier details
      • type: String - email
      • email: String - Email used for identification
    • data: Object - Authentication credentials
      • type: String - email
      • password: String - User's password

Response Codes

  • 201 - Your account has been registered successfully.