Admin

Update user and profile fields (admin only)

Changed on
patch/api/admin/users/{id}

Request

  • Base URL
    https://api.rewritelifestyle.ai (the document declares no server; this is the origin it was published from)
  • URL
    https://api.rewritelifestyle.ai/api/admin/users/{id}
  • Auth
    HTTP bearer

Path parameters

idnumber required

Request body

emailstring
role'client' | 'coach' | 'lead' | 'member' | 'pc'
is_adminboolean
is_super_adminboolean
can_view_dashboard_betaboolean
is_activeboolean
is_enrolledboolean
is_bnplboolean
can_handle_leadsboolean
reward_pool_memberboolean
is_internalboolean
email_verifiedboolean
phone_verifiedboolean
is_founderboolean

Toggling true claims a founder slot (sets users.is_founder + increments counter); toggling false releases it. Idempotent.

timezonestring
water_goal_oznumber
first_namestring
last_namestring
phonestring
citystring
statestring
countrystring

ISO 3166-1 alpha-2 country code

postal_codestring
birth_datestring
occupationstring
activity_levelstring
surgery_typestring
surgery_datestring
starting_weightnumber
goal_weightnumber
program_status'pending' | 'active' | 'completed' | 'dropped'

Example request

{
  "email": "user@example.com",
  "role": "client",
  "is_active": true,
  "is_enrolled": true,
  "email_verified": true,
  "phone_verified": true,
  "timezone": "America/New_York",
  "water_goal_oz": 64,
  "first_name": "Jane",
  "last_name": "Doe",
  "phone": "+1-555-000-0000",
  "city": "Austin",
  "state": "TX",
  "country": "US",
  "postal_code": "78701",
  "birth_date": "1985-06-15",
  "occupation": "Teacher",
  "activity_level": "moderate",
  "surgery_type": "gastric_sleeve",
  "surgery_date": "2022-03-10",
  "starting_weight": 280.5,
  "goal_weight": 160,
  "program_status": "active"
}

Response

unknown required

Example response

{
  "success": true,
  "message": "User updated successfully"
}

Changes