WayFy’s Users API handles everything from account creation and login to profile management and saved favorite places. Each user can store aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jhonyes04/new-wayfy/llms.txt
Use this file to discover all available pages before exploring further.
selected_mobility profile — an array of mobility preferences used to tailor accessibility results across the platform. Favorites let users bookmark accessible places discovered on the map and attach rich metadata for later use in trip planning.
All protected endpoints require a JWT bearer token obtained from
/api/users/login or /api/users/register. Include it as Authorization: Bearer <token> in the request header.Authentication
POST /api/users/register
Creates a new WayFy account and immediately returns a JWT token so users can begin exploring without a separate login step. All six fields are required —confirmPassword must match password, and selectedMobility must contain at least one option.
Authentication: None
Request
The user’s email address. Must be unique across all WayFy accounts.
Plain-text password. Must be at least 8 characters. Stored as a bcrypt hash — never logged or returned.
Must match
password exactly. The server rejects the request if they differ.User’s first name. Displayed in the app profile.
User’s last name.
At least one mobility preference string (e.g.
["wheelchair"]). The server rejects empty arrays.Response
Confirmation message.
Signed JWT for authenticating subsequent requests.
Token lifetime in seconds (e.g.
3600 for 1 hour).Example
POST /api/users/login
Authenticates an existing user with email and password, returning a fresh JWT token. Authentication: NoneRequest
The account’s registered email address.
The account’s password in plain text.
Response
Confirmation message.
Signed JWT for authenticating subsequent requests.
Token lifetime in seconds.
Example
User Profiles
GET /api/users/
Returns all user records. Admin only — non-admin requests receive403 Forbidden.
Authentication: Required (admin only)
Response
Total number of users returned.
Array of all user objects.
Example
GET /api/users/:user_id
Returns a single user record. Regular users may only fetch their own profile; admins may fetch any user. Authentication: RequiredResponse
Unique user ID.
Email address.
First name.
Last name.
Full avatar path, e.g.
/api/users/avatar/default_avatar.png.Saved mobility preference strings.
Account active status.
Admin flag.
Example
PUT /api/users/:user_id
Updates profile fields for a user. Regular users may only update their own account; admins can update any account. Returns a fresh JWT token alongside the updated user object. Authentication: RequiredRequest
Updated first name.
Updated last name.
New email address. Must remain unique across all accounts.
Replacement array of mobility preference strings (e.g.
["wheelchair", "low_floor"]). Overwrites the current value.New password. Must be at least 8 characters. Leave absent to keep the current password.
Response
Returns the full updated user object plus a refreshed token.Confirmation message.
New JWT reflecting updated profile claims.
Token lifetime in seconds.
Full updated user object.
Example
DELETE /api/users/:user_id
Permanently deletes a user account and all associated data. Regular users may only delete their own account; admins can delete any account except their own. Authentication: RequiredExample
Avatars
PUT /api/users/avatar
Uploads a new avatar image for the authenticated user. Send the file asmultipart/form-data using the field name file. Accepted formats: png, jpg, jpeg. Returns a refreshed JWT alongside the updated user object.
Authentication: Required
Request
Image file to use as the user’s avatar. Accepted formats:
png, jpg, jpeg. Sent as multipart/form-data.Response
Returns a refreshed token and the updated user object with the newavatar path.
Confirmation message.
New JWT with updated avatar claim.
Token lifetime in seconds.
Full updated user object including the new
avatar path.Example
GET /api/users/avatar/:filename
Serves an avatar image file by its stored filename. Use this URL as thesrc for avatar <img> elements in the WayFy frontend.
Authentication: Required
Example
Favorites
Favorites allow users to bookmark accessible places found on the WayFy map. Each favorite stores rich metadata — coordinates, OpenStreetMap identifiers, wheelchair status, and full OSM tags — making them immediately usable when building trip itineraries.GET /api/users/:user_id/favorites
Returns all saved favorite places for the specified user. Authentication: RequiredResponse
Number of favorites returned.
Example
POST /api/users/:user_id/favorites
Saves a new place to the user’s favorites. Theosm_id + user_id combination must be unique — attempting to re-save the same place returns an error.
Authentication: Required
Request
OpenStreetMap identifier for the place (e.g.
node/123456789).Human-readable name of the place.
Short location label (e.g.
Barcelona, Spain).Longitude coordinate.
Latitude coordinate.
Wheelchair accessibility value from OSM:
yes, limited, or no.OSM element type:
node, way, or relation.WayFy place category (e.g.
gastronomia, cultura_turismo).Full OSM tag set as a JSON object. Stored for rich detail display in WayFy.
Response
Returns201 Created with a wrapper object containing the new favorite.
Confirmation message.
The newly created favorite object (same shape as the GET response items).