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 Accessibility API is the heart of the platform’s community-powered accessibility data. Each place on the map has at most one canonical AccessibilityReview record — holding wheelchair status, facility flags (ramps, elevators, accessible toilets, parking, automatic doors), and a free-text description. Community members can also upload photos (up to 5 per review) to give other travellers a realistic view of what to expect. The wheelchair-map endpoint provides a lightweight snapshot of all reviewed places, powering the WayFy map’s accessibility overlay.
Review creation and photo uploads require JWT authentication. All read endpoints are publicly accessible without a token.

Map Data

GET /api/accessibility/wheelchair-map

Returns a flat dictionary mapping every reviewed place’s osm_id to its wheelchair value. This lightweight endpoint is designed to be called on map load to colour-code accessibility status across thousands of pins in a single request. Authentication: None

Response

A flat JSON object where each key is an osm_id and the value is the wheelchair status string.
(osm_id)
string
Key is the place’s OSM identifier. Value is one of yes, limited, or no. Only places with a non-null wheelchair value are included.

Example

curl http://localhost:3001/api/accessibility/wheelchair-map
{
  "node/123456789": "yes",
  "way/987654321": "limited",
  "node/111222333": "no"
}

Reviews

GET /api/accessibility/:osm_id

Returns accessibility data for a single place. Each OSM place has at most one canonical review record (enforced by a unique constraint on osm_id). The response includes aggregated counts alongside the review array for backwards-compatible display. Authentication: None

Response

osm_id
string
The OpenStreetMap identifier for the place.
total_reviews
integer
Number of review records found (0 or 1, given the unique constraint).
wheelchair_consensus
string
The wheelchair value of the single review, or null if no review exists.
wheelchair_counts
object
reviews
array
Array containing the single review object, or empty if none exists.

Example

curl http://localhost:3001/api/accessibility/node%2F123456789
{
  "osm_id": "node/123456789",
  "total_reviews": 1,
  "wheelchair_consensus": "yes",
  "wheelchair_counts": {
    "yes": 1,
    "limited": 0,
    "no": 0
  },
  "reviews": [
    {
      "id": 5,
      "osm_id": "node/123456789",
      "osm_type": "node",
      "place_name": "Café Inclusivo",
      "wheelchair": "yes",
      "has_ramp": true,
      "has_elevator": false,
      "has_accessible_toilet": true,
      "has_accessible_parking": false,
      "automatic_door": true,
      "description": "Wide entrance with automatic doors and an accessible toilet near the back.",
      "last_modified_by_id": 42,
      "last_modified_by_name": "Ada Lovelace",
      "created_at": "2024-03-01T10:00:00Z",
      "updated_at": "2024-03-15T14:30:00Z",
      "photos": []
    }
  ]
}

GET /api/accessibility/:osm_id/review

Returns the single review record for a place by its osm_id. Returns 404 Not Found if no review exists yet. Authentication: None
Unlike GET /api/accessibility/:osm_id, this endpoint returns only the review record itself without aggregation stats. Use it when you need the raw review object for editing or display purposes.

Response

id
integer
Review record ID.
osm_id
string
OSM identifier.
osm_type
string
OSM element type.
place_name
string
Place name.
wheelchair
string
Wheelchair value: yes, limited, or no.
has_ramp
boolean
Ramp present.
has_elevator
boolean
Elevator available.
has_accessible_toilet
boolean
Accessible toilet available.
has_accessible_parking
boolean
Accessible parking available.
automatic_door
boolean
Automatic door present.
description
string
Free-text accessibility notes.
last_modified_by_id
integer
User ID of the last contributor.
last_modified_by_name
string
Full name of the last contributor, or null.
created_at
string
Creation timestamp.
updated_at
string
Last-updated timestamp.
photos
array
Array of photo objects attached to this review.

Example

curl http://localhost:3001/api/accessibility/node%2F123456789/review
{
  "id": 5,
  "osm_id": "node/123456789",
  "osm_type": "node",
  "place_name": "Café Inclusivo",
  "wheelchair": "yes",
  "has_ramp": true,
  "has_elevator": false,
  "has_accessible_toilet": true,
  "has_accessible_parking": false,
  "automatic_door": true,
  "description": "Wide entrance with automatic doors and an accessible toilet near the back.",
  "last_modified_by_id": 42,
  "last_modified_by_name": "Ada Lovelace",
  "created_at": "2024-03-01T10:00:00Z",
  "updated_at": "2024-03-15T14:30:00Z",
  "photos": []
}

POST /api/accessibility/:osm_id

Creates or updates (upserts) the accessibility review for a place. Each OSM place has at most one canonical review — submitting this endpoint either creates a new review or overwrites the existing one. The last_modified_by_id is always updated to the current user. Authentication: Required

