Skip to main content

Common Response Envelope

Every route returns:

{    
"status": "success",
    "data": {},
    "code": 0,
    "message": "OK"
}

Field format and behavior:

FieldJSON typeFormatPresence rules
statusstringsuccess or errorAlways present
dataobject/nullRoute-specific payloadMay be omitted or null when there is no payload
codeinteger/nullError code (typically negative for business/processing errors)Present for error responses; may be omitted or null for successful responses
messagestring/nullHuman-readable diagnostic text (UTF-8)Usually present for error responses; may be omitted or null for successful responses

Parsing recommendation:

  • Always parse by status first.
  • Treat data as route-specific and optional.
  • Do not rely on message text for business logic; use code and route context.