Response Structure¶
Key Takeaways
- Consistent envelope: Every response includes
success
anderror
. - Operation-specific data: The rest of the fields vary by endpoint.
- Error format: Use the
error
object to inspect details ifsuccess
isfalse
.
All API responses share a common envelope that includes standard metadata:
success
boolean
Indicates whether the request completed successfully.
error
ErrorDto
Provides details when success
is false
. When the request succeeds, this field is null
.
The error object contains additional information about what went wrong.
target
string
code
string(enum)
Available enum values: Duplicated
, MissingMandatoryField
, InvalidCreateValues
, Existing
, ValidationError
, MissingEntity
message
string
details
array [ ErrorDto ]
Response Patterns¶
When success
is false
, the response contains only the error information:
When success
is true
, the response includes the data specific to the operation,
along with the common fields:
For example, a CreateResponseDto includes a createdEntityId
field
identifying the newly created entity.