api.kash.bot follows RFC 7807 Problem Details with Content-Type: application/problem+json.
Wire shape
How to handle errors
Branch oncode, not on status or message text. Status codes are coarse (a 400 could mean any of a dozen specific failures); code is the unambiguous identifier.
KashRateLimitError, KashAuthorizationError, etc.) so you can catch by error type as well.
Status code conventions
Error code catalog
Everycode has a stable per-page documentation entry at https://docs.kash.bot/developer-docs/api-errors/<CODE> — see the Error catalogue for the full index. The type field on every error is exactly that URL — copy-paste it into a browser to read the page, or fetch it programmatically.
The CLI ships an offline copy of the full catalog. kash explain <CODE> works without a network round-trip:
The full list lives at the Error catalogue. The CLI’s offline copy and these docs pages are both generated from the same source-of-truth markdown at release time, so they stay in sync.
What’s NOT in errors
Defensive design choices to be aware of:- No stack traces. Internal stack frames are stripped before the response.
- No DB error strings. Postgres / RPC errors are sanitised to user-safe messages.
- No URLs with credentials. Defence-in-depth scrubbing in case anything slips into a log line.
- 404 instead of 403 for ownership. Trying to GET someone else’s trade returns
RESOURCE_NOT_FOUND, notFORBIDDEN. This prevents id-enumeration attacks (you can’t tell whether a UUID exists if it’s not yours). - Generic
DEPENDENCY_UNAVAILABLEwhen upstream fails. We deliberately hide which upstream — DB vs RPC vs Redis — to avoid leaking architecture detail to attackers. YourrequestIdlets us correlate to the precise root cause server-side.
Reporting bugs
Include therequestId when emailing dev@kash.bot or filing an issue on the relevant public mirror (SDK · CLI · Protocol SDK (TS) · Protocol SDK (Python)). One id is enough — we can pull the full distributed trace, every event, and every retry attempt from it.
Next
Idempotency
Safely retry trade creation without producing duplicates.
Pagination
Cursor-based, never offset. How to walk a list endpoint.