Request and Response Bodies
REST API POST, PUT, and PATCH requests typically include a JSON body containing the data to create or update. The Content-Type header should be 'application/json'. Response bodies return JSON with the requested resource or operation result.
Standard Response Shapes
Well-designed APIs adopt consistent response structures. Single-resource endpoints return an object; collection endpoints return an array or wrapper object. Error responses should include a consistent structure: error code, human-readable message, and optional details.
Versioning and Field Evolution
APIs evolve over time. Adding new fields to JSON responses is a backwards-compatible change — old clients ignore unknown fields. Removing or renaming fields breaks clients. Major breaking changes typically require API versioning.
JSON Pagination Patterns
Standard pagination patterns include offset/limit, cursor-based pagination, and page numbers. Response envelopes typically include the data array and metadata: total count, whether there's a next page, and a cursor or next link.
JSON in REST APIs works best with consistent response shapes, clear error formats, and thoughtful evolution strategy. Invest in API design conventions early — they're much cheaper to establish than to retrofit.