Skip to Content
API v1EndpointsRoomie Endpoints

Roomie Endpoints

Roomie is the flatmate/roommate matching feature. All endpoints live in the api/roomie/ directory. Auth is via JWT in the Authorization header.

Get Profiles

File: api/roomie/getProfiles.php Method: GET Auth: Required JWT (Authorization header)

ParamTypeDescription
limitquery stringMax profiles to return

Returns potential roomie matches based on the user’s profile preferences. Matching logic:

  1. Gets the user’s roomie profile (role, preferences)
  2. Looks for profiles with the opposite role (if user is “looking for room” = role 0, shows “has room” = role 1, and vice versa)
  3. Filters to same city (unless demo environment)
  4. Excludes blocked users (both directions)
  5. Calculates match_score based on:
    • Gender match (user’s preferred_gender vs candidate’s gender)
    • Personality match
    • Study year match
    • Smoker preference match
  6. Orders by match_score descending
  7. Returns profile data with user name, gender, and calculated age

Get Profile

File: api/roomie/getProfile.php Method: GET Auth: Required JWT

Returns the authenticated user’s own roomie profile.

Get User Profile

File: api/roomie/getUserProfile.php Method: GET Auth: Required JWT

Returns a specific user’s roomie profile (for viewing another user’s profile).

Get Profile Complete

File: api/roomie/getProfileComplete.php Method: GET Auth: Required JWT

Checks if the user’s roomie profile is complete.

Create Profile

File: api/roomie/createProfile.php Method: POST Auth: Required JWT

Creates a new roomie profile with role, personality, study year, smoker status, and preferences.

Update Profile

File: api/roomie/updateProfile.php Method: POST Auth: Required JWT

Updates an existing roomie profile.

Remove Profile

File: api/roomie/removeProfile.php Method: POST Auth: Required JWT

Deactivates/removes the user’s roomie profile.

Request to Join

File: api/roomie/requestToJoin.php Method: POST Auth: Required JWT

Sends a request to join another user’s room/group.

House Request Response

File: api/roomie/houseRequestResponse.php Method: POST Auth: Required JWT

Responds to a join request (accept/decline).

Message Request

File: api/roomie/messageRequest.php Method: POST Auth: Required JWT

Sends a message along with a roomie request.

Send Message

File: api/roomie/sendMessage.php Method: POST Auth: Required JWT

Sends a message in a roomie chat.

Get Chat

File: api/roomie/getChat.php Method: GET Auth: Required JWT

Returns chat messages for a roomie conversation.

Get User Chat Rooms

File: api/roomie/getUserChatRooms.php Method: GET Auth: Required JWT

Returns the user’s roomie chat rooms.

Set Room Status

File: api/roomie/setRoomStatus.php Method: POST Auth: Required JWT

Updates the status of a roomie chat room.

Leave Group

File: api/roomie/leaveGroup.php Method: POST Auth: Required JWT

Leaves a roomie group.

Block User

File: api/roomie/blockUser.php Method: POST Auth: Required JWT

Blocks a user from roomie matching and chat. Creates records in roomie_blocked_users table (bidirectional blocking).

Still Looking Response

File: api/roomie/stillLookingResponse.php Method: POST Auth: Required JWT

Responds to a “still looking?” prompt.

Helper Files

Directory: api/roomie/helpers/

  • checkRoomieDisabled.php - Checks if roomie is disabled for a user (used in login/user endpoints)
Last updated on