Create or update
Create a new or update an existing account, identified by walletAddress.
Request
HTTP POST to /accounts with Content-Type: application/json and a JSON body of:
- Example
- Schema
{
"walletAddress": "0xd03ea8624C8C5987235048901fB614fDcA89b117",
"emailAddress": "test@on3.one",
"username": "newviaapi"
}
{
"walletAddress": "string",
"emailAddress": "string",
"username": "string"
}
Fields
walletAddress
The wallet addresses you want to create or update an account for.
If an account already exists with this wallet address then we will update the account with any pased emailAddress and/or username.
If the account doesn't exist then we will create a new account with any passed emailAddress and/or username.
| Type | string |
| Required | Yes |
| Limitations | Must be a valid checksum address |
| Examples | "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" |
emailAddress
A valid and unique (not assigned to any other account) e-mail address to update the account to.
| Type | string |
| Required | No |
| Limitations | Must be a valid email address. |
| Examples | "hello@on3app.com" |
username
A valid and unique (not assigned to any other account) username to update the account to.
Usernames must be between 3 - 24 alphanumeric characters only and not contain any profanity or blacklisted words.
| Type | string |
| Required | No |
| Limitations | |
| Examples | "usernameviaapi" |
Response
You should appropriately handle any errors when wasSuccessful is false. The errors array will detail what went wrong, i.e., the email address you sent is invalid.
- Success (2XX)
- Failure (4XX)
{
"account": {
// .. full updated account object (see https://docs.on3.one/api/routes/accounts/get#response)
},
"wasSuccessful": boolean, // true or false
"errors": [ // array of errors
"string"
]
}
{
"requestId": "string",
"errors": [
"string"
]
}
Codes
| Code | Success | Description |
|---|---|---|
| 2XX | Yes | Your request was accepted and the account was either updated or created. |
| 4XX | No | Check the response body for details on what needs changing in the request. If the error continues and the request appears to be valid, please report this to the On3 support team. |
| 5XX | No | Your request failed due to a server-side error. If the error continues after several attempts, please report this to the On3 support team. |