SetPassword API is not behaving as per the password policy assigned

We have created password policy for a group and SetPassword API is not behaving as per the Password policy which is assigned.
Is there any configurations that we can set to our policy so that all the API’s will behave as per policy?