Errors

Every error returns the same JSON shape, with the matching HTTP status:

{ "error": "NOT_FOUND", "message": "Booking not found." }
  • error: a stable, machine-readable code. Branch on this.
  • message: a human-readable explanation. Show or log it; don't parse it.

Status codes

StatuserrorWhen
400BAD_REQUESTMissing or invalid input (e.g. memberId is required).
401UNAUTHORIZEDMissing or invalid API key. Send Authorization: Bearer vk_live_….
403FORBIDDENValid key, but the action isn't allowed for its organization.
429TOO_MANY_REQUESTSRate limit exceeded. Back off and retry.
404NOT_FOUNDThe resource doesn't exist in your active org.
409CONFLICTState conflict (e.g. duplicate booking, cancelling twice).
503SERVICE_UNAVAILABLEBackend not configured or database unreachable.

Behaviour worth knowing

  • Tenant isolation is a 404. An id that belongs to another gym looks like it
    simply doesn't exist: never rely on 403 vs 404 to probe for resources.
  • Validation failures are 400, with the message naming the offending field.
  • Retry 503 with backoff; it's transient. Don't retry 4xx without changing
    the request.

Did this page help you?