The Errors & status codes page documents the canonical response shape and every code the API returns. This guide is the practical companion — how to handle them in code without writing the same boilerplate at every call site.Documentation Index
Fetch the complete documentation index at: https://docs.wiseyield.co/llms.txt
Use this file to discover all available pages before exploring further.
The minimum viable handler
error.code rather than parsing JSON ad-hoc.
Typed handling by status class
Validation errors — surfacing field messages
400 VALIDATION_ERROR returns per-field arrays of human-readable messages:
boundaries.coordinates).
Retry semantics by status
| Status | code | Retry? | How |
|---|---|---|---|
400 | VALIDATION_ERROR | No | Fix the payload |
400 | INVALID_ID | No | UUID is malformed |
401 | EXPIRED_API_KEY | No | Mint a fresh key |
401 | INVALID_API_KEY | No | Key was revoked |
403 | INSUFFICIENT_SCOPE | No | Rotate to a key with the required scope |
404 | NOT_FOUND | No | The resource doesn’t exist |
409 | CONFLICT | Maybe | Idempotent create — fetch the existing record |
429 | RATE_LIMIT_EXCEEDED | Yes | Wait until X-RateLimit-Reset — see Rate-limit handling |
5xx | any | Yes | Exponential backoff, max 3 attempts |
Idempotency on writes
Mutating endpoints accept an optionalIdempotency-Key header (UUID) so a retry after a network blip doesn’t create duplicate resources:
(user_id, idempotency_key) for 24 hours. Subsequent requests with the same key and a matching body return the cached response — different bodies for the same key return 409 CONFLICT.
Use idempotency keys for:
POSTcreates that you don’t want to double-execute on retry- Financial transactions (expenses, sales, payroll runs)
- Any state-changing call where retries are possible
Logging recommendations
Capture all five fields of an API error in your logs:code field is the most useful for grouping; the details field is the most useful for debugging individual incidents.
See also
- Errors & status codes — complete reference of every code
- Rate-limit handling — backoff implementations for 429
- Authentication — auth-specific error codes