Skip to main content

Documentation 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.

WayFy’s Places API manages community-contributed map pins — user-submitted locations that complement the OpenStreetMap dataset. Any authenticated user can submit a new place, which enters a pending state until approved by a WayFy administrator. Approved places are returned in bounding-box queries and appear on the public map. This moderation workflow ensures data quality while keeping the community actively involved in expanding WayFy’s accessible place coverage.
Newly submitted places always start in pending status and are not visible in public map queries until an admin approves them via the PATCH /api/places/:place_id/status endpoint.

Places

POST /api/places/

Submits a new community place pin to the WayFy map. The place is created with status: "pending" and will not appear in public bounding-box queries until approved by an admin. If a place already exists within approximately 30 metres of the submitted coordinates, the existing place is returned with 200 OK instead of creating a duplicate. Authentication: Required

Request

name
string
required
The name of the place (e.g. "Parque Accesible Central").
longitude
number
required
Longitude coordinate of the place.
latitude
number
required
Latitude coordinate of the place.
sub_type
string
WayFy place category. Valid values: alojamiento, gastronomia, transporte, salud, cultura_turismo, recreacion, deporte, gobierno, baños, dinero, tiendas.
place_label
string
Short human-readable location label (e.g. "Buenos Aires, Argentina").

Response

Returns 201 Created with a wrapper containing the new pending place record. Returns 200 OK with the existing place if a nearby place already exists.
msg
string
Confirmation message.
place
object

Example

curl -X POST http://localhost:3001/api/places/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Parque Accesible Central",
    "longitude": -58.38159,
    "latitude": -34.60373,
    "sub_type": "recreacion",
    "place_label": "Buenos Aires, Argentina"
  }'
{
  "msg": "Lugar enviado para revisión",
  "place": {
    "id": 88,
    "name": "Parque Accesible Central",
    "longitude": -58.38159,
    "latitude": -34.60373,
    "sub_type": "recreacion",
    "place_label": "Buenos Aires, Argentina",
    "created_by": 42,
    "status": "pending",
    "created_at": "2024-04-14T11:00:00Z"
  }
}

GET /api/places/

Returns all approved community places within a geographic bounding box. Designed for map viewport queries — pass the current map bounds to retrieve visible community pins. Authentication: None
Query this endpoint whenever the user pans or zooms the map to keep community pins in sync with the current viewport. Only approved places are returned — pending and rejected submissions are excluded.

Request

south
number
required
Southern latitude bound of the bounding box.
west
number
required
Western longitude bound of the bounding box.
north
number
required
Northern latitude bound of the bounding box.
east
number
required
Eastern longitude bound of the bounding box.

Response

total
integer
Number of approved places returned.
places
array
Array of approved place objects within the requested bounding box.

Example

curl "http://localhost:3001/api/places/?south=-34.65&west=-58.45&north=-34.55&east=-58.30"
{
  "total": 1,
  "places": [
    {
      "id": 88,
      "name": "Parque Accesible Central",
      "longitude": -58.38159,
      "latitude": -34.60373,
      "sub_type": "recreacion",
      "place_label": "Buenos Aires, Argentina",
      "created_by": 42,
      "status": "approved",
      "created_at": "2024-04-14T11:00:00Z"
    }
  ]
}

GET /api/places/pending

Returns all pending place submissions platform-wide. Admin only — non-admin requests receive 403 Forbidden. Authentication: Required (admin only)
Use GET /api/places/mine/pending for non-admin users who want to track the status of their own submissions.

Response

total
integer
Number of pending places returned.
places
array
Array of all pending place objects, ordered by submission date ascending.

Example

curl http://localhost:3001/api/places/pending \
  -H "Authorization: Bearer <admin-token>"
{
  "total": 1,
  "places": [
    {
      "id": 88,
      "name": "Parque Accesible Central",
      "longitude": -58.38159,
      "latitude": -34.60373,
      "sub_type": "recreacion",
      "place_label": "Buenos Aires, Argentina",
      "created_by": 42,
      "status": "pending",
      "created_at": "2024-04-14T11:00:00Z"
    }
  ]
}

GET /api/places/mine/pending

Returns only the authenticated user’s own pending place submissions. A convenience endpoint for the “My Contributions” section of the WayFy profile. Authentication: Required

Response

total
integer
Number of pending places returned.
places
array
Array of the current user’s pending place submissions.

Example

curl http://localhost:3001/api/places/mine/pending \
  -H "Authorization: Bearer <token>"
{
  "total": 1,
  "places": [
    {
      "id": 88,
      "name": "Parque Accesible Central",
      "longitude": -58.38159,
      "latitude": -34.60373,
      "sub_type": "recreacion",
      "place_label": "Buenos Aires, Argentina",
      "created_by": 42,
      "status": "pending",
      "created_at": "2024-04-14T11:00:00Z"
    }
  ]
}

PATCH /api/places/:place_id/status

Updates the moderation status of a community place. Only admin accounts can call this endpoint. Authentication: Required (admin only)
Only users with is_admin: true can call this endpoint. Non-admin requests return 403 Forbidden.

Request

status
string
required
The new status for the place. Must be approved or rejected.

Response

Returns the full updated place object wrapped with a confirmation message.
msg
string
Confirmation message (e.g. "Lugar approved").
place
object
The full updated place object.

Example

curl -X PATCH http://localhost:3001/api/places/88/status \
  -H "Authorization: Bearer <admin-token>" \
  -H "Content-Type: application/json" \
  -d '{"status": "approved"}'
{
  "msg": "Lugar approved",
  "place": {
    "id": 88,
    "name": "Parque Accesible Central",
    "longitude": -58.38159,
    "latitude": -34.60373,
    "sub_type": "recreacion",
    "place_label": "Buenos Aires, Argentina",
    "created_by": 42,
    "status": "approved",
    "created_at": "2024-04-14T11:00:00Z"
  }
}

Build docs developers (and LLMs) love