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 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 https://account.sf-api.com/sf/v3/Policies(id)
Returns information for a specific Policy.
| id | String | policy id |
Returns: A single 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.
| id | String | The Id of the user to retrieve applied policies for |
| userPolicies | UserPolicy[] | List of policies to be assigned |
Returns: Returns user policies
POST https://account.sf-api.com/sf/v3/Users(id)/Policies
{
"Active": true,
"Policy": {
"Id": "123"
}
}
Assigns a Policy to a user
| id | String | The Id of the user to assign policy to. |
| policy | UserPolicy | The policy id and active status. |
Returns: Returns newly assigned Policy
DELETE https://account.sf-api.com/sf/v3/Users(id)/Policies
Remove user from policy based admin
| id | String | The Id of the user to retrieve applied policies for |
DELETE https://account.sf-api.com/sf/v3/Users(parentId)/Policies(id)
Remove Policy from user
| id | String | The Id of the user to retrieve applied policies for |
| policyId | String | The policy id |
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.
| id | String | The Id of the user to retrieve applied policies for |
| policyId | String | The policy id |
| updatedPolicy | UserPolicy | The policy |