Skip to Content
HomeLink Hub

Conventions and Errors

The error envelope, status codes, validation messages, pagination and the inconsistencies worth knowing about.

Error envelope

Every error that goes through the server's error handler has this shape:

{
  "status": 404,
  "success": false,
  "message": "Property not found",
  "data": null
}

Two optional fields appear on some errors:

FieldWhen
codeA machine-readable code, for errors a client is expected to branch on
errorDataExtra details, for example retryAfter (seconds) when resending an escrow OTP too soon, or the details of a duplicate listing

Status codes

StatusMeaning here
200Success
201Created
302Redirect (Google Calendar callback only)
400Validation failed, or the request breaks a business rule
401Missing, expired or invalid token
403Wrong role, not the owner of the record, or a gate such as KYC not met
404The record does not exist, or is not visible to the caller
409Conflict: already exists, already paid out, already resolved
429Too many requests (escrow OTP resend only)
500Unexpected error, and also some client mistakes, see below
502The payment provider rejected the request (withdrawals)

Validation errors

Routes with a validator reject bad input before the handler runs. The message joins every failed rule with "; ":

{
  "status": 400,
  "success": false,
  "message": "\"email\" must be a valid email; \"password\" is required",
  "data": null
}

Most validators reject unknown fields as well. Each endpoint page shows which fields are validated.

Pagination

List endpoints take page (from 1) and limit query parameters. Most default to page=1 and limit=20; a few use 10 or 50, as shown on their pages. The response carries the list and a pagination object inside data:

{
  "status": 200,
  "success": true,
  "message": "Listed properties retrieved successfully",
  "data": {
    "properties": [],
    "pagination": { "page": 1, "limit": 20, "total": 57, "pages": 3 }
  }
}

The list's key differs per endpoint (properties, users, payouts, ...). Chat messages page with offset and limit instead, and return the oldest messages first.

Known inconsistencies

These are behaviours of the current code. Clients have to cope with them until they change.

Some client mistakes return 500

A malformed ObjectId in a path, an expired or malformed email-verification or refresh token, a password sign-in to a Google or Apple account, and several payment-provider rejections answer with 500 instead of 400 or 401. Show the message and treat the request as failed.

AreaBehaviour
EnvelopeChat endpoints return success and data without status or message. Wishlist endpoints leave out status.
Escrow passthroughsGET /escrow and GET /escrow/{escrowId} forward Pandascrow's answer, so success: false can arrive with HTTP 200.
Payment verificationGET /transaction/inspection/verify/{reference} answers 200 even when the payment failed. Read data.status.
StubsThe three /review/* routes are unfinished and return only message. Use the review endpoints under /property instead.
Parameter mismatchGET /wishlist/check/{propertyId} reads the id from ?propertyId=, not from the path.
Status checksConfirming, cancelling and reviewing bookings and inspections do not check the current status, so they can be repeated.

Access control to be aware of

Some endpoints are more open than their purpose suggests. The endpoint pages flag each one; in summary:

  • GET /property/{id} is public, returns contact details of the people involved and also returns drafts.
  • There is no rate limiting on any endpoint, including the 4-digit code endpoints.

On this page