Documentation Index

Fetch the complete documentation index at: https://docs.plainid.io/llms.txt

Use this file to discover all available pages before exploring further.

List Policies

Prev Next
Post
/api/1.0/policies-search/{envId}

Filter and list Policies by Envrionment (required), Authorization Workspace, Application, Customer Attributes within an Environment.

Notice

Accessing the API call is through a dedicated domain/URL, according to your PlainID Tenant Location
  • United States (US) - `https://api.us1.plainid.io`
  • Canada (CA) - `https://api.ca1.plainid.io`
  • Europe (EU) - `https://api.eu1.plainid.io`

  • Using HTML Encoded Special Characters

    Use HTML encoded patterns when working with values that contain special characters like spaces, dashes, etc. Refer to this HTML URL Encoding Reference for a full list.


    Important note about headers

    Refer to the headers below to modify your cURL sample. Check if the following headers are in the sample, if not, ensure you add it to your cURL sample before pasting into your API tool.

    Headers

    *Required
    Header Value cURL Line
    Content-Type * `application/json` `-H "Content-Type:application/json"`
    Accept `application/json` `-H "Accept:application/json"`

    cURL Sample Guidelines

    In order for the relevant parameters to appear in the cURL sample, you can input the values in the interactive API console on the right. They will then appear in the cURL sample on the bottom of the page in the correct format.

    Security
    HTTP
    Type bearer

    For more details about Administration API Authentication, check out the Authentication APIs documentation
    Provide your bearer token in the Authorization header when making requests to protected resources.
    Example: Authorization: Bearer 123

    Path parameters
    envId
    string (uuid) Required

    The Environment ID can be found under the Details Tab in the Environment Settings.

    Example2d4a0591-dfe4-45fb-8a69-d183f5c75c0d
    Query parameters
    limit
    integer

    Page size. Default 50, max 100. Capped to 10 when detailed=true.

    Minimum1
    Maximum100
    Default50
    Example50
    offset
    integer

    Zero-based offset. Default 0.

    Minimum0
    Default0
    Example0
    Body parameters
    Search Active Policies by App
    {
      "applicationIds": [
        "my-app-1"
      ],
      "state": "active",
      "detailed": false
    }
    Search with Custom Attributes
    {
      "policyCustomAttributes": {
        "regulatoryTags": [
          "GDPR-PII"
        ],
        "policyScore": [
          2
        ]
      },
      "detailed": false
    }
    Detailed Search with Structured Rego
    {
      "applicationIds": [
        "my-app-1"
      ],
      "detailed": true
    }
    All Parameters
    {
      "applicationIds": [
        "my-app-1",
        "my-app-2"
      ],
      "authzWsIds": [
        "03d54e5b-32ef-4ebe-8bb2-8b9b03049d81"
      ],
      "state": "active",
      "policyCustomAttributes": {
        "regulatoryTags": [
          "GDPR-PII"
        ],
        "policyScore": [
          2
        ]
      },
      "detailed": true
    }
    object.
    Responses
    200

    Paginated list of policies

    Headers
    x-request-id
    string
    Policies Retrieved Successfully
    {
      "data": [
        {
          "policyId": "POL-001",
          "displayName": "US Gold Tier Access Policy",
          "state": "Active",
          "accessType": "Allow"
        },
        {
          "policyId": "POL-002",
          "displayName": "EU Restricted Policy",
          "state": "Active",
          "accessType": "Restrict"
        }
      ],
      "meta": {
        "total": 237,
        "limit": 50,
        "offset": 0
      }
    }
    Detailed Response with Structured Rego
    {
      "data": [
        {
          "policyId": "POL-001",
          "displayName": "US Gold Tier Access Policy",
          "state": "Active",
          "accessType": "Allow",
          "structuredRego": "# METADATA\n# custom:\n#   plainid:\n#     policyId: 7fa130f2-44d4-4cd1-9590-7cb7fd15f558\n#     name: GDPRPolicy\n#     accessType: Allow\n#     policyUse: DYNAMIC_AUTHORIZATION_SERVICE\n#     sourceEnvironmentId: a8663674-c7cf-44e4-b9c5-e9adb513c5d2\n#     applications: \n#       - id: App\n#     customAttributes:\n#       regulatoryTags: [\"GDPR-PII\"]\n#       policyScore: 2\npackage policy\nimport rego.v1\n\n# METADATA\n# custom:\n#   plainid:\n#     kind: DynamicGroup\n#     name: import All Users\n#     id: 38e3b716-8dcd-4ed7-a7b3-beeb15eeca0d\n#     description: \"Predefined Dynamic Group. All Users contains all organization's users defined in the IDP\"\ndynamic_group(identity) if {\n\tidentity.template == \"import\"\n}\n\n# METADATA\n# custom:\n#   plainid:\n#     kind: Ruleset\n#     name: All\n#     id: 6a4fa454-e4b9-4b02-b543-0ad902fd9f02\n#     description: \"Predefined Ruleset. All Assets contains all created assets defined in the Asset Type\"\nruleset(asset, identity, requestParams, action) if {\n\tasset.template == \"Claims\"\n\taction.id in [\"Access\"]\n}"
        }
      ],
      "meta": {
        "total": 1,
        "limit": 10,
        "offset": 0
      }
    }
    Expand All
    object
    data
    Array of object
    object
    policyId
    string

    The Policy ID.

    displayName
    string

    The Policy display name.

    state
    string

    Whether the Policy is active or inactive.

    Valid values[ "Active", "Inactive" ]
    accessType
    string

    Whether the Policy allows or restricts access.

    Valid values[ "Allow", "Restrict" ]
    structuredRego
    string

    Structured Rego code wrapped in JSON. Only present when detailed=true.

    meta
    object

    Response Meta

    total
    integer

    Total number of matching policies.

    limit
    integer

    Page size used for this request.

    offset
    integer

    Offset used for this request.

    400

    Bad Request

    Headers
    x-request-id
    string
    401

    Unauthorized

    Headers
    x-request-id
    string
    500

    Internal Server Error

    Headers
    x-request-id
    string
    The ID of the request

    © 2024 PlainID LTD. All rights reserved.