How to create custom error rule using request attribute value from API

Thats a really good question. If you can use the API you might still end up hitting a limitation where you need to provide the entity ID, but granted that would cut down the workload.

You can create a global rule as well:

Ill see if Dynatrace is aware of a way to leverage the API for this