Users

User Object

You can see all elements of the user object at the json below.

"id": "ae34bc53-660c-4d7b-94df-393baed04f32", "authId": "auth0|23f4291ere127", "createdAt": "2020-02-18T09:11:32.481Z", "updatedAt": "2020-02-21T09:25:57.734Z", "email": "[email protected]", "firstName": "FirstName", "lastName": "LastName", "fullName": "FirstName LastName", "emailVerified": true, "roles": [], "lastLogin": "2020-02-21T09:25:57.734Z", "activeWorkspace": "f213e5dd-4b92-46f0-95df-0b9dfff4e588", "lastIp": "194.142.152.18", "loginsCount": 5, "locale": "en", "picture": "https://intenseye.test/img.png", "isSso": true, "connection": "Intenseye"

{
"id": "ae34bc53-660c-4d7b-94df-393baed04f32",
"firstName": "FirstName",
"lastName": "LastName",
"fullName": "FirstName LastName",
"groupId": "970df7c4-843d-4A1D-9264-Bd0Cc5c5d927",
"isSso": true,
"emailVerified": true,
"connection": "cillum",
"roles": [],
"email": "[email protected]",
"activeWorkspace": "a9a9EeF6-C0aF-eB2A-EECB-8E0cFF80FfD9",
"picture": "https://intenseye.test/img.png",
"jobTitle": "Engineer",
"phoneNumber": {
"nationalNumber": 555,
"region": "US",
"countryCode": 1,
"e164Format": "+1555"
}
}

Endpoints


Query users

GET/user

Returns

Returns a response contains partial information of user object.

{
"status": "ok",
"data": {
"id": "Dcba19C2-2EAF-1feB-50c7-425e7C538fdb",
"email": "dolore",
"firstName": "laboris Lorem in non",
"lastName": "ex laboris",
"fullName": "qui occaecat tempor",
"emailVerified": true,
"roles": [
"amet enim",
"minim ea anim commodo dolore"
],
"activeWorkspace": "a9a9EeF6-C0aF-eB2A-EECB-8E0cFF80FfD9",
"picture": "Excepteur velit ex",
"isSso": true,
"connection": "cillum",
"groupId": "970df7c4-843d-4A1D-9264-Bd0Cc5c5d927",
"phoneNumber": {
"nationalNumber": -88448449.16286173,
"region": "sunt reprehenderit nisi",
"countryCode": -80693903,
"e164Format": "aliquip mollit nisi voluptate"
},
"jobTitle": "Duis est id dolor labore",
}
}

Update firstname and lastname of a user

PATCH/user

Arguments

BODY
  • firstName String required First name of the user
  • lastName String required Last name of the user
  • jobTitle String required Job title of the user

Returns

Returns HTTP 200


Update user picture

PATCH/user/picture

Arguments

MULTIPART FORM UPLOAD
  • image binary required Binary Image to upload

Returns

Returns HTTP 200


Update phone number of a user

PATCH/user/phone_number

Arguments

BODY
  • phoneNumber String required Phone number of the user
  • region String required Region of the user

Returns

Returns a success message

{
"status": "ok",
"message": "Phone number updated"
}

Give facility access to a user

POST/facilities/:facilityId/give_access

Roles:

users:write
#### Arguments
PATH PARAMETERS
  • :facilityId UUID required Id of the facility
BODY
  • actions List[String] required List of actions

Returns

Returns a success message

{
"status": "ok",
"message": "Access given to the user"
}

Delete facility access from a user

//TODO This endpoint wired incorrectly on backend side and not working as intended

POST/facilities/:facilityId/remove_access

Roles:

users:write

Arguments

PATH PARAMETERS
  • :facilityId UUID required Id of the facility
BODY
  • actions List[String] required List of actions

Returns

Returns a success message

{
"status": "ok",
"message": "Access removed from the user"
}