codeis a machine-readable value from the fixed set below — branch your logic on it.messageis a human-readable explanation. It may change over time; never parse or switch on it.
Error codes
The set of codes is closed and stable — new codes are added rarely and announced.Entitlement boundaries are enforced as
404, not 403: a resource your key isn’t
entitled to is indistinguishable from one that doesn’t exist, so existence is never
leaked across organizations.Handling errors
Switch onerror.code and treat the HTTP status as a coarse category: