Transport
WebSocket endpoint, JSON-RPC 2.0 envelope, response shapes, and error codes.
Connection
wss://api.enbox.net/v1/ws
An OAuth 2.0 accessToken (see Authentication) must be presented during the WebSocket handshake.
HTTP transport
Some modules (blog, docs, help, oauth2) additionally expose a REST HTTP transport under https://api.enbox.net/v1/<module>/<service>. The HTTP transport publishes the same CRUD operations as the WebSocket transport, but uses REST conventions (path params, query string, JSON body) and returns the bare result payload without the JSON-RPC envelope. Module-specific docs note when HTTP is available.
Request format
Every WebSocket request is a JSON-RPC 2.0 object:
{
"jsonrpc": "2.0",
"method": "<module>.<service>.<operation>",
"params": { ... },
"id": 1
}
| Field | Type | Description |
|---|---|---|
jsonrpc |
string |
Always "2.0" |
method |
string |
Dot-separated path: module.service.operation |
params |
object |
Operation-specific parameters |
id |
integer |
Client-assigned request id for matching responses |
Response format
Success
{
"jsonrpc": "2.0",
"result": { ... },
"id": 1
}
Error
{
"jsonrpc": "2.0",
"error": {
"code": 1200,
"message": "Not found"
},
"id": 1
}
The HTTP transport returns the bare result payload on success (no jsonrpc/id wrapper) and a JSON error object with code/message on failure.
Error codes
| Code | Name | Description |
|---|---|---|
1000 |
ClientError |
Generic client error |
1100 |
UnprocessableError |
Unprocessable content |
1110 |
ValidationError |
Document validation failed |
1111 |
FilterValidationError |
Invalid filter parameters |
1112 |
SortValidationError |
Invalid sort parameters |
1113 |
FieldValidationError |
Invalid field projection |
1114 |
FormValidationError |
Form validation failed |
1120 |
PayloadTooLargeError |
Request payload exceeds limit |
1130 |
InvalidRequestError |
Malformed request format |
1200 |
NotFoundError |
Record not found |
1300 |
ConflictError |
Unique constraint violated |
1400 |
AuthenticationError |
Authentication required |
1500 |
ForbiddenError |
Permission denied |
1600 |
MethodNotAllowedError |
Operation not allowed on this service |
2000 |
ServerError |
Generic server error |
2100 |
InternalServerError |
Unexpected server failure |
2200 |
DatabaseError |
Database operation failed |
2300 |
ServiceUnavailableError |
Service temporarily unavailable |