1001: Create account

1001: Create account

Creates a new entity/user account in the Rubiq database with fields specified in a contract between the calling application and the Rubiq platform. A unique Rubiq entity ID is automatically assigned to the new entity, and optionally a key with an external type.



Endpoint ID:

1001

Method

POST

URL:

/entity/{contract-id}



contract-id

Identifies the set of contract fields passed in the request body. If omitted, the default contract for the particular app is used.

Request body:

JSON data with properties corresponding to the fields in the specified contract

Example 1 - Contract specifies full name, email and password:
{ "name": "John Doe", "email": "mailbox@mailserver.com", "password": "password" }

When a field is defined as a list field, multiple values can be assigned by sending a JSON array:

Example 2 - Contract defines "email" as a list field
{ "name": "John Doe", "email": ["mailbox@mailserver.com", "sales@mailserver.com"], "password": "password" }



JSON data with key(s) for the newly created account and data for the account. The result will always hold the Rubiq entity ID and if the app making the request is configured to use a specific external key, this key is also included in the response.

Example 1 – App setting specifies no specific key:
{ "id": 123456 "name": "John Doe", "email": "mailbox@mailserver.com" }
Example 2 – App setting specifies external key type:
{ "id": 123456, "extKeyType": 12, "extKey": "key" "name": "John Doe", "email": "mailbox@mailserver.com" }
Example 3 - The email field is defined as a list field
{ "id": 123456, "name": "John Doe", "email": ["mailbox@mailserver.com", "sales@mailserver.com"] }

Status codes:

201

Account was created with success



303

Account already exists



400

Request is valid but data validation failed

In case SMS verification is enabled, the following sub codes may be returned:

400.3

Mobile number is not in a valid format

400.4

Mobile number is not unique (the mobile number belongs to an active entity - this includes entities that have not yet been verified)

400.5

Mobile number is not unique (the mobile number belongs to an inactive entity)