Skip to main content

Authentication

All user endpoints require authentication via Bearer token:
Authorization: Bearer <access_token>

List Users

curl -X GET "https://api.example.com/api/users?page=1&limit=20&search=john" \
  -H "Authorization: Bearer <access_token>"
page
number
default:"1"
Page number for pagination (minimum: 1)
limit
number
default:"20"
Number of results per page (minimum: 1, maximum: 100)
Search term to filter users by name or email

Response

success
boolean
Indicates if the request was successful
data
array
Array of user objects
pagination
object
Pagination metadata
{
  "success": true,
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "email": "[email protected]",
      "fullName": "John Doe",
      "phone": "+1234567890",
      "avatar": "https://example.com/avatars/john.jpg",
      "emailVerified": true,
      "lastLoginAt": "2024-03-04T10:30:00Z",
      "isDisabled": false,
      "createdAt": "2024-01-15T08:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 45,
    "totalPages": 3
  }
}

Get User by ID

curl -X GET "https://api.example.com/api/users/{id}" \
  -H "Authorization: Bearer <access_token>"
id
string
required
User’s unique identifier (UUID)

Response

success
boolean
Indicates if the request was successful
data
object
User object with detailed information including memberships
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "[email protected]",
    "fullName": "John Doe",
    "phone": "+1234567890",
    "avatar": "https://example.com/avatars/john.jpg",
    "emailVerified": true,
    "emailVerifiedAt": "2024-01-15T09:00:00Z",
    "lastLoginAt": "2024-03-04T10:30:00Z",
    "isDisabled": false,
    "createdAt": "2024-01-15T08:00:00Z",
    "updatedAt": "2024-03-04T10:30:00Z"
  }
}

Update User

curl -X PATCH "https://api.example.com/api/users/{id}" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "fullName": "John Smith",
    "phone": "+1234567890",
    "avatar": "https://example.com/avatars/john-new.jpg"
  }'
id
string
required
User’s unique identifier (UUID)

Request Body

fullName
string
User’s full name (min: 2, max: 255 characters)
phone
string
User’s phone number (max: 20 characters). Set to null to remove.
avatar
string
URL to user’s avatar image (max: 500 characters). Set to null to remove.

Response

success
boolean
Indicates if the request was successful
data
object
Updated user object
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "[email protected]",
    "fullName": "John Smith",
    "phone": "+1234567890",
    "avatar": "https://example.com/avatars/john-new.jpg",
    "emailVerified": true,
    "isDisabled": false,
    "createdAt": "2024-01-15T08:00:00Z",
    "updatedAt": "2024-03-04T11:00:00Z"
  }
}

Change Password

curl -X PATCH "https://api.example.com/api/users/{id}/password" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "currentPassword": "OldPassword123!",
    "newPassword": "NewSecurePassword456!"
  }'
id
string
required
User’s unique identifier (UUID)

Request Body

currentPassword
string
required
User’s current password for verification
newPassword
string
required
New password (min: 8, max: 100 characters)

Response

success
boolean
Indicates if the request was successful
message
string
Confirmation message
{
  "success": true,
  "message": "Password changed successfully"
}

Disable User

curl -X DELETE "https://api.example.com/api/users/{id}" \
  -H "Authorization: Bearer <access_token>"
id
string
required
User’s unique identifier (UUID)

Response

success
boolean
Indicates if the request was successful
message
string
Confirmation message
{
  "success": true,
  "message": "User disabled successfully"
}
Disabling a user sets the isDisabled flag to true and blocks all access. This is a global kill-switch that prevents the user from accessing any companies.

Build docs developers (and LLMs) love