Users
As the name suggest, User is a Main model in Block-Auth. On this page, we'll dive into the different users endpoints you can use to manage users programmatically. We'll look at how to query the users.
The user model
The user model contains all the information about your users, such as the user's DID and expiration times. The user model also contains information about the user's roles.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the User.
- Name
user_address
- Type
- string
- Description
The user's DID.
- Name
app_name
- Type
- string
- Description
The name of the App where the User is registered.
- Name
user_first_used_at
- Type
- timestamp
- Description
Timestamp of when the User sign into the APP for the first time.
- Name
user_last_used_at
- Type
- timestamp
- Description
Timestamp of when the User sign into the APP for the last time.
- Name
user_services_names
- Type
- array
- Description
List of services the User is using to sign in. Can be one of the following:
google
,metamask
,blockauth
,phantom
,microsoft
.
- Name
roles
- Type
- array
- Description
List of roles the User has.
Get a list of users
This endpoint allows you to get a list of users. You can filter the users by page, limit, and services.
API - users
curl --location 'https://api.block-auth.io/api/users?page=1&limit=100&fromServices=google%2Cmetamask%2Cblockauth' \
--header 'Authorization: Bearer your_access_token_here' \
--data ''
Response
{
"success": true,
"message": {
"pages": 1,
"items": [
{
"id": 1,
"user_address": "0x829cDC759c4339C8554C5C9E750C9c5A3B7828c8",
"app_name": "BlockAuth",
"user_total_txns": "1",
"user_first_used_at": "2024-04-07T17:50:07.000Z",
"user_last_used_at": "2024-04-07T17:50:07.000Z",
"user_services_names": [
"blockauth"
],
"roles": []
}
],
"total": 1
}
}