Skip to main content

Update IP Allowlist for Bound Users’ API Keys

Description​

Batchly replaces or clears the IP whitelists for specified API keys. All target keys share the same IP configuration and must all be within the current Broker's authorized scope. On failure, the entire batch is rejected without partial updates. CLEAR requires prior activation of the clear permission. Repeated settings identical to the current value are returned as successful.

HTTP Request​

  • POST /api/v3/broker/api-key/ips/update
  • Scope. Broker user relationship and API Key IP management.
  • Authentication: Broker signature.
  • Rate Limit: 10 times / S / Broker, exceeding the limit returns 1710106

Request Parameters​

ParameterTypeRequiredDescription
brokerAuthobjectYesBroker authentication object.
brokerAuth.brokerIdstringYesPositive decimal Broker ID as a string, with no leading zeros. Maximum: 9223372036854775807.
brokerAuth.timestampstringYesUnix timestamp in nanoseconds as a string. The default window is five seconds before or after server time.
brokerAuth.noncestringYesFresh 16–128 character nonce. Use letters, digits, underscores, or hyphens.
brokerAuth.signaturestringYesBroker HMAC-SHA256 signature encoded as 64 hexadecimal characters. Covers the endpoint path and complete canonical request fields.
apiKeysarray<string>Yes1–20 distinct target API Keys. Each has 1–128 letters, digits, underscores, or hyphens.
operationstringYesCase-sensitive REPLACE or CLEAR. The API rejects missing or unrecognized values.
ipsarray<string>YesFor REPLACE, supply 1–20 distinct literal IPv4 addresses. For CLEAR, supply an empty array. Excludes domain names, ports, CIDR, IPv6, and comma-delimited strings.

Response Parameters​

FieldTypeDescription
data.updatedbooleantrue when the batch has been processed, including updates that match the current configuration.

The outer-level code, message, data, and extras fields are described in the integration guide. Business logic should be based on the code.

Request Example​

POST /api/v3/broker/api-key/ips/update HTTP/1.1
Host: openapi.lbank.com
Content-Type: application/json
Accept: application/json

{
"brokerAuth": {
"brokerId": "123",
"timestamp": "TIMESTAMP_NANOSECONDS",
"nonce": "NONCE_FROM_CLIENT",
"signature": "BROKER_SIGNATURE_HEX"
},
"apiKeys": ["TARGET_KEY_A", "TARGET_KEY_B"],
"operation": "REPLACE",
"ips": ["192.0.2.10", "192.0.2.11"]
}
POST /api/v3/broker/api-key/ips/update HTTP/1.1
Host: openapi.lbank.com
Content-Type: application/json
Accept: application/json

{
"brokerAuth": {
"brokerId": "123",
"timestamp": "TIMESTAMP_NANOSECONDS",
"nonce": "A_NEW_NONCE_FROM_CLIENT",
"signature": "A_NEW_BROKER_SIGNATURE_HEX"
},
"apiKeys": ["TARGET_KEY_A"],
"operation": "CLEAR",
"ips": []
}

Response Example​

{
"code": 200,
"message": "success",
"data": { "updated": true },
"extras": null
}

Compute a fresh Broker signature for both REPLACE and CLEAR. Keep ips:[] in the canonical JSON for CLEAR. Changes may take a short time to propagate.