User Management Service
API Contract
REST
/api/v1/users
6 endpoints
GET
/api/v1/users/api/v1/users
List users in org with optional filters
Public
Response Example
{
"data": [
{
"user_id": "usr_hA3mXp",
"org_id": "org_kNr8aQ",
"full_name": "Astrid Haugen",
"email": "astrid.haugen@company.no",
"role": "mentor",
"status": "active",
"created_at": "2025-09-14T10:22:00Z"
},
{
"user_id": "usr_bQ9vTk",
"org_id": "org_kNr8aQ",
"full_name": "Lars Eriksen",
"email": "lars.eriksen@company.no",
"role": "mentee",
"status": "active",
"created_at": "2025-11-03T14:05:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 184
}
}
GET
/api/v1/users/api/v1/users/:id
Get a single user by ID
Public
Response Example
{
"data": {
"user_id": "usr_hA3mXp",
"org_id": "org_kNr8aQ",
"full_name": "Astrid Haugen",
"email": "astrid.haugen@company.no",
"role": "mentor",
"status": "active",
"phone": "+47 912 34 567",
"created_at": "2025-09-14T10:22:00Z",
"updated_at": "2026-01-20T09:00:00Z"
}
}
POST
/api/v1/users/api/v1/users
Create a new user in the org
Public
Request Example
{
"org_id": "org_kNr8aQ",
"full_name": "Maja Lindqvist",
"email": "maja.lindqvist@company.no",
"role": "mentor",
"phone": "+47 922 11 334"
}
Response Example
{
"data": {
"user_id": "usr_cP2wEr",
"org_id": "org_kNr8aQ",
"full_name": "Maja Lindqvist",
"email": "maja.lindqvist@company.no",
"role": "mentor",
"phone": "+47 922 11 334",
"status": "active",
"created_at": "2026-03-26T11:30:00Z"
}
}
PUT
/api/v1/users/api/v1/users/:id
Update user profile fields
Public
Request Example
{
"full_name": "Maja L. Lindqvist",
"phone": "+47 922 11 000"
}
Response Example
{
"data": {
"user_id": "usr_cP2wEr",
"org_id": "org_kNr8aQ",
"full_name": "Maja L. Lindqvist",
"email": "maja.lindqvist@company.no",
"role": "mentor",
"phone": "+47 922 11 000",
"status": "active",
"updated_at": "2026-03-26T12:00:00Z"
}
}
DELETE
/api/v1/users/api/v1/users/:id
Deactivate a user (soft delete)
Public
Response Example
{
"data": {
"user_id": "usr_cP2wEr",
"status": "deactivated",
"deactivated_at": "2026-03-26T12:15:00Z"
}
}
PUT
/api/v1/users/api/v1/users/:id/role
Assign a role to a user
Public
Request Example
{
"role": "org_admin"
}
Response Example
{
"data": {
"user_id": "usr_hA3mXp",
"role": "org_admin",
"updated_at": "2026-03-26T12:20:00Z"
}
}