Response Format
Standard response envelope, error codes, and pagination conventions.
Success Response
Successful responses use a standard JSON envelope:
{
"success": true,
"data": { ... },
"timestamp": "2026-04-23T12:00:00.000Z"
}| Field | Type | Description |
|---|---|---|
success | boolean | Always true for successful responses. |
data | object | array | The response payload. Structure varies by endpoint. |
timestamp | string | ISO 8601 UTC timestamp of when the response was generated. |
Error Responses
Errors return "success": false with an error object:
{
"success": false,
"error": {
"code": "PROTEIN_NOT_FOUND",
"message": "Protein record does not exist."
},
"timestamp": "2026-04-23T12:00:00.000Z"
}| Field | Type | Description |
|---|---|---|
error.code | string | Machine-readable error code, such as INVALID_QUERY or FILE_NOT_FOUND. |
error.message | string | Error description. |
error.details | object? | Optional map of field-specific validation errors. |
Pagination
List endpoints embed a pagination object in the response:
{
"pagination": {
"page": 1,
"pageSize": 10,
"total": 48200,
"totalPages": 4820,
"hasNext": true,
"hasPrev": false
}
}| Field | Type | Description |
|---|---|---|
page | int | Current page number (1-indexed). |
pageSize | int | Items per page. |
total | int | Total matching records. |
totalPages | int | Total number of pages. |
hasNext | boolean | Whether there is a next page. |
hasPrev | boolean | Whether there is a previous page. |
HTTP Status Codes
| Status | Meaning |
|---|---|
200 | Success. |
400 | Bad request — missing or invalid parameters. |
404 | Resource not found. |
500 | Internal server error. |
503 | Service unavailable. |