Request

wheelchair
string
Wheelchair accessibility level. Must be one of yes, limited, or no.
has_ramp
boolean
true if the entrance has a ramp or ramped alternative.
has_elevator
boolean
true if an elevator is available within or at the entrance.
has_accessible_toilet
boolean
true if accessible toilet facilities (e.g. grab bars, turning space) are present.
has_accessible_parking
boolean
true if designated accessible parking spaces exist nearby.
automatic_door
boolean
true if the main entrance has an automatic or power-assisted door.
description
string
Free-text notes describing the accessibility situation — e.g. which entrance to use, surface type, or seasonal constraints.
place_name
string
Human-readable name of the place. Used if a review record is being created for the first time.
osm_type
string
OSM element type: node, way, or relation. Defaults to node on first creation.

Response

Returns 200 OK with the full review object after upsert.
id
integer
Review record ID.
osm_id
string
OSM identifier confirmed.
osm_type
string
OSM element type.
place_name
string
Place name.
wheelchair
string
Saved wheelchair value.
has_ramp
boolean
Ramp flag.
has_elevator
boolean
Elevator flag.
has_accessible_toilet
boolean
Accessible toilet flag.
has_accessible_parking
boolean
Accessible parking flag.
automatic_door
boolean
Automatic door flag.
description
string
Saved description.
last_modified_by_id
integer
User ID of the contributor.
last_modified_by_name
string
Full name of the contributor, or null.
created_at
string
Creation timestamp.
updated_at
string
Timestamp of the upsert.
photos
array
Array of photo objects attached to this review.

Example

curl -X POST http://localhost:3001/api/accessibility/node%2F123456789 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "wheelchair": "yes",
    "has_ramp": true,
    "has_elevator": false,
    "has_accessible_toilet": true,
    "has_accessible_parking": false,
    "automatic_door": true,
    "description": "Wide entrance with automatic doors and an accessible toilet near the back.",
    "place_name": "Café Inclusivo",
    "osm_type": "node"
  }'
{
  "id": 5,
  "osm_id": "node/123456789",
  "osm_type": "node",
  "place_name": "Café Inclusivo",
  "wheelchair": "yes",
  "has_ramp": true,
  "has_elevator": false,
  "has_accessible_toilet": true,
  "has_accessible_parking": false,
  "automatic_door": true,
  "description": "Wide entrance with automatic doors and an accessible toilet near the back.",
  "last_modified_by_id": 42,
  "last_modified_by_name": "Ada Lovelace",
  "created_at": "2024-03-01T10:00:00Z",
  "updated_at": "2024-04-12T09:45:00Z",
  "photos": []
}

Photos

POST /api/accessibility/:review_id/photos

Uploads one or more photos to an existing accessibility review. Photos help future visitors understand the physical environment — entrance layouts, ramp inclines, signage, and facilities. Up to 5 photos may be attached per review. Authentication: Required
Accepted formats are png, jpg, jpeg, and webp. Uploading photos that would push the total above 5 for a single review will return a 400 error. Send multiple files using the same photos field key.

Request

photos
file
required
One or more image files. Send as multipart/form-data using the field name photos. Accepted formats: png, jpg, jpeg, webp. You may include multiple photos fields in a single request to upload a batch.

Response

Returns 201 Created with an array of the newly created photo records directly (not wrapped).
(array item)
object

Example

curl -X POST http://localhost:3001/api/accessibility/5/photos \
  -H "Authorization: Bearer <token>" \
  -F "photos=@/path/to/entrance.jpg" \
  -F "photos=@/path/to/ramp.jpg"
[
  {
    "id": 20,
    "user_id": 42,
    "url": "/api/accessibility/photos/1712345678_42_0.jpg",
    "caption": "entrance.jpg",
    "created_at": "2024-04-12T10:00:00Z"
  },
  {
    "id": 21,
    "user_id": 42,
    "url": "/api/accessibility/photos/1712345679_42_1.jpg",
    "caption": "ramp.jpg",
    "created_at": "2024-04-12T10:00:01Z"
  }
]

DELETE /api/accessibility/photos/:photo_id

Deletes an accessibility photo. Only the user who uploaded the photo can delete it. Authentication: Required

Example

curl -X DELETE http://localhost:3001/api/accessibility/photos/20 \
  -H "Authorization: Bearer <token>"
{
  "msg": "Foto eliminada"
}

GET /api/accessibility/photos/:filename

Serves an accessibility photo file by its stored filename. No authentication required — suitable for embedding in public-facing review cards. Authentication: None

Example

curl http://localhost:3001/api/accessibility/photos/1712345678_42_0.jpg \
  --output entrance.jpg

Build docs developers (and LLMs) love