Error envelope
Every error response has the same shape:code field for machine-readable routing:
HTTP status codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Resource created |
204 | Success, no body (e.g. mark-read) |
400 | Validation failed — check the error field |
401 | Missing or invalid Bearer token |
403 | Forbidden — KYC limit, wrong role, self-escrow, etc. |
404 | Resource not found or not accessible by this user |
409 | Conflict — duplicate (e.g. phone already registered) |
422 | Business rule violation — invalid state transition |
429 | Rate limit exceeded (OTP endpoints) |
500 | Internal server error |
Common error codes
code | Endpoint | Meaning |
|---|---|---|
KYC_LIMIT_EXCEEDED | escrow-create, wallet-withdraw | Transaction exceeds user’s KYC tier limit |
INVALID_OTP | auth-verify, auth-reset-password | OTP is wrong or expired |
PHONE_EXISTS | auth-signup | Phone number already registered |
INVALID_STATE | Most escrow/dispute/milestone endpoints | Entity is not in the required state for this operation |
NOT_PARTICIPANT | message-send, message-feed | User is not a participant in the conversation |