Skip to main content
Layer uses a standardized json structure across all endpoints. There are only 3 possible top level fields.

Data

Contains the requested data from the endpoint and can be either a JSON list or a JSON object.
  • Every top level object or item in an array will contain a type field indicating the entity type.
  • data will only be present if the result is successful, in which case there will be a 2** status code and no error field.

Errors

An array of error objects. error objects will contain the following fields.
  • type: One of a fixed set of categories. Helpful for categorizing & processing errors
  • description: A human readable error description.
  • meta: Optional additional information. errors will be present only if the request is unsuccessful, in which case there will be a 4** or 5** status code and no data field.

Meta

An optional object that may be used to communicate metadata about the request. Example use cases include:
  • Idempotency
  • Pagination
  • Rate limits