DELETE

Delete Security Policy

Deletes a Security Policy.

The account’s current default policy cannot be deleted. Attempting to delete the default policy returns 422 Unprocessable Entity. Set a different policy as default first (see Set Security Policy as Default).

Resource URL

https://<subdomain>.onelogin.com/api/2/policies/<id>

Header Parameters

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

Resource Parameters

ParameterTypeDescription
idIntegerRequired. Policy ID.

Sample Responses

204 No Content

The policy was deleted successfully. The response body is empty.

422 Unprocessable Entity

{
  "status": {
    "error": true,
    "code": 422,
    "type": "unprocessable_entity",
    "message": "You can't delete the default policy"
  }
}

404 Not Found

{
  "status": {
    "error": true,
    "code": 404,
    "type": "not_found",
    "message": "Policy not found"
  }
}

Postman Collection

Add the Security Policies endpoints to your Postman workspace using the OneLogin Postman collection.

Sample Code

curl -X DELETE \
  https://<subdomain>.onelogin.com/api/2/policies/3 \
  -H 'Authorization: bearer:<access_token>' \
  -H 'Content-Type: application/json'