API Response JSON Example

A stable response envelope for JSON APIs.

Example

{
  "ok": true,
  "status": 200,
  "data": {
    "items": [1, 2, 3],
    "total": 3
  },
  "meta": {"page": 1, "pageSize": 20}
}

Explanation

A predictable envelope makes client parsing and error handling easier.