ApiResponse<T> is a generic wrapper model used to standardize all API responses. It provides a consistent structure that includes success status, message, and the actual data payload.
Fields
Indicates whether the API request was successful.
true- The operation completed successfullyfalse- The operation failed or encountered an error
A human-readable message describing the result of the operation. This provides context about what happened, whether successful or an error occurred.
The actual response payload. The type varies depending on the endpoint:
- For
/api/executeendpoint, this is anExecutionResultobject - For error responses, this field is
null
T allows this wrapper to be reused across different endpoints with different response types.Examples
Successful response
Error response
Validation error
Java class
This model is defined in the backend as:Static factory methods
The class provides two convenient static factory methods:success()
Creates a successful response with data:error()
Creates an error response with no data:Usage
All endpoints in the Runtime API use this wrapper to ensure consistent response formatting. Clients can always check thesuccess field to determine if the operation succeeded before accessing the data field.