Standardized API response structure for CentriCare services and gateways. Responses must include detailed request status, the returned data payload, and optional metadata.

Definition

PropertyTypeDescription
successbooleanIndicates whether the API request was processed successfully
messagestringA human-readable message summarizing the result of the request or providing error details
status_codestringThe application-specific status code or standard HTTP status for request tracking
dataarrayThe primary payload containing the requested list of records
metadata.totalnumberThe total number of items available across all pages for the query
metadata.offsetnumberThe starting index or position from which items are retrieved
metadata.limitnumberThe maximum number of items returned in a single page
metadata.nextstring | nullThe URL or cursor link to fetch the next page of results, or null if on the last page.
metadata.previousstring | nullThe URL or cursor link to fetch the previous page of results, or null if on the first page

Example

{
  "success": true,
  "message": "Successfully do something",
  "status_code": "200",
  "data": [],
  "metadata": {
    "total": 1,
    "offset": 0,
    "limit": 1,
    "next": null,
    "previous": null
  }
}

Single Resource

For single-resource HTTP requests, the API response follows the standard response schema with fixed default metadata values. The metadata.total property will always be set to 1. Since pagination is not applicable to individual resource retrievals, both metadata.offset and metadata.limit will default to 0, while metadata.next and metadata.previous will strictly return null.

Error Codes

Learn more about how we standardized error status code.

Built with LogoFlowershow