OS1 Services
...
User Management Service
User API

Introduction to Users

4min
a user represents the human resource that performs a task or a set of tasks such as pick up, delivery, and operations management users perform various assigned roles, such as operator, supervisor, and manager you can use the user api to build apps that can onboard and manage users in your customer’s organization user lifecycle by default, a user has four lifecycle states onboarding user data is being entered and/or verified active ​​user data is verified and the user is activated deboarding the user is in the process of being deactivated (for example, serving a notice period) inactive the user has been deactivated to retrieve the current state of a user, call the get user state endpoint the response body is returned in json format { "error" { "code" "string", "description" "string" }, "request" { "uri" "string", "body" {} }, "data" { "event" { "tostate" "active\ available", "reasoncode" "r 104", "data" {} }, "id" "user\ e5f2064c 1a8c 45d9 b125 05a5416135c9", "state" "active\ available" } } to change the state of a user, call the user state transition endpoint and pass the following parameters in the request body member description tostate one of the valid state codes onboarding, active, deboarding, or inactive reasoncode (optional) a valid reason code associated with the event data (optional) any additional information about the transition request bodies are specified in json format the following example request body shows how to change the state of the user { "tostate" "active\ available", "reasoncode" "r 104", "data" {} } user attributes attributes describe the characteristics of an object in the platform the user api specifies a set of system defined attributes and allows for the creation of custom attributes the following attributes are defined by default for each user in the system attribute description data type firstname (required) the first name of the user string middlename the middle name of the user string lastname the last name of the user string designation (required) the organizational title or position assigned to a user to fetch default designations, use the get all designation endpoint string email the email address of the user string category (required) the user type within the organization values regular or adhoc string primarymobile (required) the primary mobile number of the user varchar primarymobile > countrycode (required) standard country code for primary mobile number string primarymobile > number (required) the mobile number of the user it should be valued between 4 10 numeric digits string secondarymobile the secondary mobile number of the user this is a structure consisting of two fields the country code and the mobile number varchar employmenttype (required) the employment type of the user values full time, part time, contract/ adhoc, or n/a string worklocations an array of work locations for the user example facilities 1238 232 dsfs23 sdsdc string manager the participant id of the user’s supervisor string identification the type of identification document used to validate the user valid values drivers license, passport, pan card, aadhar card, or voterid string subfunction the subfunction of the user string fileid the file id of a picture of the user in the file management system example file 1238 232 dsfs23 sdsdc string