Base: https://api.sajilosport.com/api

Error Reference

All API errors follow a consistent JSON shape. This page lists every HTTP status code the app can return and what causes it.


Standard Error Shape

{
  "message": "Human-readable explanation."
}

Validation errors (422) include a field-level errors map:

{
  "message": "The given data was invalid.",
  "errors": {
    "email": ["The email field is required."],
    "password": ["The password must be at least 8 characters."]
  }
}

HTTP Status Code Reference

CodeNameCommon Causes
200OKSuccessful GET / PATCH / DELETE
201CreatedSuccessful POST that created a resource
400Bad RequestInvalid signed URL (email verify)
401UnauthorizedMissing or invalid Authorization: Bearer header
403ForbiddenValid token but wrong role, or account banned / inactive
404Not FoundResource does not exist (or is soft-deleted)
409ConflictSlot already taken (indoor game / court booking)
422Unprocessable EntityValidation failure — see errors map
429Too Many RequestsRate limit hit (auth / OTP endpoints)
500Internal Server ErrorUnexpected server-side error

Domain-Specific Errors

Auth

ScenarioStatusmessage
Wrong password / inactive account403"Invalid credentials."
OTP expired or invalid422"Invalid or expired OTP."
Unsupported social provider422"Unsupported social provider."

Bookings

ScenarioStatusmessage
Court not available for requested slot409"The court is not available for the selected time slot."
Cancel a non-cancellable booking403policy-based message

Indoor Games

ScenarioStatusmessage
Slot unavailable409"The selected slot is not available."
Game inactive404—

Payments

ScenarioStatusmessage
Gateway callback verification fail422"Payment verification failed."

Coupons

ScenarioStatusmessage
Invalid / expired code422message from server

Tips for Mobile Devs

  • Always display message to the user when status >= 400.
  • For 422, iterate errors and show field-level hints inline on the form.
  • For 429, back off and show "Too many attempts, please wait."
  • For 401, clear local token and redirect to login.
  • For 409 on bookings, reload availability calendar and highlight taken slots.