PUT

Set Security Policy as Default

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_default

Header Parameters

ParameterDescription
Authorizationbearer:<access_token>. Requires a scope of Manage All.
Content-Typeapplication/json

Resource Parameters

ParameterTypeDescription
idIntegerRequired. 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.

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'