CourtSniffer

CourtSniffer API Documentation

Base URL: https://www.courtsniffer.elkuncoding.com/api

Required header for all API endpoints: X-API-Key: YOUR_API_KEY

Authentication

All endpoints require X-API-Key. Use Sanctum bearer token for protected endpoints.

Method Endpoint Auth Description
POST/auth/registerAPI KeyRegister user and return token.
POST/auth/loginAPI KeyLogin and return token.
POST/auth/logoutAPI Key + BearerRevoke current token.

Courts

MethodEndpointAuthDescription
GET/courtsAPI KeyList/search courts. Query: search, type, active_only.
GET/courts/{court}API KeyGet single court by ID.

User Bookings

MethodEndpointAuthDescription
GET/bookingsAPI Key + BearerList current user bookings.
POST/bookingsAPI Key + BearerCreate booking with date + start/end time.
DELETE/bookings/{booking}API Key + BearerCancel own booking.

Admin

Requires API key and authenticated admin user.

MethodEndpointDescription
GET/POST/admin/courtsList/create courts.
GET/PATCH/DELETE/admin/courts/{court}View/update/delete court.
GET/admin/bookingsList all bookings (filters: status, date).
PATCH/admin/bookings/{booking}Update booking status.

Quick Examples

curl -X POST https://www.courtsniffer.elkuncoding.com/api/auth/login \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"user@courtsniffer.test","password":"password"}'
curl -X POST https://www.courtsniffer.elkuncoding.com/api/bookings \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"court_id":1,"booking_date":"2026-02-20","start_time":"09:00","end_time":"10:00"}'