Skip to main content

User


List users

Get a list of users.

const response = await geocore.User.listUser({
groupIds: ["groupId"],
name: "name",
username: "username",
email: "email",
serialNumber: "serialNumber",
accessLevels: ["user"],
lastLoginRange: {
start: "2025-01-01",
end: "2025-01-01",
}
createdRange: {
start: "2025-01-01",
end: "2025-01-01",
}
updatedRange: {
start: "2025-01-01",
end: "2025-01-01",
}
lastLocation: {
north: 1,
south: 2,
west: 3,
east: 4,
};
page: 1,
limit: 10,
});

Parameters

nametypedata typedescription
groupIdsoptionalarray<string>Search by group IDs
usernameoptionalstringSearch by username
nameoptionalstringSearch by full name
emailoptionalstringSearch by email
serialNumberoptionalstringSearch by serialNumber
accessLevelsoptionalarray<string>Search by user access level
lastLoginRange[start]optionaldateSearch by lastLoginTime timestamp
lastLoginRange[end]optionaldateSearch by lastLoginTime timestamp
createdRange[start]optionaldateSearch by createdAt timestamp
createdRange[end]optionaldateSearch by createdAt timestamp
updatedRange[start]optionaldateSearch by modifiedAt timestamp
updatedRange[end]optionaldateSearch by modifiedAt timestamp
lastLocation[north]requirednumberLongitude of north west point
lastLocation[south]requirednumberLatitude of north west point
lastLocation[west]requirednumberLongitude of north east point
lastLocation[east]requirednumberLatitude of north east point
pageoptionalnumberPage ordinal number
limitoptionalnumberNumber of records per page

Response note

The final result depends on logged in user's access level

  • Users can find other users in the same subgroups.
  • Group admins can find users in their subgroups.
  • Company admins can find users in their company groups.
  • Super admins can find any users.
Create user

Create a new user.

const response = await geocore.User.createUser({
username: "exampleUser",
password: "BVT2FMhbaaXGwPoC3SRoJipqBsiqo127FbbMMf5@69d3!9d1V@?T8*6PDSXw",
email: "user@example.com",
name: "string",
accessLevel: "string"
});

Prerequisites

Successfully get the IdToken with superAdmin access level from login API.

Parameters

nametypedata typedescription
usernamerequiredstringUsername
passwordrequiredstringPassword
emailrequiredstringEmail
namerequiredstringFull name
accessLevelrequiredstringUser access level
Update user

Update a new user.

const response = await geocore.User.update(userId, {
serialNumber: "123456789",
name: "string",
});

Prerequisites

Successfully get the IdToken with superAdmin or user access level from login API.

Parameters

nametypedata typedescription
userIdrequiredstringUser ID
namerequiredstringFull name
serialNumberrequiredstringUser serial number
Update user password

Update a new user password.

const response = await geocore.User.updatePassword(userId, {
oldPassword: "string",
newPassword: "string",
});

Prerequisites

Successfully get the IdToken with superAdmin or user access level from login API.

Parameters

nametypedata typedescription
userIdrequiredstringUser ID
oldPasswordrequiredstringOld password
newPasswordrequiredstringNew password
Import users

Import users from a CSV file.

const formData = new FormData();
formData.append('groupId', groupId);
formData.append('csv', csvFile);

const response = await geocore.User.uploadUsers(formData);

Prerequisites

Successfully get the IdToken with superAdmin access level from login API.

Parameters

nametypedata typedescription
groupIdrequiredstringGroup ID to import users into
csvrequiredstringCSV file with user information
Export users

Export users to a CSV file.

const response = await geocore.User.exportUsers(groupId);

Prerequisites

Successfully get the IdToken with superAdmin access level from login API.

Parameters

nametypedata typedescription
groupIdrequiredstringGroup ID contains users to export
Update user last location

Update last location of logged in user.

const response = await geocore.User.updateLastLocation({
coordinates: [12, 34]
});

Parameters

nametypedata typedescription
coordinatesrequiredarray<number>Location of user