Response Schema
Response Schema
All API endpoints within the Supervised AI testing framework return a standardized JSON response. This consistency ensures that client-side integrations can reliably parse metadata, handle errors, and extract the primary payload regardless of the specific endpoint being queried.
Standard Response Structure
Every response consists of a root object containing the status of the operation, the resulting data, and contextual metadata.
{
"success": true,
"data": {},
"message": "Request processed successfully.",
"meta": {
"request_id": "req_882345ef1",
"timestamp": "2023-10-27T10:15:00Z",
"version": "v1.0.0"
}
}
Field Definitions
| Field | Type | Description |
| :--- | :--- | :--- |
| success | Boolean | Indicates whether the operation was completed without errors. |
| data | Object/Array | The primary payload of the response. If the request is a GET for a specific resource, this is an object. For list views, this is an array. |
| message | String | A human-readable summary of the result or an error description. |
| meta | Object | Contextual information used for debugging and tracking (see Metadata Object). |
Metadata Object
The meta object is included in every response to facilitate logging and performance monitoring across the Supervised AI platform.
| Property | Type | Description |
| :--- | :--- | :--- |
| request_id | String | A unique identifier for the specific API call. Provide this when contacting support. |
| timestamp | String | ISO 8601 formatted string representing when the response was generated. |
| version | String | The current version of the API responding to the request. |
| pagination | Object | (Optional) Present only on list endpoints. Includes total_count, page, and limit. |
Error Responses
When the success field is false, the data field will typically be null or contain a specific error breakdown, and the HTTP status code will reflect the error type (e.g., 400, 401, 404, or 500).
{
"success": false,
"data": null,
"message": "Invalid test configuration provided.",
"meta": {
"request_id": "req_error_99012",
"timestamp": "2023-10-27T10:16:12Z",
"error_code": "VAL_001"
}
}
Error Metadata
In error states, the meta object may include an additional error_code string. This code should be used for programmatic error handling within your testing suite to differentiate between transient network issues and logic/validation failures.