Gets a single Security Policy by ID.
Resource URL
https://<subdomain>.onelogin.com/api/2/policies/<id>Header Parameters
| Parameter | Description |
|---|---|
| Authorization | bearer:<access_token>. Requires a scope of Manage All or Read All. |
| Content-Type | application/json |
Resource Parameters
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Required. 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.
Sample Code
curl -X GET \
https://<subdomain>.onelogin.com/api/2/policies/1 \
-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.