Skip to content

Response Structure

Key Takeaways

  • Consistent envelope: Every response includes success and error.
  • Operation-specific data: The rest of the fields vary by endpoint.
  • Error format: Use the error object to inspect details if success is false.

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:

{
  "success": false,
  "error": { ... }
}

When success is true, the response includes the data specific to the operation, along with the common fields:

{
  "success": true,
  "error": null,
  "createdEntityId": "12345678-1234-1234-1234-123456789012"
}

For example, a CreateResponseDto includes a createdEntityId field identifying the newly created entity.