Overview
Once the customers are mapped out as entities, the next step is to start mapping out their employees to the corresponding entity users in the Monite platform.Learn more about entities, entity users, and the Monite account structure.
Create a user role
Every entity user must have a role. A role defines the permissions that a user has to access and update the entity’s resources in Monite. Roles are created by callingPOST /roles. The partner-level token and the entity ID are required for this action.
In the example below, a new role is created to allow read access to the comment and payable objects:
GET /roles/{role_id}.
Create an entity user
To create an entity user, callPOST /entity_users. Specify the entity ID in the X-Monite-Entity-Id request header and the user data in the request body. The role_id field must be populated by the ID of the role created earlier. The request must be authorized using a partner-level access token:
List all entity users
To get information about all the entity users managed by the entity, callGET /entity_users.
Retrieve an entity user
To get information about a specific entity user, callGET /entity_users/{entity_user_id}.
Edit an entity user
To edit an existing entity user, callPATCH /entity_users/{entity_user_id}.
Delete an entity user
To delete an existing entity user, callDELETE /entity_users/{entity_user_id}.
Get an entity user token
To make API calls on behalf of an entity user, you need to use an access token of that user. To get this token, callPOST /auth/token with the following request body:
Authorization: Bearer TOKEN request header as an alternative to using a partner-level token.
Get and update the authenticated user info
The authenticated entity user can check all its own information by callingGET /entity_users/me. The request must be authorized using an entity user level-access token:
PATCH /entity_users/me, passing the information they wish to update. In the example below, the last_name field is being updated. The request must be authorized using an entity user level-access token:
Get the role of the authenticated entity user
To retrieve information about the role and permissions assigned to the authenticated entity user, callGET /entity_users/my_role: