Users

User

GET/v1/users

List users

This endpoint allows you to retrieve a paginated list of all your users. By default, a maximum of ten users are shown per page.

Request

Optional attributes

  • Name
    page
    Type
    integer
    Description

    The page number of users returned.

  • Name
    page_size
    Type
    integer
    Description

    The page size number of users returned.

Response

  • Name
    _id
    Type
    string
    Description

    Unique identifier for the user.

  • Name
    name
    Type
    string
    Description

    The full name for the user.

  • Name
    email
    Type
    string
    Description

    The email for the user.

  • Name
    username
    Type
    string
    Description

    The username for the user.

  • Name
    password
    Type
    string
    Description

    The password for the user.

  • Name
    role
    Type
    object
    Description

    The role for the user.

  • Name
    role._id
    Type
    string
    Description

    Unique identifier for the role.

  • Name
    role.name
    Type
    string
    Description

    The name for the role.

  • Name
    role.permissions
    Type
    array<string>
    Description

    The permissions for the role.

  • Name
    invited_date
    Type
    datetime
    Description

    Datetime of when the user was created.

  • Name
    invited_by
    Type
    string
    Description

    The user who invited this user.

  • Name
    joined_date
    Type
    datetime
    Description

    Datetime of when the user was joined.

  • Name
    updated_date
    Type
    datetime
    Description

    Datetime of when the user was updated.

  • Name
    updated_by
    Type
    string
    Description

    The user who update this data.

Request

GET
/v1/users
const response = axios.get('/v1/users', {
  params: {
    page:1,
    page_size: 10
  }
})

Response

{
  "users": [
    {
      "_id": "637b569149e0c02e1036c35a",
      "name": "John Doe",
      "email": "johndoe@example.com",
      "username": "johndoe",
      "role": {
        "_id": "637d83d15d2be131007524cb",
        "name": "admin",
        "permissions": ["invite-user", "edit-user"],
      },
      "invited_date": "2022-01-01T00:00:00.000Z",
      "invited_by": "637d83d15d2be122007524bf",
      "joined_date": "2022-01-02T00:00:00.000Z",
    },
  ],
  "pagination": {
    "page": 1,
    "page_size": 1,
    "page_count": 1,
    "total_document": 1
  }
}

POST/v1/users/invite

Invite users

This endpoint allows invite user to this app

Request

Required attributes

  • Name
    email
    Type
    string
    Description

    The email of the invited user.

Request

POST
/v1/users/invite
const response = axios.post('/v1/users/invite', {
  email: "jane@example.com"
})

Response

// empty response