details field with structured validation metadata.
Error envelope
details is omitted entirely when there is nothing to report — it is never sent as null. Only BAD_REQUEST and CONFLICT populate it (for example, with Zod’s flattened validation errors); every other error code omits the key.Status codes and error codes
404 is deliberately non-leaking: a chat that was never yours and a chat that never existed produce byte-identical responses.