{
	"info": {
		"_postman_id": "e5ec1af2-e9a3-411a-9618-d3fe939eb6d4",
		"name": "Apps API - OneLogin",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Rules",
			"item": [
				{
					"name": "List Rules",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "1b88c8a1-bd31-4bf3-88b2-4a49ca9d6842",
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules"
							],
							"query": [
								{
									"key": "has_condition",
									"value": "has_role:{{role_id}}",
									"disabled": true
								},
								{
									"key": "has_condition_type",
									"value": "none",
									"disabled": true
								},
								{
									"key": "has_action",
									"value": "set_status:*",
									"disabled": true
								},
								{
									"key": "has_action_type",
									"value": "none",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Get Rule",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "60d3617a-0047-4504-a363-fbce8347411a",
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules/{{rule_id}}",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules",
								"{{rule_id}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Create Rule",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "1b88c8a1-bd31-4bf3-88b2-4a49ca9d6842",
								"exec": [
									"pm.test(\"Status code is 201\", function () {",
									"    pm.response.to.have.status(201);",
									"});",
									"",
									"pm.test(\"Response ID is not null\", function () {",
									"    pm.response.json().id.not.equal(null);",
									"});",
									"",
									"postman.setEnvironmentVariable(\"mapping_id\", pm.response.json().id);"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Suspend after 90 days inactive\",\n    \"match\": \"all\",\n    \"position\": null,\n    \"enabled\": true,\n    \"conditions\": [\n        {\n            \"source\": \"last_login\",\n            \"operator\": \">\",\n            \"value\": \"90\"\n        }\n    ],\n    \"actions\": [\n        {\n            \"action\": \"set_status\",\n            \"value\": [\"2\"]\n        }\n    ]\n}"
						},
						"url": {
							"raw": "https://{{api-domain}}/api/2/mappings",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"mappings"
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Rule",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "60d3617a-0047-4504-a363-fbce8347411a",
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response ID is not null\", function () {",
									"    pm.response.json().id.not.equal(null);",
									"});",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Sample Rule Updated\",\n    \"match\": \"all\",\n    \"enabled\": true,\n    \"position\": 1,\n    \"conditions\": [\n        {\n            \"source\": \"has_role\",\n            \"operator\": \"ri\",\n            \"value\": \"272445\"\n        }\n    ],\n    \"actions\": [\n        {\n            \"action\": \"set_groups\",\n            \"value\": [\n                \"member_of\"\n            ],\n            \"expression\": \".*\"\n        }\n    ]\n}"
						},
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules/{{rule_id}}",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules",
								"{{rule_id}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Delete Rule",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "60d3617a-0047-4504-a363-fbce8347411a",
								"exec": [
									"pm.test(\"Status code is 204\", function () {",
									"    pm.response.to.have.status(204);",
									"});",
									""
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules/{{rule_id}}",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules",
								"{{rule_id}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "List Conditions",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "1b88c8a1-bd31-4bf3-88b2-4a49ca9d6842",
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules/conditions",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules",
								"conditions"
							]
						}
					},
					"response": []
				},
				{
					"name": "List Conditions Operators",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "1b88c8a1-bd31-4bf3-88b2-4a49ca9d6842",
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules/conditions/{{rule_condition_value}}/operators",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules",
								"conditions",
								"{{rule_condition_value}}",
								"operators"
							]
						}
					},
					"response": []
				},
				{
					"name": "List Conditions Values",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "1b88c8a1-bd31-4bf3-88b2-4a49ca9d6842",
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules/conditions/{{rule_condition_value}}/values",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules",
								"conditions",
								"{{rule_condition_value}}",
								"values"
							]
						}
					},
					"response": []
				},
				{
					"name": "List Actions",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "1b88c8a1-bd31-4bf3-88b2-4a49ca9d6842",
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules/actions",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules",
								"actions"
							]
						}
					},
					"response": []
				},
				{
					"name": "List Actions Values",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "1b88c8a1-bd31-4bf3-88b2-4a49ca9d6842",
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules/actions/{{rule_action_value}}/values",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules",
								"actions",
								"{{rule_action_value}}",
								"values"
							]
						}
					},
					"response": []
				},
				{
					"name": "Bulk Sort",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{access_token}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "[\n\t204500,\n    204499,\n    204503,\n    204502,\n    204501\n]",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/rules/sort",
							"protocol": "https",
							"host": [
								"{{api-domain}}"
							],
							"path": [
								"api",
								"2",
								"apps",
								"{{app_id}}",
								"rules",
								"sort"
							]
						}
					},
					"response": []
				}
			],
			"protocolProfileBehavior": {}
		},
		{
			"name": "List Connectors",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{access_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://{{api-domain}}/api/2/connectors",
					"protocol": "https",
					"host": [
						"{{api-domain}}"
					],
					"path": [
						"api",
						"2",
						"connectors"
					],
					"query": [
						{
							"key": "auth_method",
							"value": "2",
							"disabled": true
						},
						{
							"key": "limit",
							"value": "2",
							"disabled": true
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "List Apps",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{access_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://{{api-domain}}/api/2/apps",
					"protocol": "https",
					"host": [
						"{{api-domain}}"
					],
					"path": [
						"api",
						"2",
						"apps"
					],
					"query": [
						{
							"key": "connector_id",
							"value": null,
							"disabled": true
						},
						{
							"key": "auth_method",
							"value": null,
							"disabled": true
						},
						{
							"key": "fields",
							"value": "policy_id",
							"disabled": true
						},
						{
							"key": "fields",
							"value": "id,name,user_count",
							"disabled": true
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get App",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{access_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}",
					"protocol": "https",
					"host": [
						"{{api-domain}}"
					],
					"path": [
						"api",
						"2",
						"apps",
						"{{app_id}}"
					],
					"query": [
						{
							"key": "name",
							"value": "",
							"disabled": true
						},
						{
							"key": "connector_id",
							"value": "",
							"disabled": true
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Create App",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{access_token}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"connector_id\": 50534,\n  \"name\": \"Amazon Web Services (AWS) Multi Role\",\n  \"description\": \"\",\n  \"visible\": true,\n  \"sso\": {\n    \"certificate\": {\n      \"id\": 170216\n    }\n  },\n  \"configuration\": {\n    \"signature_algorithm\": \"SHA-1\"\n  },\n  \"parameters\": {\n    \"saml_username\": {\n      \"user_attribute_mappings\": \"email\"\n    }\n  }\n}"
				},
				"url": {
					"raw": "https://{{api-domain}}/api/2/apps",
					"protocol": "https",
					"host": [
						"{{api-domain}}"
					],
					"path": [
						"api",
						"2",
						"apps"
					],
					"query": [
						{
							"key": "name",
							"value": "",
							"disabled": true
						},
						{
							"key": "connector_id",
							"value": "",
							"disabled": true
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Update App",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{access_token}}",
							"type": "string"
						}
					]
				},
				"method": "PUT",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"parameters\": {\n\t    \"saml_username\": {\n\t      \"user_attribute_mappings\": \"email\"\n\t    }\n    }\n}"
				},
				"url": {
					"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}",
					"protocol": "https",
					"host": [
						"{{api-domain}}"
					],
					"path": [
						"api",
						"2",
						"apps",
						"{{app_id}}"
					],
					"query": [
						{
							"key": "name",
							"value": "",
							"disabled": true
						},
						{
							"key": "connector_id",
							"value": "",
							"disabled": true
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Delete App",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{access_token}}",
							"type": "string"
						}
					]
				},
				"method": "DELETE",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"url": {
					"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}",
					"protocol": "https",
					"host": [
						"{{api-domain}}"
					],
					"path": [
						"api",
						"2",
						"apps",
						"{{app_id}}"
					]
				}
			},
			"response": []
		},
		{
			"name": "Delete Parameter from App",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{access_token}}",
							"type": "string"
						}
					]
				},
				"method": "DELETE",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"url": {
					"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/parameters/{{parameter_id}}",
					"protocol": "https",
					"host": [
						"{{api-domain}}"
					],
					"path": [
						"api",
						"2",
						"apps",
						"{{app_id}}",
						"parameters",
						"{{parameter_id}}"
					],
					"query": [
						{
							"key": "name",
							"value": "",
							"disabled": true
						},
						{
							"key": "connector_id",
							"value": "",
							"disabled": true
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get App Users",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{access_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://{{api-domain}}/api/2/apps/{{app_id}}/users",
					"protocol": "https",
					"host": [
						"{{api-domain}}"
					],
					"path": [
						"api",
						"2",
						"apps",
						"{{app_id}}",
						"users"
					]
				}
			},
			"response": []
		}
	]
}