User API Documentation (2.22.0)

Download OpenAPI specification:Download

Overview

Localz User Management API gives you programmatic access to users and role groups for Localz platform. With the Localz User API, enterprise clients and partners can automatically provision users, synchronise user profile, and grant and remove access to Localz platform from a central management application.

Manage Users

Manage Users

Get users

Gets users for a project

path Parameters
projectId
required
string
query Parameters
deleted
boolean
username
string[a-zA-Z0-9]
name
string
last
string^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)
limit
integer
Default: 25

Responses

Register

Registers a new user

There are 3 types of user type:

  • user: This type is for special admin purpose. Do not use this type to create a user.
  • attendant: In-store collection mobile user or scheduler for field service project.
  • driver: Field service/mobile worker user.

When user type is set to attendant, the following fields are required:

  • locationIds: Array of storeCode the user has access to - see example payload for more info
  • access: Contains an array of string (default: "HO")

When user type is set to driver, the following fields are required:

  • visibleBy: List of locations that can see the driver
  • access: Must be of value DRIVER

Although you can set the roles/permission groups later, it is recommended that you specify them during user registration, to ensure they have the right access. You can either set an array of roles or groups.

Check User Management in the dashboard to see available roles and groups to set.

To access your dashboard, replace the last project id, i.e ZzWElCymBz5Fko2IrgnUEmWD3kq69qT89Q5f6000 with your own project id that has been allocated to you by Localz.

path Parameters
projectId
required
string
Request Body schema: application/json
username
required
string
password
required
string^(?=.*[A-Z])(?=.*[!@#$%()&*-^=+;<>?])(?=.*[0-...
firstName
string
lastName
string
roles
Array of strings (id)
tags
Array of strings (id)
phoneNumber
string
type
string
Default: "user"
Enum: "user" "attendant" "driver"
email
string
moduleDeviceId
string
desc
string
avatarUrl
string
locationIds
required
string
visibleBy
required
string
prefBranchId
string
access
required
string
accessTags
Array of strings (accessTags)
groups
Array of strings (accessTags)

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "roles": [
    ],
  • "tags": [
    ],
  • "phoneNumber": "string",
  • "type": "user",
  • "email": "string",
  • "moduleDeviceId": "string",
  • "desc": "string",
  • "avatarUrl": "string",
  • "locationIds": "string",
  • "visibleBy": "string",
  • "prefBranchId": "string",
  • "access": "string",
  • "accessTags": [
    ],
  • "groups": [
    ]
}

Get user

Gets user for a project

path Parameters
projectId
required
string
username
required
string

Responses

Deactivate user

Deactivate a user from a project

path Parameters
projectId
required
string
username
required
string

Responses

Update user

Update user

To reset the user's password, you can just include password in the request body and omit all other fields.

path Parameters
projectId
required
string
username
required
string
Request Body schema: application/json
password
string^(?=.*[A-Z])(?=.*[!@#$%()&*-^=+;<>?])(?=.*[0-...
roles
Array of strings (Model33)
Items Enum: "delivery:admin" "delivery:driver" "delivery:operator" "cnc:admin" "cnc:attendant" "cnc:operator" "realtime:driver" "media:driver" "preference:attendant" "preference:operator" "realtime:operator" "super-admin" "user:server" "inventory:admin" "inventory:supervisor" "inventory:operator" "site:admin" "site:operator"
tags
Array of strings (tags)
email
string
phoneNumber
string
firstName
string
lastName
string
groups
Array of strings (accessTags)
object (locationIds)
object (locationIds)
access
Array of strings (accessTags)
accessTags
Array of strings (accessTags)
prefBranchId
string
avatarUrl
string
moduleDeviceId
string
desc
string

Responses

Request samples

Content type
application/json
{
  • "password": "password",
  • "roles": [
    ],
  • "tags": [
    ],
  • "email": "john.doe@email.com",
  • "phoneNumber": "+61412334123",
  • "firstName": "John",
  • "lastName": "Doe",
  • "groups": [
    ],
  • "locationIds": {
    },
  • "visibleBy": {
    },
  • "access": [
    ],
  • "accessTags": [
    ],
  • "prefBranchId": "string",
  • "avatarUrl": "string",
  • "moduleDeviceId": "string",
  • "desc": "string"
}

Reactivate a deleted user

path Parameters
projectId
required
string
username
required
string

Responses