Sets a user-kind Security Policy as the account default. Only policies with kind: user can be set as default; attempting this on an app-kind policy returns 422 Unprocessable Entity.
Resource URL
https://<subdomain>.onelogin.com/api/2/policies/<id>/set_defaultHeader Parameters
| Parameter | Description |
|---|---|
| Authorization | bearer:<access_token>. Requires a scope of Manage All. |
| Content-Type | application/json |
Resource Parameters
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Required. Policy ID. Must be a user-kind policy. |
Sample Responses
200 Success
{
"status": {
"error": false,
"code": 200,
"type": "success",
"message": "Success"
},
"data": [
{
"id": 3,
"name": "Custom User Policy",
"kind": "user",
"is_default": true
}
]
}422 Unprocessable Entity
{
"status": {
"error": true,
"code": 422,
"type": "unprocessable_entity",
"message": "Only user policies can be set as default"
}
}Postman Collection
Add the Security Policies endpoints to your Postman workspace using the OneLogin Postman collection.
- Clicking Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.
Sample Code
curl -X PUT \
https://<subdomain>.onelogin.com/api/2/policies/3/set_default \
-H 'Authorization: bearer:<access_token>' \
-H 'Content-Type: application/json'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.