Users management

Endpoints related with users management such as login or user update.

post
Log In

https://api.expai.io/api/auth/login
This endpoint allows you to login and get your JWT token that will be used to authorise your operations. Every time you log in, previous tokens generated through the API will be revoked.
Request
Response
Request
Headers
Content-Type
required
string
Value: "application/json"
Body Parameters
password_des
required
string
Password for your account
email_des
required
string
Your email registered at EXPAI
Response
200: OK
Successful Login
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNDYxNDVhZmUtYjQwMC00OGVmLWE4MTgtYWJlODhiM2RiYWUzIiwiZXhwIjoxNjE5NDUxNDczfQ.XEtQm_Iv046PL2xJI2Urq1gJ9IHLD-uNI51HwoClqlo",
"code": "success",
"http_code": 200,
"message": "success"
}
422: Unprocessable Entity
Example error if credentials are not right
{
"code": "invalidInput",
"errors": "Email or password incorrect",
"http_code": 422,
"message": "Invalid input"
}

post
Log Out

https://api.expai.io/api/auth/logout
Logout from your account and revoke your active JWT token.
Request
Response
Request
Headers
access-token
required
string
Active JWT token obtained during login
Response
200: OK
Successful Logout
{
"code": "success",
"http_code": 200,
"message": "success"
}
403: Forbidden
Example for invalid token
{
"code": "notAuthorized",
"errors": "A valid token is required",
"http_code": 403,
"message": "You are not authorized to execute this"
}

patch
Update User

https://api.expai.io/api/users/<user-id>
This endpoint allows you to login and get your JWT token that will be used to authorise your operations. Every time you log in, previous tokens generated through the API will be revoked.
Request
Response
Request
Path Parameters
user-id
required
string
Unique ID that identifies your user
Headers
access-token
required
string
Active JWT token
content-type
required
string
Value: "application/json"
Body Parameters
name_des
optional
string
New name for the user
surname_des
optional
string
New surname for the user
email_des
optional
string
New email for the account
Response
200: OK
Successful Update
{
"code": "success",
"http_code": 200,
"message": "success"
}

post
Update Password

https://api.expai.io/api/users/update_password
Update password for your user
Request
Response
Request
Headers
access-token
required
string
Active JWT token
Content-Type
required
string
Value: "application/json"
Body Parameters
new_password_des
required
string
New password
password_des
required
string
Old password
Response
200: OK
Successful Update
{
"code": "success",
"http_code": 200,
"message": "success"
}

post
Create user from license

https://api.expai.io/api/users/create_user_from_license
Update password for your user
Request
Response
Request
Headers
Content-Type
required
string
Value: "application/json"
Body Parameters
captcha_token_des
required
string
Valid captcha token to validate human users
name_des
optional
string
Name
surname_des
required
string
Surname
email_des
required
string
User email
password_des
required
string
Password for the user
license_key_des
required
string
Valid EXPAI license key
Response
200: OK
Successful Update
{
"code": "success",
"http_code": 200,
"message": "success"
}

‚Äč