๐Ÿ‘ฅ Users API: How to Use It

The Users API (v2) in Clara allows you to list, create, and retrieve user profiles in your organization. These users can later be assigned cards, policies, roles, and other permissions across the platform.

๐Ÿ” What is the Users API?

The Users API (v2) allows you to programmatically manage users within your Clara organization. You can create users, list all users, and retrieve detailed information about any user by UUID.

This API is commonly used to:

  • Onboard new employees into the platform
  • Synchronize users from an external HR system
  • Manage user metadata such as job title, department, or phone number
  • Prepare users to receive cards, assign roles, or link them to approval workflows

๐Ÿ“Œ Available Endpoints

OperationEndpointMethod
Retrieve all users/v2/usersGET
Create a new user/v2/usersPOST
Get user by UUID/v2/users/{uuid}GET

1๏ธโƒฃ Retrieve All Users

Fetch a complete list of users registered in your organization.

๐Ÿ”— Endpoint

GET /v2/users

๐Ÿ“ค cURL Request

curl -X GET \
"https://public-api.mx.clara.com/api/v2/users" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

๐Ÿ“ฅ Sample JSON Response

[
  {
    "uuid": "3b3123e7-d7b4-4c92-a3b6-57e9f7aafadb",
    "email": "[email protected]",
    "fullName": "John Doe",
    "status": "ACTIVE",
    "role": "EMPLOYEE"
  }
]

2๏ธโƒฃ Retrieve All Users

Register a new user with name, email, and optional details like job title, phone number, or department. The new user can later be assigned roles and permissions.

๐Ÿ”— Endpoint

POST /v2/users

๐Ÿ“ค cURL Request

curl -X POST \
"https://public-api.mx.clara.com/api/v2/users" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "fullName": "Jane Smith",
  "email": "[email protected]",
  "phoneNumber": "+5215512345678",
  "jobTitle": "Operations Manager",
  "department": "Operations"
}'

๐Ÿ“ฅ Sample JSON Response

{
  "uuid": "9d8122e5-4173-497a-9015-f4f2d9482c1a",
  "email": "[email protected]",
  "fullName": "Jane Smith",
  "status": "PENDING_INVITATION"
}

3๏ธโƒฃ Retrieve All Users

Fetch detailed information about a specific user using their UUID.

๐Ÿ”— Endpoint

GET /v2/users/{uuid}

๐Ÿ“ค cURL Request

curl -X GET \
"https://public-api.mx.clara.com/api/v2/users/9d8122e5-4173-497a-9015-f4f2d9482c1a" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

๐Ÿ“ฅ Sample JSON Response

{
  "uuid": "9d8122e5-4173-497a-9015-f4f2d9482c1a",
  "email": "[email protected]",
  "fullName": "Jane Smith",
  "status": "ACTIVE",
  "jobTitle": "Operations Manager",
  "department": "Operations",
  "createdAt": "2024-06-15T12:45:00Z"
}

๐Ÿ’ก Tip: After creating a user, you can assign roles and issue cards programmatically using the Roles and Cards APIs.

โš ๏ธ Note: Users with PENDING_INVITATION status must complete onboarding via the invitation email before accessing Clara's platform.