success field to distinguish a successful response from an error response.
Success responses
A successful response includessuccess: true and a data field. The shape of
data depends on the endpoint.
Detail response
Endpoints that return one resource respond with200 OK.
List response
Endpoints that return an unpaginated collection respond with200 OK. The
data field is always an array, including when there are no results.
Paginated response
Paginated endpoints respond with200 OK and include a top-level pagination
object alongside the data array.
No-content response
Endpoints that complete successfully without returning data respond with204 No Content. These responses have no JSON body.
Error responses
An error response includessuccess: false and an error object.
The API defines these standard error responses:
Endpoints can provide a more specific message for authorization, permission,
missing-resource, and conflict errors while retaining the standard error code.
Validation errors
Validation failures include adetails array. Each item can identify a field
with a dot-separated path and explain the problem with a message.
Handling responses
Use both the HTTP status and thesuccess field when handling a response. A
successful JSON response has success: true. An error has success: false and
a stable error code that you can use for application logic. Display message
or validation details when you need to give feedback to a person.