With NiFi toolkit we can use below command to fetch parameters from parameter provider, apply the parameters to parameter group with the mention of sensitive properties:
cli.sh nifi fetch-params --paramProviderId $PCP --applyParameters --sensitiveParamPattern "sens_.*"
How can I achieve the same thing using NiFi api. I am planning to use NiFi version 1.21.0.