What is the Users API?
Version 3 of Clara’s Users API lets you manage user accounts securely, with support for:- Role and location handling
- Advance filtering through query parameters
- User lifecycle operations support (onboarding, status tracking, updating, and deletion)
Authentication
To use the API:- Obtain your client certificate and credentials via the Clara platform.
- Request an access token via
POST /oauth/tokenwith yourclient_idandclient_secret. - Use the access token in the
Authorizationheader for all subsequent API requests.
Core Use Cases
1⃣ List Users
Retrieve a list of users with optional filters like status, role, or name.- **
GET /api/v3/users**- with filters for status, role, name. - Successful Response HTTP Status:
200 OK: List of users successfully returned - Query Parameters:
- Example Request:
- Example Response:
2⃣ Create User
POST /api/v3/users- add a new user to your organization.- Successful Response HTTP Status:
201 Created: User successfully created - Request Body Parameters:
- Example Request:
- Example Response:
3⃣ Retrieve a User by UUID
GET /api/v3/users/{uuid}- fetch details of a single user using their UUID- Successful Response HTTP Status:
200 OK: User successfully retrieved - Path Parameter:
- Example Request:
- Example Response:
4⃣ Update User
PATCH /api/v3/users/{uuid}- modify the details of an existing user.- Successful Response HTTP Status:
200 OK: User successfully updated - Path Parameter:
- Request Body Parameters:
- Example Request:
Group Management Fields
The following fields enhance how a user’s group memberships are updated:groupsToAdd: Adds the user to one or more groups. Must not duplicate existing memberships.groupsToRemove: Removes the user from specified groups. Must already be a member of those groups.cleanGroups: If true, removes all existing groups before adding new ones fromgroupsToAdd.
⚠️ WhencleanGroupsis true,groupsToAddmust include at least one group. The user must always remain in at least one group.
- Example Response:
5⃣ Delete User
DELETE /api/v3/users/{uuid}- delete a user using their UUID.- Successful Response HTTP Status:
204 No Content: User successfully deleted - Path Parameter:
- Example Request:
- Example Response:
User Lifecycle Status
ONBOARDING_CANDIDATE: User has been created but not fully onboarded.WAITING: User is awaiting some verification or action.DELETED: User account has been marked for deletion.ACTIVE: User is active and can use the system.LOCKED: User account is locked.INACTIVE: User is not currently active but may be reactivated.PENDING: User creation is pending.MASTER_LOCKED: User is locked at the highest permission level.CLARA_BLOCKED: User is blocked by the system administrator.
Lifecycle Flow
- Creation: A user is created via the
POST /api/v3/usersendpoint. Initially, they may be in a status such asONBOARDING_CANDIDATEorPENDING. - Activation: After onboarding steps are completed, the user transitions to
ACTIVE. - Usage: The user actively participates in the platform’s operations.
- Locking/Blocking: If needed, the user may be
LOCKED,MASTER_LOCKED, orCLARA_BLOCKEDdue to policy violations or security issues. - Deactivation: Users can be set to
INACTIVEif no longer participating but still retained in the system. - Deletion: Finally, the user can be marked as
DELETEDvia theDELETE /api/v3/users/{uuid}endpoint.
Endpoint Reference
GET /api/v3/users
List all users (v3)
Parameters:
Response Schema (
UserPageV3):
POST /api/v3/users
Create user (v3)
Request Body (CreateUserRequestV3):
GET /api/v3/users/{uuid}
Get user by UUID (v3)
Parameters:
Response Schema (
UserV3):
PATCH /api/v3/users/{uuid}
Update user (v3)
Parameters:
Request Body (
UpdateUserRequestV3):
