Updates an existing Security Policy.
kindis immutable. Attempting to changekindon an existing policy returns a422 Unprocessable Entityresponse.
authentication_factor_idsandreset_password_authentication_factor_idsuse full-replace semantics — the array you send replaces the existing list entirely. Send an empty array ([]) to clear all factors.
admin_policy_idandprofile_policy_idmust reference anapp-kind policy belonging to the same account, or the request returns422.
Resource URL
https://<subdomain>.onelogin.com/api/2/policies/<id>Header Parameters
| Parameter | Description |
|---|---|
| Authorization | bearer:<access_token>. Requires a scope of Manage All. |
| Content-Type | application/json |
Request Parameters
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Required. Policy ID. |
| ... | Any updatable attribute from the Policy Resource page. kind cannot be changed. |
Sample Responses
200 Success
{
"status": {
"error": false,
"code": 200,
"type": "success",
"message": "Success"
},
"data": [
{
"id": 3,
"name": "Custom User Policy",
"kind": "user",
"is_default": false,
"minimum_password_length": 12
}
]
}422 Unprocessable Entity
{
"status": {
"error": true,
"code": 422,
"type": "unprocessable_entity",
"message": "Kind cannot be changed after policy creation"
}
}Postman Collection
Add the Security Policies endpoints to your Postman workspace using the OneLogin Postman collection.
Sample Code
curl -X PUT \
https://<subdomain>.onelogin.com/api/2/policies/3 \
-H 'Authorization: bearer:<access_token>' \
-H 'Content-Type: application/json' \
-d '{
"minimum_password_length": 12
}'Have a Question?
Found a problem or a bug? Submit a support ticket.
Looking for walkthroughs or how-to guides? Check out our Knowledge Base.
Have a product idea or request? Share it in our Ideas Portal.