GET

Get Security Policy by ID

Gets a single Security Policy by ID.

Resource URL

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

Header Parameters

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

Resource Parameters

ParameterTypeDescription
idIntegerRequired. Policy ID.

Sample Responses

200 Success

{
  "status": {
    "error": false,
    "code": 200,
    "type": "success",
    "message": "Success"
  },
  "data": [
    {
      "id": 1,
      "name": "Default Policy",
      "kind": "user",
      "is_default": true,
      "minimum_password_length": 8
    }
  ]
}

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.

Run In Postman

    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 GET \
  https://<subdomain>.onelogin.com/api/2/policies/1 \
  -H 'Authorization: bearer:<access_token>' \
  -H 'Content-Type: application/json'