Skip to content
Risk Control Rules Management

Save Risk Rule

Saves the risk-control rules. This operation changes the live risk-rule engine configuration; use it with caution.

Request parameters

  • Required: rule_name (Rule Name), group_name (Rule Group Name), status (Status), rule_detail (Rule Detail List)
  • Optional: risk_rule_id (Risk Rule ID), aaid (Account AAID), group_id (Client Group ID), audit_frontend_resource (Audit Context)
  • See each field for its format, allowed values, default behavior, and business meaning.

Notes

This single endpoint handles both create and edit: omit risk_rule_id to create a new rule, or provide risk_rule_id to edit that rule.

Result

On success, the endpoint completes the described business operation. See the 200 response schema for returned data.

POSThttps://b-api.longbridge.xyz/v1/risk_monitoring/rule_engine/save_risk_rule

Authorization

AuthorizationstringheaderRequired

Send the Broker ACCESS_TOKEN as Authorization: Bearer <token>.

Request body application/json

risk_rule_idstring

Passed when editing an existing rule; not passed when creating.

rule_namestringrequired

Specifies Rule Name. This field is required.

group_namestringrequired

Values come from the risk_groups dynamic enumeration and are not fixed.

Allowed values:

  • ignore_margin_call - MarginCall Exemption
  • over_financing_margin_call_ignore - OverLimit MarginCall Exemption

Call GET /v1/datasets/refs/risk_groups to retrieve the current data dictionary, and use the returned entry's key as this field's value.

ignore_margin_call · MarginCall Exemptionover_financing_margin_call_ignore · OverLimit MarginCall Exemption

statusnumberrequired

Single-select: 1 = enable, 2 = disable.

Allowed values:

  • 1 - Enabled
  • 2 - Disable

1 · Enabled2 · Disable

aaidstring

Submitted only when the rule type is "Customized - single account"; it is the selected client's AAID.

group_idstring

Submitted only when the rule type is "Customized - client group"; values come from the risk_client_groups dynamic enumeration and are not fixed.

Call GET /v1/datasets/refs/risk_client_groups to retrieve the current data dictionary, and use the returned entry's key as this field's value.

rule_detailarray<string>required

Each item contains parameter (the rule parameter name, from the risk_rule_parameter_cfg_query dynamic query, not fixed), operator (comparison operator = / >, fixed to = for boolean parameters), and target_value (for boolean type, 1/0 = TRUE/FALSE; for float type, a numeric string).

audit_frontend_resourceobject

Audit information shown in the approval ticket: operation type (add/edit), rule type (global/customized), and a human-readable text comparison of the rule details before and after the change.

Responses

HTTP 200The request was processed successfully. The response data does not contain additional business fields.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 400Bad request. Check the business error code in code and the error details in message.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 401The user is not authenticated, or the login session has expired.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 403The current account is not authorized to use this feature. Grant the required permission to the account in User Permission.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 408The request timed out. Check the business error code in code and the error details in message.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

Whale Docs