{
  "opencollection": "1.0.0",
  "info": {
    "name": "Permit.io Access Requests (EAP) Access Requests (EAP) Roles API",
    "version": "2.0.0"
  },
  "items": [
    {
      "info": {
        "name": "Roles",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "List Roles",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v2/schema/:proj_id/:env_id/roles",
            "params": [
              {
                "name": "proj_id",
                "value": "my_project",
                "type": "path",
                "description": "Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\")."
              },
              {
                "name": "env_id",
                "value": "my_environment",
                "type": "path",
                "description": "Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\")."
              },
              {
                "name": "include_total_count",
                "value": "",
                "type": "query",
                "description": "Include total count in response"
              },
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Page number of the results to fetch, starting at 1."
              },
              {
                "name": "per_page",
                "value": "",
                "type": "query",
                "description": "The number of results per page (max 100)."
              },
              {
                "name": "search",
                "value": "",
                "type": "query",
                "description": "Text search for the object name or key"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Lists all tenant roles."
        },
        {
          "info": {
            "name": "Create Role",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v2/schema/:proj_id/:env_id/roles",
            "params": [
              {
                "name": "proj_id",
                "value": "my_project",
                "type": "path",
                "description": "Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\")."
              },
              {
                "name": "env_id",
                "value": "my_environment",
                "type": "path",
                "description": "Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\")."
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Creates a new tenant role."
        },
        {
          "info": {
            "name": "Get Role",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v2/schema/:proj_id/:env_id/roles/:role_id",
            "params": [
              {
                "name": "role_id",
                "value": "",
                "type": "path",
                "description": "Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\")."
              },
              {
                "name": "proj_id",
                "value": "my_project",
                "type": "path",
                "description": "Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\")."
              },
              {
                "name": "env_id",
                "value": "my_environment",
                "type": "path",
                "description": "Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\")."
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Gets a single tenant role, if such role exists."
        },
        {
          "info": {
            "name": "Update Role",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/v2/schema/:proj_id/:env_id/roles/:role_id",
            "params": [
              {
                "name": "role_id",
                "value": "",
                "type": "path",
                "description": "Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\")."
              },
              {
                "name": "proj_id",
                "value": "my_project",
                "type": "path",
                "description": "Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\")."
              },
              {
                "name": "env_id",
                "value": "my_environment",
                "type": "path",
                "description": "Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\")."
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Partially updates a tenant role.\nFields that will be provided will be completely overwritten."
        },
        {
          "info": {
            "name": "Delete Role",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/v2/schema/:proj_id/:env_id/roles/:role_id",
            "params": [
              {
                "name": "role_id",
                "value": "",
                "type": "path",
                "description": "Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\")."
              },
              {
                "name": "proj_id",
                "value": "my_project",
                "type": "path",
                "description": "Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\")."
              },
              {
                "name": "env_id",
                "value": "my_environment",
                "type": "path",
                "description": "Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\")."
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Deletes a tenant role and all its related data.\nThis includes any permissions granted to said role."
        },
        {
          "info": {
            "name": "Assign Permissions To Role",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/v2/schema/:proj_id/:env_id/roles/:role_id/permissions",
            "params": [
              {
                "name": "role_id",
                "value": "",
                "type": "path",
                "description": "Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\")."
              },
              {
                "name": "proj_id",
                "value": "my_project",
                "type": "path",
                "description": "Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\")."
              },
              {
                "name": "env_id",
                "value": "my_environment",
                "type": "path",
                "description": "Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\")."
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Assign permissions to role.\n\nIf some of the permissions specified are already assigned, will skip them."
        },
        {
          "info": {
            "name": "Remove Permissions From Role",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/v2/schema/:proj_id/:env_id/roles/:role_id/permissions",
            "params": [
              {
                "name": "role_id",
                "value": "",
                "type": "path",
                "description": "Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\")."
              },
              {
                "name": "proj_id",
                "value": "my_project",
                "type": "path",
                "description": "Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\")."
              },
              {
                "name": "env_id",
                "value": "my_environment",
                "type": "path",
                "description": "Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\")."
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Remove permissions from role.\n\nIf some of the permissions specified are already unassigned, will skip them."
        },
        {
          "info": {
            "name": "Get Role Ancestors",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v2/schema/:proj_id/:env_id/roles/:role_id/ancestors",
            "params": [
              {
                "name": "role_id",
                "value": "",
                "type": "path",
                "description": "Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\")."
              },
              {
                "name": "proj_id",
                "value": "my_project",
                "type": "path",
                "description": "Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\")."
              },
              {
                "name": "env_id",
                "value": "my_environment",
                "type": "path",
                "description": "Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\")."
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get Role Ancestors"
        },
        {
          "info": {
            "name": "Get Role Descendants",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/v2/schema/:proj_id/:env_id/roles/:role_id/descendants",
            "params": [
              {
                "name": "role_id",
                "value": "",
                "type": "path",
                "description": "Either the unique id of the role, or the URL-friendly key of the role (i.e: the \"slug\")."
              },
              {
                "name": "proj_id",
                "value": "my_project",
                "type": "path",
                "description": "Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\")."
              },
              {
                "name": "env_id",
                "value": "my_environment",
                "type": "path",
                "description": "Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\")."
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get Role Descendants"
        }
      ]
    }
  ],
  "bundled": true
}