v4

latestOpenAPI 3.1.02026-08-02261331761.5 KB
OPAL Data ( EAP )

Get All Data Optimized

get/v2/internal/opal_data/{org_id}/{proj_id}/{env_id}/optimized

Path parameters

org_idstring uuid required

Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the "slug").

Either the unique id of the organization, or the URL-friendly key of the organization (i.e: the "slug").

proj_idstring required

Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").

Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").

env_idstring required

Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").

Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").

Headers

X-Shard-IDinteger

Response

Successful Response

use_debuggerboolean
usersobject required

Key-Value mapping of the users in the system. The key is the user key and the value contains some details about the user.

tenantsobject required

Key-Value mapping of the tenants in the system. The key is the tenant key and the value contains some details about the tenant.

rolesobject required

Key-Value mapping of the roles in the system. The key is the role key and the value contains some details about the role.

condition_set_rulesobject required

Key-Value mapping of the permissions for each condition set. The key is the user-set key and the value is Key-Value mapping of resource-set key to the permissions for that user-set & resource-set.The key is the resource key and the value is list of actions that the user-set can perform on that resource-set

condition_set_rules_expandobject

Sanitized Key-Value mapping of the permissions for each condition set. (Equal to condition_set_rules but user_set_key and resource_set_key are sanitized)The key is the user-set key and the value is Key-Value mapping of resource-set key to the permissions for that user-set & resource-set.The key is the resource key and the value is list of actions that the user-set can perform on that resource-set

relationshipsobject required

Key-Value mapping of the relationships between resources. The key is the resource instance key and the value is Key-Value mapping of relation key to a Key-Value mapping of resource ( type ) to list of instances keys.

resource_typesobject required

Key-Value mapping of the resource types in the system. The key is the resource type key and the value contains some details about the resource type.

condition_setsobject required

Key-Value mapping of the condition sets in the system. The key is the formatted condition set key and the value contains some details about the condition set.

role_assignmentsobject required

Key-Value mapping of the role assignments for the users. The key is the user key and the value is Key-Value mapping of resource instance key or tenant key to list of role keys assigned to the user in that resource instance.

role_permissionsobject required

Key-Value mapping of the permissions for each role. The key is the resource key and the value is Key-Value mapping of role key to details on the role permissions.

mapping_rulesobject

Key-Value mapping of groups of mapping rules in the system. The key is the mapping rule group and the value is a list of mapping rules objects.We currently have only one group named 'all' which contains all the mapping rules.A mapping rule object contains, action, http_method, resource and url - all strings.

resource_instancesobject

Key-Value mapping of the resource instances in the system. The key is the resource instance key and the value contains some details about the resource instance.

Example response

{
  "use_debugger": true,
  "mapping_rules": {
    "all": [
      {
        "action": "read",
        "http_method": "get",
        "resource": "document",
        "url": "https://example.com/{var}/resources/{var2}"
      }
    ]
  },
  "users": {
    "user1": {
      "roleAssignments": {
        "default": [
          "viewer"
        ]
      },
      "attributes": {
        "email": "user1@permit.io",
        "key": "user1"
      }
    }
  },
  "tenants": {
    "default": {
      "attributes": {
        "attr1": "value1"
      }
    }
  },
  "role_permissions": {
    "community": {
      "admin": {
        "grants": {}
      },
      "viewer": {
        "grants": {}
      }
    },
    "document": {
      "editor": {
        "grants": {
          "document": [
            "update",
            "read"
          ]
        }
      },
      "viewer": {
        "grants": {
          "document": [
            "read"
          ]
        }
      }
    }
  },
  "roles": {
    "viewer": {
      "grants": {
        "document": [
          "read"
        ]
      }
    }
  },
  "condition_sets": {
    "resourceset_big_5ffiles": {
      "type": "resourceset",
      "key": "big_files"
    },
    "userset_permit_57users": {
      "type": "userset",
      "key": "permit_users"
    }
  },
  "condition_set_rules": {
    "permit_users": {
      "big_files": {
        "document": [
          "read",
          "update"
        ]
      }
    }
  },
  "resource_instances": {
    "community:community-0": {
      "attributes": {}
    },
    "document:document-0": {
      "attributes": {}
    },
    "document:document-1": {
      "attributes": {}
    }
  },
  "relationships": {
    "document:document-0": {
      "relation:community": {
        "community": [
          "community-0"
        ]
      }
    },
    "document:document-1": {
      "relation:community": {
        "community": [
          "community-0"
        ]
      }
    }
  },
  "resource_types": {
    "__tenant": {
      "actions": [],
      "derived_roles": {}
    },
    "__user": {
      "actions": [],
      "derived_roles": {}
    },
    "community": {
      "actions": [],
      "derived_roles": {}
    },
    "document": {
      "actions": [
        "read",
        "update"
      ],
      "derived_roles": {
        "editor": {
          "rules": [
            {
              "related_resource": "community",
              "related_role": "admin",
              "relation": "community",
              "settings": {
                "superseded_by_direct_role": false
              }
            }
          ],
          "settings": {
            "superseded_by_direct_role": false
          }
        },
        "viewer": {
          "rules": [
            {
              "related_resource": "community",
              "related_role": "admin",
              "relation": "community",
              "settings": {
                "superseded_by_direct_role": false
              }
            },
            {
              "related_resource": "community",
              "related_role": "viewer",
              "relation": "community",
              "settings": {
                "superseded_by_direct_role": false
              }
            }
          ],
          "settings": {
            "superseded_by_direct_role": false
          }
        }
      }
    }
  },
  "role_assignments": {
    "user:user1": {
      "__tenant:default": [
        "viewer"
      ],
      "document:document-1": [
        "editor"
      ]
    }
  }
}