Back to explore

auth

Users

Credits: 0.000001

Create

POST /v1/user/Create

Create a new user account. The email address and username for the account must be unique.

Request

emailstring

the email address

idstring

optional account id

passwordstring

the user password

profileobject

optional user profile as map<string,string>

usernamestring

the username

Response

accountobject

Request

Response

{}

Credits: 0.000001

Delete

POST /v1/user/Delete

Delete an account by id

Request

idstring

the account id

Response

{}

Request

Response

{}

Credits: 0.000001

List

POST /v1/user/List

List all users. Returns a paged list of results

Request

limitnumber

Maximum number of records to return. Default limit is 25. Maximum limit is 1000. Anything higher will return an error.

offsetnumber

Response

usersarray

Request

Response

{
    "users": [
        {
            "id": "user-1",
            "username": "joe",
            "email": "[email protected]",
            "created": "1637322407",
            "updated": "1637322407",
            "verified": false,
            "verificationDate": "0",
            "profile": {}
        },
        {
            "id": "user-2",
            "username": "jane",
            "email": "[email protected]",
            "created": "1637324407",
            "updated": "1637324407",
            "verified": false,
            "verificationDate": "0",
            "profile": {}
        }
    ]
}

Credits: 0.000001

Login

POST /v1/user/Login

Login using username or email. The response will return a new session for successful login, 401 in the case of login failure and 500 for any other error

Request

emailstring

The email address of the user

passwordstring

The password of the user

usernamestring

The username of the user

Response

sessionobject

The session of the logged in user

Request

Response

{
    "session": {
        "id": "df91a612-5b24-4634-99ff-240220ab8f55",
        "created": "1623677579",
        "expires": "1623699579",
        "userId": "8b98acbe-0b6a-4d66-a414-5ffbf666786f"
    }
}

Credits: 0.000001

Logout

POST /v1/user/Logout

Logout a user account

Request

session_idstring

the session id for the user to logout

Response

{}

Request

Response

{}

Credits: 0.000001

Logout All

POST /v1/user/LogoutAll

Logout of all user's sessions

Request

user_idstring

the user to logout

Response

{}

Request

Response

{}

Credits: 0.000001

Read

POST /v1/user/Read

Read an account by id, username or email. Only one need to be specified.

Request

emailstring

the account email

idstring

the account id

usernamestring

the account username

Response

accountobject

Request

Response

{
    "account": {
        "id": "fdf34f34f34-f34f34-f43f43f34-f4f34f",
        "username": "joe",
        "email": "[email protected]",
        "created": "1623677579",
        "updated": "1623677579"
    }
}

Credits: 0.000001

Read Session

POST /v1/user/ReadSession

Read a session by the session id. In the event it has expired or is not found and error is returned.

Request

session_idstring

The unique session id

Response

sessionobject

the session for the user

Request

Response

{
    "session": {
        "id": "df91a612-5b24-4634-99ff-240220ab8f55",
        "created": "1623677579",
        "expires": "1623699579",
        "userId": "8b98acbe-0b6a-4d66-a414-5ffbf666786f"
    }
}

Credits: 0.000001

Reset Password

POST /v1/user/ResetPassword

Reset password with the code sent by the "SendPasswordResetEmail" endpoint.

Request

codestring

The code from the verification email

confirm_passwordstring

confirm new password

emailstring

the email to reset the password for

new_passwordstring

the new password

Response

{}

Request

Response

{}

Credits: 0.000001

Send Password Reset Email

POST /v1/user/SendPasswordResetEmail

Send an email with a verification code to reset password. Call "ResetPassword" endpoint once user provides the code.

Request

emailstring

email address to send reset for

expirationnumber

Number of secs that the password reset email is valid for, defaults to 1800 secs (30 mins)

from_namestring

Display name of the sender for the email. Note: the email address will still be '[email protected]'

subjectstring

subject of the email

text_contentstring

Text content of the email. Don't forget to include the string '$code' which will be replaced by the real verification link HTML emails are not available currently.

Response

{}

Request

Response

{}

Credits: 0.01

Send Verification Email

POST /v1/user/SendVerificationEmail

Send a verification email to a user.

Request

emailstring

email address to send the verification code

failure_redirect_urlstring

The url to redirect to incase of failure

from_namestring

Display name of the sender for the email. Note: the email address will still be '[email protected]'

redirect_urlstring

The url to redirect to after successful verification

subjectstring

subject of the email

text_contentstring

Text content of the email. Include '$micro_verification_link' which will be replaced by a verification link

Response

{}

Request

Response

{}

Credits: 0.000001

Update

POST /v1/user/Update

Update the account username or email

Request

emailstring

the new email address

idstring

the account id

profileobject

the user profile as map<string,string>

usernamestring

the new username

Response

{}

Request

Response

{}

Credits: 0.000001

Update Password

POST /v1/user/UpdatePassword

Update the account password

Request

confirm_passwordstring

confirm new password

new_passwordstring

the new password

old_passwordstring

the old password

userIdstring

the account id

Response

{}

Request

Response

{}

Credits: 0.000001

Verify Email

POST /v1/user/VerifyEmail

Verify the email address of an account from a token sent in an email to the user.

Request

tokenstring

The token from the verification email

Response

{}

Request

Response

{}

Credits: 0.000001

Verify Token

POST /v1/user/VerifyToken

Check whether the token attached to MagicLink is valid or not. Ideally, you need to call this endpoint from your http request handler that handles the endpoint which is specified in the SendMagicLink request.

Request

tokenstring

Response

is_validboolean

messagestring

sessionobject

Request

Response

{
    "is_valid": true,
    "message": "",
    "session": {
        "id": "df91a612-5b24-4634-99ff-240220ab8f55",
        "created": "1623677579",
        "expires": "1623699579",
        "userId": "8b98acbe-0b6a-4d66-a414-5ffbf666786f"
    }
}