Skip to content

Error Codes

WebSocket trade push uses channel error codes returned by the WebSocket gateway layer during authentication or low-level request handling. Code values are integers in the 4xxx / 5xxx range.


Channel Error Codes

Channel errors occur before the request reaches business logic, and are returned by the WebSocket gateway or authentication service.

Response Format

json
{
  "id": "req-001",
  "code": 4002,
  "msg": "auth_failed"
}

Error Code Reference

codeMeaningCommon CauseRecommended Action
4000Malformed requestThe frame structure does not conform to the protocol — e.g., invalid JSON or missing action field.Check the request frame format and resend after fixing.
4001Not authenticatedA business request was sent before authentication succeeded.Complete Auth authentication first; send business requests only after receiving session_id.
4002Authentication failedcredential_id does not exist, signature verification failed, or the Bearer Token is expired or invalid.Check credentials and signing logic. For OAuth2, refresh the token and re-establish the connection.
4003Insufficient permissionsThe authorization scope of the current credential does not include the requested interface permission.Verify that the credential is authorized for the interface; for OAuth2, check the scope requested during authorization.
4004Interface not foundaction is incorrect, or the requested interface is not exposed by the server.Check the API documentation and verify the action name spelling.
5000Internal server errorAn unexpected exception occurred while the server was processing the request.Contact the server team for investigation; automatic retry is not recommended.
5002Gateway errorA server-side network error prevented the request from reaching the backend.Retry after a short delay; if the issue persists, check the network environment or contact the server team.
5003Service temporarily unavailableThe server is overloaded and temporarily unable to handle new requests.Wait and retry; use a backoff strategy.
5004Request timeoutThe server did not return a result within the allotted time.Retry after a short delay; if timeouts persist, contact the server team for investigation.