Skip to main content
Every error response from api.kash.bot follows RFC 7807 Problem Details with Content-Type: application/problem+json.

Wire shape

How to handle errors

Branch on code, 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.
The TypeScript SDK throws typed subclasses (KashRateLimitError, KashAuthorizationError, etc.) so you can catch by error type as well.

Status code conventions

Error code catalog

Every code 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:
Common codes to know: 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, not FORBIDDEN. This prevents id-enumeration attacks (you can’t tell whether a UUID exists if it’s not yours).
  • Generic DEPENDENCY_UNAVAILABLE when upstream fails. We deliberately hide which upstream — DB vs RPC vs Redis — to avoid leaking architecture detail to attackers. Your requestId lets us correlate to the precise root cause server-side.

Reporting bugs

Include the requestId 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.