Skip to main content

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:

{
"walletAddress": "0xd03ea8624C8C5987235048901fB614fDcA89b117",
"emailAddress": "test@on3.one",
"username": "newviaapi"
}

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.

Typestring
RequiredYes
LimitationsMust 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.

Typestring
RequiredNo
LimitationsMust 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.

note

Usernames must be between 3 - 24 alphanumeric characters only and not contain any profanity or blacklisted words.

Typestring
RequiredNo
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.

{
"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"
]
}

Codes

CodeSuccessDescription
2XXYesYour request was accepted and the account was either updated or created.
4XXNoCheck 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.
5XXNoYour request failed due to a server-side error. If the error continues after several attempts, please report this to the On3 support team.