Users API Endpoints

Base URLs

https://users-api.dimo.zone


Basic User Operations 🔐

Get Authenticated User

GET {baseUrl}/v1/user

Retrieves user attributes for the authenticated user.

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.

{
    "id": "CioweGY5RDI2MzIzQWI0OTE3OUE2ZDU3QzI2NTE1QjAxRGUwMTg1NTM3ODcSBHdlYjM",
    "email": {
        "address": null,
        "confirmed": false,
        "confirmationSentAt": null
    },
    "web3": {
        "address": "0xf9D26323Ab49179A6d57C26515B01De018553787",
        "confirmed": true,
        "used": true,
        "inApp": false,
        "challengeSentAt": null
    },
    "createdAt": "2024-01-18T23:19:22.693833Z",
    "countryCode": null,
    "agreedTosAt": null,
    "referralCode": "GAILPP",
    "referredBy": null,
    "referredAt": null
}

Update Authenticated User

PUT {baseUrl}/v1/user

Updates/modifies attributes for the authenticated user.

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.

Request Body

NameTypeDescription

userUpdateRequest*

Object

See example below for data structure:

{
    "countryCode": "USA",
    "email": {
        "address": "dimo_is_cool@gmail.com"
    },
    "web3": {
        "address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
        "inApp": true
    }
}
{
  "agreedTosAt": "2021-12-01T09:00:41Z",
  "countryCode": "USA",
  "createdAt": "2021-12-01T09:00:00Z",
  "email": {
    "address": "koblitz@dimo.zone",
    "confirmationSentAt": "2021-12-01T09:01:12Z",
    "confirmed": false
  },
  "id": "ChFrb2JsaXR6QGRpbW8uem9uZRIGZ29vZ2xl",
  "referralCode": "ANB95N",
  "referredAt": "2021-12-01T09:00:41Z",
  "referredBy": "0x3497B704a954789BC39999262510DE9B09Ff1366",
  "web3": {
    "address": "0x142e0C7A098622Ea98E5D67034251C4dFA746B5d",
    "challengeSentAt": "2021-12-01T09:01:12Z",
    "confirmed": false,
    "inApp": false,
    "used": false
  }
}ss

Delete Authenticated User

DELETE {baseUrl}/v1/user

Deletes the authenticated user. Throws a 409 error if the authenticated user has device registered.

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.


2FA Email Confirmation Flow 🔐

Send a Confirmation Email

POST {baseUrl}/v1/user/send-confirmation-email

Sends a confirmation email to the registered email address of the authenticated user. This is the initiation step of the 2-factor authentication (2FA).

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.

Submit an Email Confirmation Key

POST {baseUrl}/v1/user/confirm-email

Confirms the receipt of the confirmation email, this is the completion step of the 2-factor authentication (2FA).

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.

Request Body

NameTypeDescription

confirmEmailRequest*

Object

Specifies the key from the email. This needs to be in the format of { "key": "<6-digit-number>" }


Web3 User Auth Flow 🔐

Generate a Challenge for the User to Sign

POST {baseUrl}/v1/user/web3/challenge/generate

Generates a Web3 challenge message with an expiration timestamp for the user to sign.

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.

Submit a Signed Challenge

POST {baseUrl}/v1/user/web3/challenge/submit

Confirms ownership of an Ethereum address.

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.

Request Body

NameTypeDescription

confirmEthereumRequest*

Object

This needs to be in the format of { "signature": "<signed_challenge_msg>" }


Get User's Other Accounts

GET {baseUrl}/v1/user/check-accounts

Retrieves other connected accounts of the authenticated user.

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.

{
    "otherAccounts": [
        {
            "type": "google",
            "login": "dimo_is_cool@gmail.com"
        }
    ]
}

Miscellaneous 🔐

Agree to Terms of Service

POST {baseUrl}/v1/user/agree-tos

Sends a confirmation agreeing to the current Terms of Service.

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.

Submit a Referral Code

POST {baseUrl}/v1/user/submit-referral-code

Submits a referral code from another user. The request sends the referral code, validates, and stores it for referral rewards recognition.

Headers

NameTypeDescription

Authorization*

String

Bearer authentication using the access_token generated from the Web3 challenge.

Request Body

NameTypeDescription

submitReferralCodeRequest*

Object

This needs to be in the format of { "referralCode": "<6-digit-code>" }


Swagger Doc

Last updated