Create a User
Users are created via /organizations/{org-type}/{org-id}/users.
org-type values
- management - for property management users
- tenants - for tenant users
- vendors - for vendor users
org-id: is the uuid of the company which the user belongs to
payload data
- userType: pmo, vendor, tenant
- account_id: uuid of the account
- organization_id: uuid of the company
- email: email of the user being added
- first_name: first name of the user
- last_name: last name of the user
- send_welcome_email: boolean to indicate whether welcome notification should be sent
- job_function_id: Job Function Id used to determine the initial permission groups.
- building_ids: array of building ids to give access to the user
- automatic_property_access: boolean to indicate if the user gets access to all the properties of the company. If this is false atleast one building id should be in the building_ids array
- name: Full Name of the user
- identifier: Optional Employee Id
Sample curl request is here
curl 'http://localhost:8000/organizations/management/dde0c713-4f70-419e-bc5c-ef5985e9aa0c/users' \
-H 'Accept: application/json' \
-H 'Accept-Language: en-US' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzEyMjY2Njg1LCJpYXQiOjE3MTE2NTYxMzYsImp0aSI6ImRkZTE2MTAzZDUxNDRiOGFiZTc3ZjliMzgwM2NmZDk2IiwidXNlcl9pZCI6IjYxYTM0MzUxLTI3NzYtNDFjMy04ZGVkLWEyNDJhOTZhY2UwMiJ9.LzHjxVuWDEQ5pHD7MscLMlxf9w-RGXrr1MK_tgY1MX0' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Origin: http://localhost:8080' \
-H 'Referer: http://localhost:8080/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-site' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{"userType":"pmo","account_id":"76f05d9f-9ee7-4737-b345-b52aabd0b623","organization_id":"dde0c713-4f70-419e-bc5c-ef5985e9aa0c","email":"apitestuser2@beifederation.com","first_name":"API2","last_name":"Test2","send_welcome_email":false,"job_function_id":"ba407f58-99ea-4291-9d2c-2522bbf6c4a9", "building_ids":["8244c57b-d81b-4ea6-a8b9-6cfe2eab3cfb"],"permission_group_ids":["7bde8ab8-7c24-4bed-b7d5-581df06587fa"],"name":"API2 Test2","mobile_phone":""}'
Change Permissions
The permission groups for the user can be updated with a PATCH call to /users/{id}.
Sample curl to patch the user
curl 'http://localhost:8000/users/c25ea6de-4b96-42bf-b8b0-c6a1bb5f2db2' \
-X 'PATCH' \
-H 'Accept: application/json' \
-H 'Accept-Language: en-US' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzEyMjYxMDMyLCJpYXQiOjE3MTE2NTYxMzYsImp0aSI6ImNhNTc4OGY4YjdlOTQwNzdhM2NmMWNlNmVkMWJiZjIzIiwidXNlcl9pZCI6IjYxYTM0MzUxLTI3NzYtNDFjMy04ZGVkLWEyNDJhOTZhY2UwMiJ9.PRiFSU7Fe2vo2XRjoyO5VFz-BBgeYeQRI9tsZmUlSaI' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Origin: http://localhost:8080' \
-H 'Referer: http://localhost:8080/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-site' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{"permission_group_ids":["7bde8ab8-7c24-4bed-b7d5-581df06587fa"]}'
Permission groups can be retrieved using a GET to /accounts/{account-id}/permission_groups?organization_type__in=pmo&user_id=a68126ef-d48a-4fe0-84e1-c9c9f55a09b3
organization_type values are pmo, vendor or tenant
Job Function can be retrieved using a GET to /job_functions?organization_type__in={organization_type}
FAQs
Filter Organizations for User
Users belong to many organizations in many buildings. In order to determine the list of organizations a user has access to in a specific building, use:
GET https://api.connect.buildingengines.com/organizations/search
The following are query parameters that can be used to help filter
organization_type__in=tenant,pmo,vendor
membership_user_id=<user_id>
building_scope=<building_id>
account_scope=<account_id>
membership_user_id - The User ID to filter for
building_scope - 1 or more building_ids