Orkeia Response Standard
In Orkeia, all APIs follow a unified response standard.This standard is defined to simplify integration, facilitate error handling, and maintain consistency between all modules (such as Agents, Tools, Knowledge Bases, Squads, and other resources).
General Structure
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| status | string | Yes | Defines the operation state: "OK" for success or "ERROR" for failure. |
| data | any | Yes | Data returned by the operation (object, array, string, etc.). |
| code | string | No | Standardized error code (used only when status = "ERROR"). |
code field always follows standardized values:
| Value | Description |
|---|---|
auth/forbidden | Access denied, user does not have permission. |
auth/user-not-found | User not found in the system. |
auth/user-not-has-permission | User exists but does not have the required permission. |
server/error | Internal server error. |
client/mandatory-field-missing | Mandatory field missing in the request. |
client/error | Generic client input error. |
integration/error | Failure in integration with external systems. |
ai/error | Error in AI model processing. |
funds/not-sufficient-credits | Insufficient credits to perform the operation. |
security/potential-threat | Action blocked due to suspected security threat. |
subscription/threshold | Subscription usage limit reached. |
subscription/payment-error | Issue with subscription payment. |
Examples
Success
response
Client Error (400)
Server Error (500)
Benefits
- Consistency: all modules follow the same format.
- Clarity: the
statusfield immediately indicates whether the operation was successful or not. - Facilitated Handling: clients can implement generic interceptors to handle
statusandcode. - Extensibility: new error codes can be added without breaking integrations.
