Skip to content
Stock Group

Add Stocks to Group

Adds one or more stocks to a stock group in a single call.

Request parameters

  • Required: group_id (target stock group id), counter_ids (list of stock counter ids to add; multiple values allowed per call)
  • Optional: audit_frontend_resource (caller-provided audit context for the approval workflow, such as the stock group name)
  • See each field for its format, value source, and business meaning.

Result

On success, every stock in counter_ids is added to the stock group identified by group_id. See the 200 response schema for returned data and subsequent state information.

POSThttps://b-api.longbridge.xyz/v1/risk/stock-group/add-stocks

Authorization

AuthorizationstringheaderRequired

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

Request body application/json

group_idstringrequired

Target stock group id that the stocks are added to.

Values are dynamic. Call GET /v1/datasets/refs/stock_groups to retrieve the current data dictionary, and use the returned entry's key as this parameter's value.

counter_idsarray<string>required

List of stock counter ids (counter_id) to add to the stock group; multiple values are allowed per call. Each element is a single stock's counter_id, consistent with the counter_id used by the stock group details dataset (stock_group_details) and the remove-stock endpoint (stock-group/remove-stock).

audit_frontend_resourceobject

Caller-provided audit context for the approval workflow, such as the target stock group name (stock_group_name). It is used only for display in the approval process and does not affect processing. Omitting it does not affect the add operation.

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