Users

Object

Properties marked Private are only visible when the user is your own.

Name Type Description

id

int

unique identifier

email

string

Private

is_email_confirmed

bool

Private

new_email

string

Private Used for changing email.

is_new_email_confirmed

bool

Private

referral_code

string

Private Code to give to users to refer them.

avatar

image

Sizes: full_size(1024x1024), small(64x64)

first_name

string

last_name

string

{
  "id": 1,
  "email": "john@gmail.com",
  "is_email_confirmed": false,
  "new_email": "",
  "is_new_email_confirmed": false,
  "referral_code": "81892308alkk&As",
  "avatar": {
    "full_size": "https://www.image.com/1.png",
    "small": "https://www.image.com/2.png"
  },
  "first_name": "John",
  "last_name": "Smith"
}

Create (register)

Register a new user. Returns the user object.

POST /register

Input

Name Type Description

email

string

Required

password

string

Required

first_name

string

last_name

string

referral_code

string

Referral code of the person that referred the user.

Output

{
  "id": 1,
  "email": "john@gmail.com",
  "is_email_confirmed": false,
  "new_email": "",
  "is_new_email_confirmed": false,
  "referral_code": "81892308alkk&As",
  "avatar": {
    "full_size": "https://www.image.com/1.png",
    "small": "https://www.image.com/2.png"
  },
  "first_name": "John",
  "last_name": "Smith"
}

Retrieve

Retrieve a user.

GET /users/:id

Update

Update a user.

PATCH /users/:id
PUT /users/:id

Input

Name Type Description

referred_by_code

string

Add a referral code for the user who referred this user. Useful for social auth or if the user forgets to enter it on signup. Only usable for 24 hours after registration.

avatar

image

first_name

string

last_name

string

Example: Add who the user was referred by.

{
  "referred_by_code": "8AZ7Z"
}

List

List users.

GET /users

Parameters

Name Description

q

A search query.

Login

Retrieve an auth token for the specified user. See Authentication for how to use it.

POST /login

Input

Name Type Description

email

string

Required

password

string

Required

Output

{
  "token": "lkja8*lkajsd*lkjas;ldkj8asd;kJASd811"
}

Social Auth (Register / Login)

Login / register using a social account. As this can be a bit complex, see the separate page on it: Social Auth

Me

Get the currently logged in user.

GET /users/me

Change Password

Change the password of the currently logged in user.

POST /users/change-password

Input

Name Type Description

current_password

string

Required

new_password

string

Required