YourNextHome

Errors

What our API returns when things go wrong, and what to do about it.

The YourNextHome API returns conventional HTTP status codes. The body of an error response is a JSON object with statusCode, message, and error fields.

{
  "statusCode": 404,
  "message": "Estate not found",
  "error": "Not Found"
}

Status codes you should handle

CodeMeaningWhat to do
400Bad RequestFix the request — the body or query params are malformed. Don't retry.
401UnauthorizedMissing or invalid API key. Check the Authorization header.
403ForbiddenAuthenticated but not allowed. The key belongs to a different org or scope.
404Not FoundThe resource doesn't exist (or your key can't see it). Don't retry.
409ConflictThe request collides with current state (e.g. duplicate name).
422Unprocessable EntityValidation failed. The message field lists the offending fields.
429Too Many RequestsYou're being rate limited. See Rate limits.
5xxServer ErrorOur problem. Retry with exponential backoff; if it persists, contact us.

Idempotency

Endpoints that create resources accept an Idempotency-Key header. Pass a unique key per logical operation (e.g. a UUID generated by your client) so safely retrying after network errors does not produce duplicate records.

curl https://api.yournexthome.app/api/v1/estates \
  -H "Authorization: Bearer $YNH_API_KEY" \
  -H "Idempotency-Key: 8e1f0c7e-c2c2-4e3f-9a8a-37e0c5a0a3a2" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Maple Heights" }'

On this page