Policies

Policies represent a collection of settings for a given user, split into categories. With Policy Based Administration turned on for the account, a user with the role AdminPolicyDefinitions may assign policies to a user, allowing for that user's settings to be based upon the policies assigned to them. This allows for a greater degree of control for large sets of users who have the same settings.

Get List of Account Policies

GET https://account.sf-api.com/sf/v3/Policies 

The Policies endpoint returns the list of policies that have been defined for current account.

Returns: List of account policies

Get Policy

GET https://account.sf-api.com/sf/v3/Policies(id) 

Returns information for a specific Policy.

idString policy id

Returns: A single Policy

Set user Policy

PUT https://account.sf-api.com/sf/v3/Users(id)/Policies 
            [{ 
                "Active": true, 
                "Policy": { 
                    "Id": "123" 
                } 
             }, 
             { 
                "Active": false, 
                "Policy": { 
                    "Id": "456" 
                } 
            }] 

Replace all policies associated with user Leaving any category out will effectively disable PBA for that category. At most one policy per category is allowed.

idString The Id of the user to retrieve applied policies for
userPoliciesUserPolicy[] List of policies to be assigned

Returns: Returns user policies

Create User Policy

POST https://account.sf-api.com/sf/v3/Users(id)/Policies 
            { 
                "Active": true, 
                "Policy": { 
                    "Id": "123" 
                } 
            } 

Assigns a Policy to a user

idString The Id of the user to assign policy to.
policyUserPolicy The policy id and active status.

Returns: Returns newly assigned Policy

Delete User Policies

DELETE https://account.sf-api.com/sf/v3/Users(id)/Policies 

Remove user from policy based admin

idString The Id of the user to retrieve applied policies for

Delete a single UserPolicy

DELETE https://account.sf-api.com/sf/v3/Users(parentId)/Policies(id) 

Remove Policy from user

idString The Id of the user to retrieve applied policies for
policyIdString The policy id

Update a single UserPolicy

PATCH https://account.sf-api.com/sf/v3/Users(parentId)/Policies(id) 
            { 
                "Active": false 
            } 

Updates a single user Policy. Currently this only allows an update to the Active flag.

idString The Id of the user to retrieve applied policies for
policyIdString The policy id
updatedPolicyUserPolicy The policy