Create user
What is a user?
When creating a user through the Original API, you are essentially creating a unique user in our system to which we attach a unique wallet.
For more information about wallets, refer to the section wallets and security.
Create a user
Important:
Request headers are required. See API basics introduction for more information.
Endpoint
POST /user
- Creates a new
user
associated with the given app (set by the X-API-KEY). - Returns a new
user
(user uid
) associated with the given app.
Note:
The request is asynchronous -
user uid
will be immediately returned and the wallet will be created asynchronously.To know when the
user wallet
has been created, you can poll any Get user details endpoint, however it does not stop you from minting an asset for a newly createduser uid
.If you send a
create asset
request while the user's wallet is still being created, we will handle it asynchronously once the wallet creation process is complete. Therefore, you don't need to poll or wait for the wallet - you can send thecreate asset
request immediately after receiving theuser uid
.
Request body
Request body fields | Type | Description | Required/Optional |
---|---|---|---|
user_external_id | String | The unique ID by which you identify this user in your system. It can be explicitly null. | Optional |
email | String (URL) | The unique email address by which you identify this user in your system. It can be explicitly null. | Optional |
Tips
In the context of Creating a user:
user_external_id
refers to your own unique identifier in your system to identify the user. This can be their social ID or any other identifier that you use to identify a user in your app.
Request example
Sample: request body
{
"user_external_id": "user_external_id_1",
"email": "[email protected]"
}
Note: Both user_external_id and email are optional so you can send one or the other, both, or an empty request body
Response
Response example
Sample: 201 Created Response
You will receive a uid
which refers to the user's uid:
{
"success": true,
"data": {
"uid": "452711987655", // (user uid)
}
}
You can use this uid
to call the other User endpoints. For example, GET /user/{uid}
with this uid
will return the user's details.
This is the same uid
that will be seen on the developer console under App > Users.
Example
The following example creates a user for your app with user_external_id your-id-12 and email [email protected].
# API_KEY is your api key
# TOKEN is the access token generated with your api key secret
curl -i \
-X POST \
-d "{\"user_external_id\":\"your-id-12\",\"email\":\"[email protected]\"}" \
-H "Content-Type: application/json" \
-H "X-Api-Key: API_KEY" \
-H "Authorization: Bearer TOKEN" \
"https://api.getoriginal.com/v1/user"
Updated 2 months ago