Base URL
The API is accessible at the following base URL:/api/.
Endpoint Categories
The Los Inmaduros Backend API is organized into the following categories:Routes
Manage predefined skating routes in Madrid. Public endpoints for browsing available routes with details like distance, difficulty level, and user ratings.GET /api/routes- Get all routesGET /api/routes/:slug- Get route details by slug
Route Calls
Create and manage skating event calls. Authenticated users can organize events, while anyone can view upcoming or past route calls.POST /api/route-calls- Create a new route call (requires auth)GET /api/route-calls- Get all route calls with filtersGET /api/route-calls/:id- Get route call by IDPUT /api/route-calls/:id- Update route call (organizer only)PATCH /api/route-calls/:id/cancel- Cancel route call (organizer/admin)DELETE /api/route-calls/:id- Delete route call (organizer/admin)
Attendances
Track user participation in route calls. Authenticated users can confirm or cancel their attendance.GET /api/attendances/my-attendances- Get user’s confirmed attendances (requires auth)POST /api/route-calls/:routeCallId/attendances- Confirm attendance (requires auth)DELETE /api/route-calls/:routeCallId/attendances/:attendanceId- Cancel attendance (requires auth)
Reviews
User reviews and ratings for routes. Authenticated users can create, update, and delete their own reviews.GET /api/routes/:routeId/reviews- Get reviews for a routePOST /api/routes/:routeId/reviews- Create a review (requires auth)GET /api/reviews/my-reviews- Get user’s reviews (requires auth)PUT /api/reviews/:reviewId- Update review (owner only)DELETE /api/reviews/:reviewId- Delete review (owner/admin)
Favorites
Manage user’s favorite routes. All endpoints require authentication.GET /api/favorites- Get user’s favorite routes (requires auth)GET /api/favorites/check/:routeId- Check if route is favorited (requires auth)POST /api/routes/:routeId/favorites- Add route to favorites (requires auth)DELETE /api/routes/:routeId/favorites/:favoriteId- Remove from favorites (requires auth)
Photos
Upload and manage photos for routes and route calls. Includes moderation workflow for admin approval.POST /api/photos- Upload photo (requires auth)GET /api/photos- Get public photos with filtersGET /api/photos/my-photos- Get user’s photos (requires auth)GET /api/photos/pending-review- Get pending photos (admin only)PATCH /api/photos/:id/approve- Approve photo (admin only)PATCH /api/photos/:id/reject- Reject photo (admin only)DELETE /api/photos/:id- Delete photo (owner/admin)GET /api/routes/:slug/gallery- Get route galleryGET /api/route-calls/:id/gallery- Get route call galleryPATCH /api/route-calls/:id/cover-photo- Update cover photo (organizer only)
Standard Response Format
All API responses follow a consistent format:Success Response
Error Response
Paginated Response
Endpoints that support pagination include additional pagination metadata:Example Request/Response
Here’s a complete example of fetching all routes: Request:Interactive Documentation
For interactive API documentation with the ability to test endpoints directly, visit the Swagger UI:Rate Limiting
The API implements rate limiting to ensure fair usage:- General endpoints: Applied to all
/api/*routes - Auth endpoints: Stricter limits on
/api/auth/*routes - Creation endpoints: Additional limits on POST operations for route calls and photo uploads
CORS Configuration
The API allows cross-origin requests from the frontend application with the following methods:- GET
- POST
- PUT
- PATCH
- DELETE
Content-Type, Authorization
