API Connect

 View Only

 How to set Rate Limit by IP on APIC?

Giovanni Beretta's profile image
Giovanni Beretta posted Wed October 22, 2025 06:15 PM

Hello, 

Hello,

I'm trying to use "dynamic-value" in the product plan with the Rate Limit Policy, in order to control usage based on a dynamic value — specifically by referencing $(request.headers.clientIp) to get the user IP.

I'm following the example from this blog post:

IBM APIC Connect: Applying Rate Limit based on Dynamic Value


What happens is that I can publish both the API and the Product, but I keep getting a 401 Unauthorized error:

"moreInformation": "Cannot find valid subscription for the incoming API request."

I'm not sure if I'm doing this correctly, or even if this approach is possible at all.
If not, is there any way I can achieve something similar?

Any help would be greatly appreciated.

Best regards,
Giovanni Beretta

Giovanni Beretta's profile image
Giovanni Beretta

Any help?

Nick Cawood's profile image
Nick Cawood

Hi,

I don't think this error relates to the rate-limit policy. This looks more like a setup issue: how have you subscribed to the assembly-rate-limit Plan? Are you subsequently correctly using the correct client-id when invoking the API?

------------------------------
Nick Cawood
API Connect Consultant
IBM Expert Labs
IBM UK Ltd

https://www.linkedin.com/in/nickcawood/
------------------------------


Giovanni Beretta's profile image
Giovanni Beretta

@Nick Cawood I'm trying to use the IP of the client, not the client-id. Is that even possible to achieve on a API level?

Nick Cawood's profile image
Nick Cawood

The error you are getting is not related to your rate-limit policy.
The error is that you are not able to invoke the API because the client-id you are using to invoke the API is not from an Application that has subscribed to the Plan in the Product.
------------------------------
Nick Cawood
API Connect Consultant
IBM Expert Labs
IBM UK Ltd

https://www.linkedin.com/in/nickcawood/
------------------------------