@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Permit.io API
@version 2.0.0
@auth Bearer bearer
@endpoints 258
@hint download_for_search
@toc members(7), api-key(7), orgs(10), projects(25), schema(75), facts(69), pdps(8), elements(29), deprecated(6), history(4), activity(2), policy_guards(9), audit-log-replay(1), internal(6)

@group members
@endpoint GET /v2/members/me
@returns(200) {id: str(uuid), email: str(email), email_verified: bool, name: str, given_name: str, family_name: str, picture: str, is_superuser: bool, is_onboarding: bool, onboarding_step: any, created_at: str(date-time), last_login: str(date-time), last_ip: str, logins_count: int, identities: [map], invite: map{member_id: str(uuid), email: str(email), role: any, id: str(uuid), organization_id: str(uuid), invite_code: str(uuid), created_at: str(date-time), status: any, failed_reason: str}, settings: map, grants: [map]}
@errors {422}

@endpoint GET /v2/members
@optional {project_id: str(uuid), env_id: str(uuid), page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/members
@required {permissions: [map{organization_id!: str(uuid), project_id: str(uuid), environment_id: str(uuid), object_type!: str, access_level!: str, organization_key: str, project_key: str, environment_key: str, organization_name: str, project_name: str, environment_name: str}]}
@optional {inviter_name: str, inviter_email: str, id: str(uuid), email: str(email)}
@returns(200) {id: str(uuid), email: str(email), email_verified: bool, name: str, given_name: str, family_name: str, picture: str, is_superuser: bool, is_onboarding: bool, onboarding_step: any, created_at: str(date-time), last_login: str(date-time), last_ip: str, logins_count: int, identities: [map], invite: map{member_id: str(uuid), email: str(email), role: any, id: str(uuid), organization_id: str(uuid), invite_code: str(uuid), created_at: str(date-time), status: any, failed_reason: str}, settings: map, grants: [map]}
@errors {422}

@endpoint DELETE /v2/members
@required {id: str(uuid), permissions: [map{organization_id!: str(uuid), project_id: str(uuid), environment_id: str(uuid), object_type!: str, access_level!: str, organization_key: str, project_key: str, environment_key: str, organization_name: str, project_name: str, environment_name: str}]}
@returns(204)
@errors {422}

@endpoint GET /v2/members/{member_id}
@required {member_id: str}
@returns(200) {id: str(uuid), email: str(email), email_verified: bool, name: str, given_name: str, family_name: str, picture: str, is_superuser: bool, is_onboarding: bool, onboarding_step: any, created_at: str(date-time), last_login: str(date-time), last_ip: str, logins_count: int, identities: [map], invite: map{member_id: str(uuid), email: str(email), role: any, id: str(uuid), organization_id: str(uuid), invite_code: str(uuid), created_at: str(date-time), status: any, failed_reason: str}, settings: map, grants: [map]}
@errors {422}

@endpoint DELETE /v2/members/{member_id}
@required {member_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/members/{member_id}
@required {member_id: str}
@optional {settings: map, onboarding_step: any}
@returns(200) {id: str(uuid), email: str(email), email_verified: bool, name: str, given_name: str, family_name: str, picture: str, is_superuser: bool, is_onboarding: bool, onboarding_step: any, created_at: str(date-time), last_login: str(date-time), last_ip: str, logins_count: int, identities: [map], invite: map{member_id: str(uuid), email: str(email), role: any, id: str(uuid), organization_id: str(uuid), invite_code: str(uuid), created_at: str(date-time), status: any, failed_reason: str}, settings: map, grants: [map]}
@errors {422}

@endgroup

@group api-key
@endpoint GET /v2/api-key/{proj_id}/{env_id}
@required {proj_id: str, env_id: str}
@returns(200) {organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), object_type: any, access_level: any, owner_type: str, name: str, id: str(uuid), secret: str, created_at: str(date-time), created_by_member: map{id: str(uuid), email: str(email), email_verified: bool, name: str, given_name: str, family_name: str, picture: str, is_superuser: bool, is_onboarding: bool, onboarding_step: any, created_at: str(date-time), last_login: str(date-time), last_ip: str, logins_count: int, identities: [map], invite: map{member_id: str(uuid), email: str(email), role: any, id: str(uuid), organization_id: str(uuid), invite_code: str(uuid), created_at: str(date-time), status: any, failed_reason: str}, settings: map}, last_used_at: str(date-time), env: map{key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), avp_policy_store_id: str, name: str, description: str, custom_branch_name: str, jwks: any, settings: map}, project: map{key: str, urn_namespace: str, id: str(uuid), organization_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}}
@errors {422}

@endpoint GET /v2/api-key/scope
@returns(200) {organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid)}
@errors {422}

@endpoint GET /v2/api-key
@optional {object_type: str, proj_id: str, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/api-key
@required {organization_id: str(uuid)}
@optional {project_id: str(uuid), environment_id: str(uuid), object_type: any=env, access_level: any=admin, owner_type: any=member, name: str}
@returns(200) {organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), object_type: any, access_level: any, owner_type: str, name: str, id: str(uuid), secret: str, created_at: str(date-time), created_by_member: map{id: str(uuid), email: str(email), email_verified: bool, name: str, given_name: str, family_name: str, picture: str, is_superuser: bool, is_onboarding: bool, onboarding_step: any, created_at: str(date-time), last_login: str(date-time), last_ip: str, logins_count: int, identities: [map], invite: map{member_id: str(uuid), email: str(email), role: any, id: str(uuid), organization_id: str(uuid), invite_code: str(uuid), created_at: str(date-time), status: any, failed_reason: str}, settings: map}, last_used_at: str(date-time), env: map{key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), avp_policy_store_id: str, name: str, description: str, custom_branch_name: str, jwks: any, settings: map}, project: map{key: str, urn_namespace: str, id: str(uuid), organization_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}}
@errors {422}

@endpoint GET /v2/api-key/{api_key_id}
@required {api_key_id: str}
@returns(200) {organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), object_type: any, access_level: any, owner_type: str, name: str, id: str(uuid), secret: str, created_at: str(date-time), created_by_member: map{id: str(uuid), email: str(email), email_verified: bool, name: str, given_name: str, family_name: str, picture: str, is_superuser: bool, is_onboarding: bool, onboarding_step: any, created_at: str(date-time), last_login: str(date-time), last_ip: str, logins_count: int, identities: [map], invite: map{member_id: str(uuid), email: str(email), role: any, id: str(uuid), organization_id: str(uuid), invite_code: str(uuid), created_at: str(date-time), status: any, failed_reason: str}, settings: map}, last_used_at: str(date-time), env: map{key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), avp_policy_store_id: str, name: str, description: str, custom_branch_name: str, jwks: any, settings: map}, project: map{key: str, urn_namespace: str, id: str(uuid), organization_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}}
@errors {422}

@endpoint DELETE /v2/api-key/{api_key_id}
@required {api_key_id: str}
@returns(204)
@errors {422}

@endpoint POST /v2/api-key/{api_key_id}/rotate-secret
@required {api_key_id: str(uuid)}
@returns(200) {organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), object_type: any, access_level: any, owner_type: str, name: str, id: str(uuid), secret: str, created_at: str(date-time), created_by_member: map{id: str(uuid), email: str(email), email_verified: bool, name: str, given_name: str, family_name: str, picture: str, is_superuser: bool, is_onboarding: bool, onboarding_step: any, created_at: str(date-time), last_login: str(date-time), last_ip: str, logins_count: int, identities: [map], invite: map{member_id: str(uuid), email: str(email), role: any, id: str(uuid), organization_id: str(uuid), invite_code: str(uuid), created_at: str(date-time), status: any, failed_reason: str}, settings: map}, last_used_at: str(date-time), env: map{key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), avp_policy_store_id: str, name: str, description: str, custom_branch_name: str, jwks: any, settings: map}, project: map{key: str, urn_namespace: str, id: str(uuid), organization_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}}
@errors {422}

@endgroup

@group orgs
@endpoint GET /v2/orgs
@optional {search: any, page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/orgs
@required {key: str, name: str}
@optional {page_full_url: str=page_full_url, settings: map}
@returns(200) {key: str, id: str(uuid), is_enterprise: bool, usage_limits: any, created_at: str(date-time), updated_at: str(date-time), name: str, settings: map, api_key_id: str(uuid), api_key_secret: str}
@errors {422}

@endpoint GET /v2/orgs/{org_id}
@required {org_id: str}
@returns(200) {key: str, id: str(uuid), is_enterprise: bool, usage_limits: any, created_at: str(date-time), updated_at: str(date-time), name: str, settings: map}
@errors {422}

@endpoint DELETE /v2/orgs/{org_id}
@required {org_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/orgs/{org_id}
@required {org_id: str}
@optional {name: str, settings: map}
@returns(200) {key: str, id: str(uuid), is_enterprise: bool, usage_limits: any, created_at: str(date-time), updated_at: str(date-time), name: str, settings: map}
@errors {422}

@endpoint GET /v2/orgs/active/org
@returns(200) {key: str, id: str(uuid), is_enterprise: bool, usage_limits: any, created_at: str(date-time), updated_at: str(date-time), name: str, settings: map}
@errors {422}

@endpoint GET /v2/orgs/{org_id}/stats
@required {org_id: str}
@returns(200) {key: str, id: str(uuid), is_enterprise: bool, usage_limits: any, created_at: str(date-time), updated_at: str(date-time), name: str, settings: map, stats: map{projects: int, environments: int, users: int}, historical_usage: map{current_month: map{mau: int, tenants: int, monthly_tenants: [str(uuid)], month: int, year: int}, previous_month: map{mau: int, tenants: int, monthly_tenants: [str(uuid)], month: int, year: int}, two_months_ago: map{mau: int, tenants: int, monthly_tenants: [str(uuid)], month: int, year: int}}}
@errors {422}

@endpoint GET /v2/orgs/{org_id}/invites
@required {org_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/orgs/{org_id}/invites
@required {org_id: str}
@optional {inviter_name: str, inviter_email: str}
@returns(200) {success: [map], failed: [map]}
@errors {422}

@endpoint DELETE /v2/orgs/{org_id}/invites/{invite_id}
@required {org_id: str, invite_id: str(uuid)}
@returns(204)
@errors {422}

@endgroup

@group projects
@endpoint GET /v2/projects
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/projects
@required {key: str, name: str}
@optional {urn_namespace: str, description: str, settings: map, active_policy_repo_id: str(uuid), initial_environments: [map{key!: str, name!: str, description: str, custom_branch_name: str, jwks: any, settings: map}]=[object Object],[object Object]}
@returns(200) {key: str, urn_namespace: str, id: str(uuid), organization_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}
@errors {422}

@endpoint GET /v2/projects/{proj_id}
@required {proj_id: str}
@returns(200) {key: str, urn_namespace: str, id: str(uuid), organization_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}
@errors {422}

@endpoint DELETE /v2/projects/{proj_id}
@required {proj_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/projects/{proj_id}
@required {proj_id: str}
@optional {name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}
@returns(200) {key: str, urn_namespace: str, id: str(uuid), organization_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}
@errors {422}

@endpoint GET /v2/projects/{proj_id}/envs/{env_id}/stats
@required {proj_id: str, env_id: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), avp_policy_store_id: str, name: str, description: str, custom_branch_name: str, jwks: any, settings: map, pdp_configs: [map], stats: map{roles: int, users: int, policies: int, resources: int, tenants: int, has_decision_logs: bool, members: [map], mau: int}}
@errors {422}

@endpoint GET /v2/projects/{proj_id}/envs
@required {proj_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/projects/{proj_id}/envs
@required {proj_id: str, key: str, name: str}
@optional {description: str, custom_branch_name: str, jwks: any, settings: map}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), avp_policy_store_id: str, name: str, description: str, custom_branch_name: str, jwks: any, settings: map}
@errors {422}

@endpoint GET /v2/projects/{proj_id}/envs/{env_id}
@required {proj_id: str, env_id: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), avp_policy_store_id: str, name: str, description: str, custom_branch_name: str, jwks: any, settings: map, email_configuration: str(uuid)}
@errors {422}

@endpoint DELETE /v2/projects/{proj_id}/envs/{env_id}
@required {proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/projects/{proj_id}/envs/{env_id}
@required {proj_id: str, env_id: str}
@optional {name: str, description: str, custom_branch_name: str, jwks: any, settings: map}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), avp_policy_store_id: str, name: str, description: str, custom_branch_name: str, jwks: any, settings: map}
@errors {422}

@endpoint POST /v2/projects/{proj_id}/envs/{env_id}/copy
@required {proj_id: str, env_id: str, target_env: any}
@optional {conflict_strategy: any=fail, scope: any=[object Object]}
@returns(201) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), avp_policy_store_id: str, name: str, description: str, custom_branch_name: str, jwks: any, settings: map}
@errors {422}

@endpoint POST /v2/projects/{proj_id}/envs/{env_id}/copy/async
@required {proj_id: str, env_id: str, target_env: any}
@optional {wait: num=0, conflict_strategy: any=fail, scope: any=[object Object]}
@returns(202) {task_id: str, status: any, result: any, error: any}
@errors {422}

@endpoint GET /v2/projects/{proj_id}/envs/{env_id}/copy/async/{task_id}/result
@required {task_id: str, proj_id: str, env_id: str}
@optional {wait: num=0}
@returns(200) {task_id: str, status: any, result: any, error: any}
@errors {422}

@endpoint POST /v2/projects/{proj_id}/envs/{env_id}/test_jwks
@required {proj_id: str, env_id: str}
@optional {url: str}
@returns(200)
@errors {422}

@endgroup

@group schema
@endpoint PUT /v2/schema/{proj_id}/{env_id}/bulk/roles
@required {proj_id: str, env_id: str, operations: [map{name!: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, v1compat_settings: map, v1compat_attributes: map, key!: str, resource: str}]}
@returns(200) {created: [str], updated: [str]}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/condition_sets
@required {proj_id: str, env_id: str}
@optional {search: str, type: any, include_total_count: bool=false, page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/condition_sets
@required {proj_id: str, env_id: str, key: str, name: str}
@optional {type: any=userset, autogenerated: bool=false, resource_id: any, description: str, conditions: map=[object Object], parent_id: any}
@returns(200) {key: str, type: any, autogenerated: bool, resource_id: any, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), resource: map{key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, urn: str, description: str, actions: map, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str, action_groups: map}, name: str, description: str, conditions: map, parent_id: any}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/condition_sets/{condition_set_id}
@required {condition_set_id: str, proj_id: str, env_id: str}
@returns(200) {key: str, type: any, autogenerated: bool, resource_id: any, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), resource: map{key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, urn: str, description: str, actions: map, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str, action_groups: map}, name: str, description: str, conditions: map, parent_id: any}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/condition_sets/{condition_set_id}
@required {condition_set_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/schema/{proj_id}/{env_id}/condition_sets/{condition_set_id}
@required {condition_set_id: str, proj_id: str, env_id: str}
@optional {name: str, description: str, conditions: map=[object Object], parent_id: any}
@returns(200) {key: str, type: any, autogenerated: bool, resource_id: any, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), resource: map{key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, urn: str, description: str, actions: map, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str, action_groups: map}, name: str, description: str, conditions: map, parent_id: any}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/condition_sets/{condition_set_id}/ancestors
@required {condition_set_id: str, proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/condition_sets/{condition_set_id}/descendants
@required {condition_set_id: str, proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}/implicit_grants
@required {resource_id: str, role_id: str, proj_id: str, env_id: str, role: str, on_resource: str, linked_by_relation: str}
@optional {when: any=[object Object]}
@returns(200) {role_id: str(uuid), resource_id: str(uuid), relation_id: str(uuid), role: str, on_resource: str, linked_by_relation: str, when: any}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}/implicit_grants
@required {role_id: str, resource_id: str, proj_id: str, env_id: str, role: str, on_resource: str, linked_by_relation: str}
@optional {when: any=[object Object]}
@returns(204)
@errors {422}

@endpoint PUT /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}/implicit_grants/conditions
@required {resource_id: str, role_id: str, proj_id: str, env_id: str}
@optional {no_direct_roles_on_object: bool=false}
@returns(200) {no_direct_roles_on_object: bool}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/action_groups
@required {resource_id: str, proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/action_groups
@required {resource_id: str, proj_id: str, env_id: str, key: str, name: str}
@optional {description: str, attributes: map, actions: [str]=}
@returns(200) {name: str, description: str, attributes: map, actions: [str], key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/action_groups/{action_group_id}
@required {resource_id: str, action_group_id: str, proj_id: str, env_id: str}
@returns(200) {name: str, description: str, attributes: map, actions: [str], key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/action_groups/{action_group_id}
@required {resource_id: str, action_group_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/action_groups/{action_group_id}
@required {resource_id: str, action_group_id: str, proj_id: str, env_id: str}
@optional {name: str, description: str, attributes: map, actions: [str]=}
@returns(200) {name: str, description: str, attributes: map, actions: [str], key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions
@required {resource_id: str, proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions
@required {resource_id: str, proj_id: str, env_id: str, key: str, name: str}
@optional {description: str, attributes: map, v1compat_path: str, v1compat_is_built_in: bool, v1compat_name: str}
@returns(200) {name: str, description: str, attributes: map, v1compat_path: str, v1compat_is_built_in: bool, v1compat_name: str, key: str, id: str(uuid), permission_name: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions/{action_id}
@required {resource_id: str, action_id: str, proj_id: str, env_id: str}
@returns(200) {name: str, description: str, attributes: map, v1compat_path: str, v1compat_is_built_in: bool, v1compat_name: str, key: str, id: str(uuid), permission_name: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions/{action_id}
@required {resource_id: str, action_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/actions/{action_id}
@required {resource_id: str, action_id: str, proj_id: str, env_id: str}
@optional {name: str, description: str, attributes: map, v1compat_path: str, v1compat_is_built_in: bool, v1compat_name: str}
@returns(200) {name: str, description: str, attributes: map, v1compat_path: str, v1compat_is_built_in: bool, v1compat_name: str, key: str, id: str(uuid), permission_name: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes
@required {resource_id: str, proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes
@required {resource_id: str, proj_id: str, env_id: str, key: str, type: any}
@optional {description: str}
@returns(200) {type: any, description: str, key: str, id: str(uuid), resource_id: str(uuid), resource_key: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), built_in: bool}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes/{attribute_id}
@required {resource_id: str, attribute_id: str, proj_id: str, env_id: str}
@returns(200) {type: any, description: str, key: str, id: str(uuid), resource_id: str(uuid), resource_key: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), built_in: bool}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes/{attribute_id}
@required {resource_id: str, attribute_id: str, proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(204)
@errors {422}

@endpoint PATCH /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/attributes/{attribute_id}
@required {resource_id: str, attribute_id: str, proj_id: str, env_id: str}
@optional {type: any, description: str}
@returns(200) {type: any, description: str, key: str, id: str(uuid), resource_id: str(uuid), resource_key: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), built_in: bool}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/relations
@required {resource_id: str, proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/relations
@required {resource_id: str, proj_id: str, env_id: str, key: str, name: str, subject_resource: str}
@optional {description: str}
@returns(200) {description: str, subject_resource: str, key: str, name: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), object_resource_id: str(uuid), object_resource: str, subject_resource_id: str(uuid)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/relations/{relation_id}
@required {resource_id: str, relation_id: str, proj_id: str, env_id: str}
@returns(200) {description: str, subject_resource: str, key: str, name: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), object_resource_id: str(uuid), object_resource: str, subject_resource_id: str(uuid)}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/relations/{relation_id}
@required {resource_id: str, relation_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles
@required {resource_id: str, proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles
@required {resource_id: str, proj_id: str, env_id: str, key: str, name: str}
@optional {description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, v1compat_settings: map, v1compat_attributes: map}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), resource: str, created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}
@required {resource_id: str, role_id: str, proj_id: str, env_id: str}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), resource: str, created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}
@required {resource_id: str, role_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}
@required {resource_id: str, role_id: str, proj_id: str, env_id: str}
@optional {name: str, description: str, permissions: [str], attributes: map, extends: [str]=, granted_to: any}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), resource: str, created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}/permissions
@required {resource_id: str, role_id: str, proj_id: str, env_id: str, permissions: [str]}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), resource: str, created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}/permissions
@required {resource_id: str, role_id: str, proj_id: str, env_id: str, permissions: [str]}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), resource_id: str(uuid), resource: str, created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}/ancestors
@required {resource_id: str, role_id: str, proj_id: str, env_id: str}
@returns(200) {roles: any}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}/descendants
@required {resource_id: str, role_id: str, proj_id: str, env_id: str}
@returns(200) {roles: any}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources
@required {proj_id: str, env_id: str}
@optional {include_built_in: bool=false, include_total_count: bool=false, page: int=1, per_page: int=30, search: str}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/resources
@required {proj_id: str, env_id: str, key: str, name: str, actions: map}
@optional {urn: str, description: str, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, urn: str, description: str, actions: map, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str, action_groups: map}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id}
@required {resource_id: str, proj_id: str, env_id: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, urn: str, description: str, actions: map, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str, action_groups: map}
@errors {422}

@endpoint PUT /v2/schema/{proj_id}/{env_id}/resources/{resource_id}
@required {resource_id: str, proj_id: str, env_id: str, name: str, actions: map}
@optional {urn: str, description: str, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, urn: str, description: str, actions: map, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str, action_groups: map}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id}
@required {resource_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/schema/{proj_id}/{env_id}/resources/{resource_id}
@required {resource_id: str, proj_id: str, env_id: str}
@optional {name: str, urn: str, description: str, actions: map, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, urn: str, description: str, actions: map, type_attributes: map, attributes: map, roles: map, relations: map, v1compat_path: str, v1compat_type: str, v1compat_name: str, action_groups: map}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/roles
@required {proj_id: str, env_id: str}
@optional {include_total_count: bool=false, page: int=1, per_page: int=30, search: str}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/roles
@required {proj_id: str, env_id: str, key: str, name: str}
@optional {description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, v1compat_settings: map, v1compat_attributes: map, v1compat_is_built_in: bool}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, v1compat_settings: map, v1compat_attributes: map, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/roles/{role_id}
@required {role_id: str, proj_id: str, env_id: str}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, v1compat_settings: map, v1compat_attributes: map, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/roles/{role_id}
@required {role_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/schema/{proj_id}/{env_id}/roles/{role_id}
@required {role_id: str, proj_id: str, env_id: str}
@optional {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, v1compat_settings: map, v1compat_attributes: map}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, v1compat_settings: map, v1compat_attributes: map, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/roles/{role_id}/permissions
@required {role_id: str, proj_id: str, env_id: str, permissions: [str]}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, v1compat_settings: map, v1compat_attributes: map, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/roles/{role_id}/permissions
@required {role_id: str, proj_id: str, env_id: str, permissions: [str]}
@returns(200) {name: str, description: str, permissions: [str], attributes: map, extends: [str], granted_to: any, v1compat_settings: map, v1compat_attributes: map, key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/roles/{role_id}/ancestors
@required {role_id: str, proj_id: str, env_id: str}
@returns(200) {roles: any}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/roles/{role_id}/descendants
@required {role_id: str, proj_id: str, env_id: str}
@returns(200) {roles: any}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/users/attributes
@required {proj_id: str, env_id: str}
@optional {resource_id: str=__user, page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/users/attributes
@required {proj_id: str, env_id: str, key: str, type: any}
@optional {resource_id: str=__user, description: str}
@returns(200) {type: any, description: str, key: str, id: str(uuid), resource_id: str(uuid), resource_key: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), built_in: bool}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/users/attributes/{attribute_id}
@required {attribute_id: str, proj_id: str, env_id: str}
@optional {resource_id: str=__user}
@returns(200) {type: any, description: str, key: str, id: str(uuid), resource_id: str(uuid), resource_key: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), built_in: bool}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/users/attributes/{attribute_id}
@required {attribute_id: str, proj_id: str, env_id: str}
@optional {resource_id: str=__user, page: int=1, per_page: int=30}
@returns(204)
@errors {422}

@endpoint PATCH /v2/schema/{proj_id}/{env_id}/users/attributes/{attribute_id}
@required {attribute_id: str, proj_id: str, env_id: str}
@optional {resource_id: str=__user, type: any, description: str}
@returns(200) {type: any, description: str, key: str, id: str(uuid), resource_id: str(uuid), resource_key: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), built_in: bool}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/groups/direct
@required {proj_id: str, env_id: str}
@optional {tenant: str, resource: str, page: int=1, per_page: int=30, search: str}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/groups/direct/{group_instance_key}
@required {proj_id: str, env_id: str, group_instance_key: str}
@returns(200) {group_resource_type_key: str, group_instance_key: str, group_tenant: str, id: str(uuid)}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/children
@required {proj_id: str, env_id: str, group_instance_key: str}
@optional {page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/parents
@required {proj_id: str, env_id: str, group_instance_key: str}
@optional {page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/users
@required {proj_id: str, env_id: str, group_instance_key: str}
@optional {page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/roles
@required {proj_id: str, env_id: str, group_instance_key: str}
@optional {page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/roles
@required {proj_id: str, env_id: str, group_instance_key: str, role: str, resource: str, resource_instance: str, tenant: str}
@returns(200) {assigned_roles: [str], users: [str(uuid)], group_resource_type_key: str, group_instance_key: str, group_tenant: str}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/roles
@required {proj_id: str, env_id: str, group_instance_key: str, role: str, resource: str, resource_instance: str, tenant: str}
@returns(204)
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}
@required {proj_id: str, env_id: str, group_instance_key: str}
@returns(200) {assigned_roles: [str], users: [str(uuid)], group_resource_type_key: str, group_instance_key: str, group_tenant: str}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}
@required {proj_id: str, env_id: str, group_instance_key: str}
@returns(204)
@errors {422}

@endpoint GET /v2/schema/{proj_id}/{env_id}/groups
@required {proj_id: str, env_id: str}
@optional {tenant: str, resource: str, include_total_count: bool=false, page: int=1, per_page: int=30, search: str}
@returns(200)
@errors {422}

@endpoint POST /v2/schema/{proj_id}/{env_id}/groups
@required {proj_id: str, env_id: str, group_instance_key: str, group_tenant: str}
@optional {group_resource_type_key: str=group}
@returns(200) {assigned_roles: [str], users: [str(uuid)], group_resource_type_key: str, group_instance_key: str, group_tenant: str}
@errors {422}

@endpoint PUT /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/users/{user_id}
@required {user_id: str, proj_id: str, env_id: str, group_instance_key: str, tenant: str}
@returns(200) {assigned_roles: [str], users: [str(uuid)], group_resource_type_key: str, group_instance_key: str, group_tenant: str}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/users/{user_id}
@required {user_id: str, proj_id: str, env_id: str, group_instance_key: str, tenant: str}
@returns(204)
@errors {422}

@endpoint PUT /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/assign_group
@required {proj_id: str, env_id: str, group_instance_key: str, group_instance_key: str}
@returns(200) {assigned_roles: [str], users: [str(uuid)], group_resource_type_key: str, group_instance_key: str, group_tenant: str}
@errors {422}

@endpoint DELETE /v2/schema/{proj_id}/{env_id}/groups/{group_instance_key}/assign_group
@required {proj_id: str, env_id: str, group_instance_key: str, group_instance_key: str}
@returns(204)
@errors {422}

@endgroup

@group facts
@endpoint GET /v2/facts/{proj_id}/{env_id}/users
@required {proj_id: str, env_id: str}
@optional {search: str, role: str, include_resource_instance_roles: bool=false, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/users
@required {proj_id: str, env_id: str, key: str}
@optional {email: str(email), first_name: str, last_name: str, attributes: map=[object Object], role_assignments: [map{role!: str, tenant: str, resource_instance: str}]}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), associated_tenants: [map], roles: [map], created_at: str(date-time), updated_at: str(date-time), email: str(email), first_name: str, last_name: str, attributes: map}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/users/{user_id}
@required {user_id: str, proj_id: str, env_id: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), associated_tenants: [map], roles: [map], created_at: str(date-time), updated_at: str(date-time), email: str(email), first_name: str, last_name: str, attributes: map}
@errors {422}

@endpoint PUT /v2/facts/{proj_id}/{env_id}/users/{user_id}
@required {user_id: str, proj_id: str, env_id: str, key: str}
@optional {email: str(email), first_name: str, last_name: str, attributes: map=[object Object], role_assignments: [map{role!: str, tenant: str, resource_instance: str}]}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), associated_tenants: [map], roles: [map], created_at: str(date-time), updated_at: str(date-time), email: str(email), first_name: str, last_name: str, attributes: map}
@returns(201) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), associated_tenants: [map], roles: [map], created_at: str(date-time), updated_at: str(date-time), email: str(email), first_name: str, last_name: str, attributes: map}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/users/{user_id}
@required {user_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/facts/{proj_id}/{env_id}/users/{user_id}
@required {user_id: str, proj_id: str, env_id: str}
@optional {email: str(email), first_name: str, last_name: str, attributes: map=[object Object]}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), associated_tenants: [map], roles: [map], created_at: str(date-time), updated_at: str(date-time), email: str(email), first_name: str, last_name: str, attributes: map}
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/users/{user_id}/roles
@required {user_id: str, proj_id: str, env_id: str, role: str}
@optional {tenant: str, resource_instance: str}
@returns(200) {id: str(uuid), user: str, role: str, tenant: str, resource_instance: str, resource_instance_id: str(uuid), user_id: str(uuid), role_id: str(uuid), tenant_id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/users/{user_id}/roles
@required {user_id: str, proj_id: str, env_id: str, role: str, tenant: str}
@optional {return_deleted: bool=false, resource_instance: str}
@returns(200) {id: str(uuid), user: str, role: str, tenant: str, resource_instance: str, resource_instance_id: str(uuid), user_id: str(uuid), role_id: str(uuid), tenant_id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time)}
@returns(204)
@errors {404, 422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users
@required {tenant_id: str, proj_id: str, env_id: str}
@optional {search: str, role: str, include_resource_instance_roles: bool=false, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users
@required {tenant_id: str, proj_id: str, env_id: str, key: str}
@optional {email: str(email), first_name: str, last_name: str, attributes: map=[object Object], role_assignments: [map{role!: str, tenant: str, resource_instance: str}]}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), associated_tenants: [map], roles: [map], created_at: str(date-time), updated_at: str(date-time), email: str(email), first_name: str, last_name: str, attributes: map}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/tenants
@required {proj_id: str, env_id: str}
@optional {search: str, include_total_count: bool=false, page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/tenants
@required {proj_id: str, env_id: str, key: str, name: str}
@optional {description: str, attributes: map=[object Object]}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), last_action_at: str(date-time), name: str, description: str, attributes: map}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}
@required {tenant_id: str, proj_id: str, env_id: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), last_action_at: str(date-time), name: str, description: str, attributes: map}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}
@required {tenant_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}
@required {tenant_id: str, proj_id: str, env_id: str}
@optional {name: str, description: str, attributes: map=[object Object]}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), last_action_at: str(date-time), name: str, description: str, attributes: map}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users/{user_id}
@required {tenant_id: str, user_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/role_assignments/detailed
@required {proj_id: str, env_id: str}
@optional {user: [str], role: [str], tenant: [str], resource: str, resource_instance: str, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/role_assignments
@required {proj_id: str, env_id: str}
@optional {user: [str], role: [str], tenant: [str], resource: str, resource_instance: str, detailed: bool=false, include_total_count: bool=false, page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/role_assignments
@required {proj_id: str, env_id: str, role: str, user: str}
@optional {tenant: str, resource_instance: str}
@returns(200) {id: str(uuid), user: str, role: str, tenant: str, resource_instance: str, resource_instance_id: str(uuid), user_id: str(uuid), role_id: str(uuid), tenant_id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/role_assignments
@required {proj_id: str, env_id: str, role: str, tenant: str, user: str}
@optional {return_deleted: bool=false, resource_instance: str}
@returns(200) {id: str(uuid), user: str, role: str, tenant: str, resource_instance: str, resource_instance_id: str(uuid), user_id: str(uuid), role_id: str(uuid), tenant_id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time)}
@returns(204)
@errors {404, 422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/role_assignments/bulk
@required {proj_id: str, env_id: str}
@optional {missing_user_policy: any=fail}
@returns(200) {assignments_created: int}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/role_assignments/bulk
@required {proj_id: str, env_id: str}
@returns(200) {assignments_removed: int}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/set_rules
@required {proj_id: str, env_id: str}
@optional {user_set: str, permission: str, resource_set: str, page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/set_rules
@required {proj_id: str, env_id: str, user_set: str, permission: str, resource_set: str}
@optional {is_role: bool=false, is_resource: bool=false}
@returns(200)
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/set_rules
@required {proj_id: str, env_id: str, user_set: str, permission: str, resource_set: str}
@optional {is_role: bool=false, is_resource: bool=false}
@returns(204)
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/resource_instances/detailed
@required {proj_id: str, env_id: str}
@optional {tenant: str, resource: str, search: [str], page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/resource_instances
@required {proj_id: str, env_id: str}
@optional {tenant: str, resource: str, search: [str], detailed: bool=false, include_total_count: bool=false, page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/resource_instances
@required {proj_id: str, env_id: str, key: str, tenant: str, resource: str}
@optional {attributes: map=[object Object]}
@returns(200) {key: str, tenant: str, resource: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), resource_id: str(uuid), tenant_id: str(uuid), attributes: map, relationships: [map]}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/resource_instances/{instance_id}
@required {proj_id: str, env_id: str, instance_id: str}
@optional {detailed: bool=false}
@returns(200) {key: str, tenant: str, resource: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), resource_id: str(uuid), tenant_id: str(uuid), attributes: map, relationships: [map]}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/resource_instances/{instance_id}
@required {proj_id: str, env_id: str, instance_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/facts/{proj_id}/{env_id}/resource_instances/{instance_id}
@required {proj_id: str, env_id: str, instance_id: str}
@optional {attributes: map=[object Object]}
@returns(200) {key: str, tenant: str, resource: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), resource_id: str(uuid), tenant_id: str(uuid), attributes: map, relationships: [map]}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/proxy_configs
@required {proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/proxy_configs
@required {proj_id: str, env_id: str, secret: any, key: str, name: str}
@optional {mapping_rules: [map{url!: str, url_type: str, http_method!: any, resource!: str, headers: map, action: str, priority: int}]=, auth_mechanism: any=Bearer}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), secret: any, name: str, mapping_rules: [map], auth_mechanism: any}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/proxy_configs/{proxy_config_id}
@required {proxy_config_id: str, proj_id: str, env_id: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), secret: any, name: str, mapping_rules: [map], auth_mechanism: any}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/proxy_configs/{proxy_config_id}
@required {proxy_config_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/facts/{proj_id}/{env_id}/proxy_configs/{proxy_config_id}
@required {proxy_config_id: str, proj_id: str, env_id: str}
@optional {secret: any, name: str, mapping_rules: [map{url!: str, url_type: str, http_method!: any, resource!: str, headers: map, action: str, priority: int, should_delete: bool}]=, auth_mechanism: any=Bearer}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), secret: any, name: str, mapping_rules: [map], auth_mechanism: any}
@errors {422}

@endpoint PUT /v2/facts/{proj_id}/{env_id}/bulk/users
@required {proj_id: str, env_id: str, operations: [map{key!: str, email: str(email), first_name: str, last_name: str, attributes: map, role_assignments: [map]}]}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/bulk/users
@required {proj_id: str, env_id: str, operations: [map{key!: str, email: str(email), first_name: str, last_name: str, attributes: map, role_assignments: [map]}]}
@returns(200)
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/bulk/users
@required {proj_id: str, env_id: str, idents: [str]}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/bulk/tenants
@required {proj_id: str, env_id: str, operations: [map{key!: str, name!: str, description: str, attributes: map}]}
@returns(200)
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/bulk/tenants
@required {proj_id: str, env_id: str, idents: [str]}
@returns(200)
@errors {422}

@endpoint PUT /v2/facts/{proj_id}/{env_id}/bulk/resource_instances
@required {proj_id: str, env_id: str, operations: [map{key!: str, tenant!: str, resource!: str, attributes: map}]}
@returns(200)
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/bulk/resource_instances
@required {proj_id: str, env_id: str, idents: [str]}
@returns(200)
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/email_configurations
@required {proj_id: str, env_id: str}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/email_configurations
@required {proj_id: str, env_id: str}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/email_configurations/send_test_email
@required {proj_id: str, env_id: str}
@returns(200)
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/email_templates/
@required {proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/email_templates/{template_type}
@required {template_type: str, proj_id: str, env_id: str}
@returns(200) {template_type: any, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), from_address: str(email), redirect_to: str(uri), url_ttl: str, subject: str, messages: [map]}
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/email_templates/{template_type}
@required {template_type: str, proj_id: str, env_id: str, from_address: str(email), redirect_to: str(uri), url_ttl: str, subject: str, messages: [map{message_type!: any, message_content!: str}]}
@returns(200) {template_type: any, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), from_address: str(email), redirect_to: str(uri), url_ttl: str, subject: str, messages: [map]}
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/email_templates/{template_type}/send_test_email
@required {template_type: str, proj_id: str, env_id: str, from_address: str(email), redirect_to: str(uri), url_ttl: str, subject: str, messages: [map{message_type!: any, message_content!: str}]}
@returns(200)
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/relationship_tuples/detailed
@required {proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30, tenant: str, subject: str, relation: str, object: str, object_type: str, subject_type: str}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/relationship_tuples
@required {proj_id: str, env_id: str}
@optional {detailed: bool=false, include_total_count: bool=false, page: int=1, per_page: int=30, tenant: str, subject: str, relation: str, object: str, object_type: str, subject_type: str}
@returns(200)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/relationship_tuples
@required {proj_id: str, env_id: str, subject: str, relation: str, object: str}
@optional {tenant: str}
@returns(200) {subject: str, relation: str, object: str, id: str(uuid), tenant: str, subject_id: str(uuid), relation_id: str(uuid), object_id: str(uuid), tenant_id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), subject_details: any, relation_details: any, object_details: any, tenant_details: any}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/relationship_tuples
@required {proj_id: str, env_id: str, subject: str, relation: str, object: str}
@returns(204)
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/relationship_tuples/bulk
@required {proj_id: str, env_id: str, operations: [map{subject!: str, relation!: str, object!: str, tenant: str}]}
@returns(200)
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/relationship_tuples/bulk
@required {proj_id: str, env_id: str, idents: [map{subject!: str, relation!: str, object!: str}]}
@returns(200)
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/user_invites
@required {proj_id: str, env_id: str}
@optional {role: str, tenant: str, search: str, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/user_invites
@required {proj_id: str, env_id: str, key: str, status: any, email: str(email), first_name: str, last_name: str, role_id: str(uuid), tenant_id: str(uuid), resource_instance_id: str(uuid)}
@returns(200) {id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), key: str, status: any, email: str(email), first_name: str, last_name: str, role_id: str(uuid), tenant_id: str(uuid), resource_instance_id: str(uuid)}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id}
@required {user_invite_id: str, proj_id: str, env_id: str}
@returns(200) {id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), key: str, status: any, email: str(email), first_name: str, last_name: str, role_id: str(uuid), tenant_id: str(uuid), resource_instance_id: str(uuid)}
@errors {422}

@endpoint DELETE /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id}
@required {user_invite_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint PATCH /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id}
@required {user_invite_id: str, proj_id: str, env_id: str, key: str, status: any, email: str(email), first_name: str, last_name: str, role_id: str(uuid), tenant_id: str(uuid), resource_instance_id: str(uuid)}
@returns(200) {id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), key: str, status: any, email: str(email), first_name: str, last_name: str, role_id: str(uuid), tenant_id: str(uuid), resource_instance_id: str(uuid)}
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id}/approve
@required {user_invite_id: str, proj_id: str, env_id: str, email: str(email), key: str, attributes: map}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), associated_tenants: [map], roles: [map], created_at: str(date-time), updated_at: str(date-time), email: str(email), first_name: str, last_name: str, attributes: map}
@errors {400, 422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/access_requests/{elements_config_id}/user/{user_id}/tenant/{tenant_id}
@required {tenant_id: str, user_id: str, elements_config_id: str, proj_id: str, env_id: str}
@optional {status: any, role: str, resource: str, page: int=1, per_page: int=30, resource_instance_id: str}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/facts/{proj_id}/{env_id}/access_requests/{elements_config_id}/user/{user_id}/tenant/{tenant_id}
@required {tenant_id: str, user_id: str, proj_id: str, env_id: str, elements_config_id: str, access_request_details: any}
@optional {reason: str}
@returns(200) {access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, reviewer_comment: str, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint GET /v2/facts/{proj_id}/{env_id}/access_requests/{elements_config_id}/user/{user_id}/tenant/{tenant_id}/{access_request_id}
@required {access_request_id: str, tenant_id: str, user_id: str, proj_id: str, env_id: str, elements_config_id: str}
@returns(200) {access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, reviewer_comment: str, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PATCH /v2/facts/{proj_id}/{env_id}/access_requests/{elements_config_id}/user/{user_id}/tenant/{tenant_id}/{access_request_id}/reviewer
@required {access_request_id: str, tenant_id: str, user_id: str, proj_id: str, env_id: str, elements_config_id: str}
@optional {reviewer_comment: str, role: str}
@returns(200) {access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, reviewer_comment: str, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/facts/{proj_id}/{env_id}/access_requests/{elements_config_id}/user/{user_id}/tenant/{tenant_id}/{access_request_id}/approve
@required {access_request_id: str(uuid), tenant_id: str, user_id: str, proj_id: str, env_id: str, elements_config_id: str}
@optional {reviewer_comment: str, role: str}
@returns(200) {reviewer_comment: str, access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/facts/{proj_id}/{env_id}/access_requests/{elements_config_id}/user/{user_id}/tenant/{tenant_id}/{access_request_id}/deny
@required {access_request_id: str, tenant_id: str, user_id: str, proj_id: str, env_id: str, elements_config_id: str}
@optional {reviewer_comment: str}
@returns(200) {reviewer_comment: str, access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/facts/{proj_id}/{env_id}/access_requests/{elements_config_id}/user/{user_id}/tenant/{tenant_id}/{access_request_id}/cancel
@required {access_request_id: str, tenant_id: str, user_id: str, proj_id: str, env_id: str, elements_config_id: str}
@returns(200) {reviewer_comment: str, access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endgroup

@group pdps
@endpoint GET /v2/pdps/{proj_id}/{env_id}/configs
@required {proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint GET /v2/pdps/{proj_id}/{env_id}/configs/{pdp_id}/values
@required {proj_id: str, env_id: str, pdp_id: str(uuid)}
@optional {X-Shard-ID: int}
@returns(200) {opal_common: map{FETCHING_CALLBACK_TIMEOUT: int, AUTH_PUBLIC_KEY: str}, opal_client: map{DATA_TOPICS: [str], CLIENT_TOKEN: str, SERVER_URL: str, SERVER_WS_URL: str, SERVER_PUBSUB_URL: str, DEFAULT_DATA_SOURCES_CONFIG_URL: str, SCOPE_ID: str, SHOULD_REPORT_ON_DATA_UPDATES: bool, DEFAULT_UPDATE_CALLBACKS: map{callbacks: [any]}, DEFAULT_UPDATE_CALLBACK_CONFIG: map{fetcher: str, headers: map, is_json: bool, process_data: bool, method: any, data: any}}, pdp: any, context: map{customer_id: str(uuid), client_id: str, backend_tier: str(uri), component: str, org_id: str(uuid), project_id: str(uuid), env_id: str(uuid)}}
@errors {422}

@endpoint PUT /v2/pdps/{proj_id}/{env_id}/configs/{pdp_id}/debug-audit-logs/enable
@required {proj_id: str, env_id: str, pdp_id: str(uuid)}
@returns(200) {id: str(uuid), name: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), client_secret: str, opal_server_access_token: str, num_shards: int, debug_audit_logs: bool, min_pdp_version: str}
@errors {422}

@endpoint PUT /v2/pdps/{proj_id}/{env_id}/configs/{pdp_id}/debug-audit-logs/disable
@required {proj_id: str, env_id: str, pdp_id: str(uuid)}
@returns(200) {id: str(uuid), name: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), client_secret: str, opal_server_access_token: str, num_shards: int, debug_audit_logs: bool, min_pdp_version: str}
@errors {422}

@endpoint POST /v2/pdps/{proj_id}/{env_id}/configs/{pdp_id}/rotate-api-key
@required {proj_id: str, env_id: str, pdp_id: str(uuid)}
@returns(200) {id: str(uuid), name: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), client_secret: str, opal_server_access_token: str, num_shards: int, debug_audit_logs: bool, min_pdp_version: str}
@errors {422}

@endpoint POST /v2/pdps/{proj_id}/{env_id}/configs/migrate-shards
@required {proj_id: str, env_id: str, num_shards: int}
@returns(200) {id: str(uuid), name: str, organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), client_secret: str, opal_server_access_token: str, num_shards: int, debug_audit_logs: bool, min_pdp_version: str}
@errors {422}

@endpoint GET /v2/pdps/{proj_id}/{env_id}/audit_logs
@required {proj_id: str, env_id: str}
@optional {pdp_id: str(uuid), users: [str], decision: bool, resources: [str], tenant: str, action: str, timestamp_from: int, timestamp_to: int, sort_by: any=timestamp, query: any=check, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int, pagination_count: int}
@errors {400, 422}

@endpoint GET /v2/pdps/{proj_id}/{env_id}/audit_logs/{log_id}
@required {log_id: str(uuid), proj_id: str, env_id: str}
@returns(200) {id: str(uuid), raw_data: any, timestamp: str(date-time), created_at: str(date-time), query: str, user_key: str, user_email: str, user_name: str, resource_type: str, tenant: str, action: str, decision: bool, reason: str, org_id: str(uuid), project_id: str(uuid), env_id: str(uuid), pdp_config_id: str(uuid), input: any, result: any, context: any, objects: any}
@errors {422}

@endgroup

@group projects
@endpoint GET /v2/projects/{proj_id}/repos
@required {proj_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/projects/{proj_id}/repos
@required {proj_id: str, key: str, url: str, credentials: map{auth_type: str, username!: str, public_key: str, private_key!: str}}
@optional {main_branch_name: str=main, activate_when_validated: bool=false}
@returns(200) {id: str(uuid), status: str, key: str, url: str, main_branch_name: str, credentials: map{auth_type: str, username: str, public_key: str, private_key: str}, activate_when_validated: bool}
@errors {422}

@endpoint GET /v2/projects/{proj_id}/repos/active
@required {proj_id: str}
@returns(200) {id: str(uuid), status: str, key: str, url: str, main_branch_name: str, credentials: map{auth_type: str, username: str, public_key: str, private_key: str}, activate_when_validated: bool}
@errors {422}

@endpoint PUT /v2/projects/{proj_id}/repos/disable
@required {proj_id: str}
@returns(200) {key: str, urn_namespace: str, id: str(uuid), organization_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/projects/{proj_id}/repos/{repo_id}/activate
@required {proj_id: str, repo_id: str}
@returns(200) {key: str, urn_namespace: str, id: str(uuid), organization_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), name: str, description: str, settings: map, active_policy_repo_id: str(uuid)}
@errors {400, 422}

@endpoint GET /v2/projects/{proj_id}/repos/{repo_id}
@required {proj_id: str, repo_id: str}
@returns(200) {id: str(uuid), status: str, key: str, url: str, main_branch_name: str, credentials: map{auth_type: str, username: str, public_key: str, private_key: str}, activate_when_validated: bool}
@errors {422}

@endpoint DELETE /v2/projects/{proj_id}/repos/{repo_id}
@required {proj_id: str, repo_id: str}
@returns(204)
@errors {422}

@endgroup

@group elements
@endpoint GET /v2/elements/{proj_id}/{env_id}/config
@required {proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/elements/{proj_id}/{env_id}/config
@required {proj_id: str, env_id: str, key: str, name: str, elements_type: any, settings: map, roles_to_levels: map}
@optional {email_notifications: bool=false, webhook: map{type: str, url!: str, bearer_token: str}}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), is_active: bool, name: str, elements_type: any, settings: map, email_notifications: bool, roles_to_levels: map, webhook: map{type: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), url: str}}
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}
@required {elements_config_id: str, proj_id: str, env_id: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), is_active: bool, name: str, elements_type: any, settings: map, email_notifications: bool, roles_to_levels: map, webhook: map{type: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), url: str}}
@errors {422}

@endpoint PATCH /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}
@required {elements_config_id: str, proj_id: str, env_id: str, roles_to_levels: map}
@optional {name: str, elements_type: any, settings: map, email_notifications: bool=false, webhook: map{url: str, bearer_token: str}}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), is_active: bool, name: str, elements_type: any, settings: map, email_notifications: bool, roles_to_levels: map, webhook: map{type: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), url: str}}
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/runtime
@required {elements_config_id: str, proj_id: str, env_id: str}
@optional {resource_instance_id: str}
@returns(200) {config: map{key: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), is_active: bool, name: str, elements_type: any, settings: map, email_notifications: bool, roles_to_levels: map, webhook: map{type: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), url: str}}, current_permission_level: str}
@errors {422}

@endpoint DELETE /v2/elements/{proj_id}/{env_id}/{elements_config_id}
@required {elements_config_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users
@required {elements_config_id: str, proj_id: str, env_id: str}
@optional {search: str, page: int=1, per_page: int=30, resource_instance_id: str}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users
@required {elements_config_id: str, proj_id: str, env_id: str, key: str}
@optional {resource_instance_id: str, email: str(email), first_name: str, last_name: str, attributes: map=[object Object], role_assignments: [map{role!: str, tenant: str, resource_instance: str}], role: str}
@returns(200)
@errors {422}

@endpoint DELETE /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users/{user_id}
@required {proj_id: str, env_id: str, elements_config_id: str, user_id: str}
@optional {resource_instance_id: str}
@returns(204)
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/user-invites
@required {elements_config_id: str, proj_id: str, env_id: str}
@optional {search: str, status: any, page: int=1, per_page: int=30, resource_instance_id: str}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/roles
@required {elements_config_id: str, proj_id: str, env_id: str}
@optional {search: str, page: int=1, per_page: int=30, resource_instance_id: str}
@returns(200)
@errors {422}

@endpoint POST /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users/{user_id}/roles
@required {elements_config_id: str, user_id: str, proj_id: str, env_id: str, role: str}
@optional {resource_instance_id: str}
@returns(200) {id: str(uuid), user: str, role: str, tenant: str, resource_instance: str, resource_instance_id: str(uuid), user_id: str(uuid), role_id: str(uuid), tenant_id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/users/{user_id}/roles
@required {elements_config_id: str, user_id: str, proj_id: str, env_id: str, role: str}
@optional {resource_instance_id: str}
@returns(204)
@errors {422}

@endpoint POST /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/active
@required {elements_config_id: str, proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/data/audit_logs
@required {proj_id: str, env_id: str, elements_config_id: str}
@optional {search: str, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int, pagination_count: int}
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/access_requests
@required {elements_config_id: str, proj_id: str, env_id: str}
@optional {status: any, tenant: str, role: str, resource: str, page: int=1, per_page: int=30, resource_instance_id: str}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/access_requests
@required {elements_config_id: str, proj_id: str, env_id: str, access_request_details: any}
@optional {reason: str}
@returns(200) {access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, reviewer_comment: str, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/access_requests/{access_request_id}
@required {elements_config_id: str, access_request_id: str, proj_id: str, env_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200) {access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, reviewer_comment: str, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PATCH /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/access_requests/{access_request_id}/reviewer
@required {access_request_id: str, proj_id: str, env_id: str, elements_config_id: str}
@optional {reviewer_comment: str, role: str}
@returns(200) {access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, reviewer_comment: str, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/access_requests/{access_request_id}/approve
@required {access_request_id: str(uuid), proj_id: str, env_id: str, elements_config_id: str}
@optional {reviewer_comment: str, role: str}
@returns(200) {reviewer_comment: str, access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/access_requests/{access_request_id}/deny
@required {access_request_id: str, proj_id: str, env_id: str, elements_config_id: str}
@optional {reviewer_comment: str}
@returns(200) {reviewer_comment: str, access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/access_requests/{access_request_id}/cancel
@required {access_request_id: str, proj_id: str, env_id: str, elements_config_id: str}
@returns(200) {reviewer_comment: str, access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/operation_approval
@required {proj_id: str, env_id: str, elements_config_id: str}
@optional {status: any, resource: str, resource_instance: str, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint POST /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/operation_approval
@required {proj_id: str, env_id: str, elements_config_id: str, access_request_details: any}
@optional {reason: str}
@returns(200) {access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, reviewer_comment: str, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint GET /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/operation_approval/{operation_approval_id}
@required {operation_approval_id: str, proj_id: str, env_id: str, elements_config_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200) {access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, reviewer_comment: str, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PATCH /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/operation_approval/{operation_approval_id}/reviewer
@required {operation_approval_id: str, proj_id: str, env_id: str, elements_config_id: str}
@optional {reviewer_comment: str}
@returns(200) {access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, reviewer_comment: str, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/operation_approval/{operation_approval_id}/approve
@required {operation_approval_id: str, proj_id: str, env_id: str, elements_config_id: str}
@optional {reviewer_comment: str}
@returns(200) {reviewer_comment: str, access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/operation_approval/{operation_approval_id}/deny
@required {operation_approval_id: str, proj_id: str, env_id: str, elements_config_id: str}
@optional {reviewer_comment: str}
@returns(200) {reviewer_comment: str, access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endpoint PUT /v2/elements/{proj_id}/{env_id}/config/{elements_config_id}/operation_approval/{operation_approval_id}/cancel
@required {operation_approval_id: str, proj_id: str, env_id: str, elements_config_id: str}
@returns(200) {reviewer_comment: str, access_request_details: any, reason: str, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time), requesting_user_id: str(uuid), reviewed_at: str(date-time), type: any, status: any, reviewer_user_id: str(uuid)}
@errors {422}

@endgroup

@group deprecated
@endpoint GET /v2/deprecated/history
@optional {method: [str], path: [str], success: bool, status_code: [int], client_ip: [str], actor_type: [str], actor_id: [str], actor_display_name: str, project_id: [str], env_id: [str], timestamp_from: int, timestamp_until: int, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/deprecated/history/{event_id}
@required {event_id: str(uuid)}
@returns(200) {request_body: str(binary), response_body: str(binary), timestamp: str(date-time), timestamp_utc: str(date-time), method: str, path: str, success: bool, status: int, request_id: str(uuid), client_ip: str, actor_type: str, actor_id: str(uuid), actor_display_name: str, org_id: str(uuid), project_key: str, project_id: str(uuid), env_key: str, env_id: str(uuid), id: str(uuid)}
@errors {422}

@endpoint GET /v2/deprecated/history/{event_id}/request
@required {event_id: str(uuid)}
@returns(200)
@errors {422}

@endpoint GET /v2/deprecated/history/{event_id}/response
@required {event_id: str(uuid)}
@returns(200)
@errors {422}

@endgroup

@group history
@endpoint GET /v2/history
@optional {method: [str], path: [str], success: bool, status_code: [int], client_ip: [str], actor_type: [str], actor_id: [str], actor_display_name: str, project_id: [str], env_id: [str], timestamp_from: int, timestamp_until: int, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int, pagination_count: int}
@errors {422}

@endpoint GET /v2/history/{event_id}
@required {event_id: str(uuid)}
@returns(200) {request_body: str(binary), response_body: str(binary), timestamp: str(date-time), timestamp_utc: str(date-time), method: str, path: str, success: bool, status: int, request_id: str(uuid), client_ip: str, actor_type: str, actor_id: str(uuid), actor_display_name: str, org_id: str(uuid), project_key: str, project_id: str(uuid), env_key: str, env_id: str(uuid), id: str(uuid)}
@errors {422}

@endpoint GET /v2/history/{event_id}/request
@required {event_id: str(uuid)}
@returns(200)
@errors {422}

@endpoint GET /v2/history/{event_id}/response
@required {event_id: str(uuid)}
@returns(200)
@errors {422}

@endgroup

@group activity
@endpoint GET /v2/activity
@optional {actor_id: [str], actor_display_name: str, actor_type: [str], project_id: [str], env_id: [str], timestamp_from: int, timestamp_until: int, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int, pagination_count: int}
@errors {422}

@endpoint GET /v2/activity/types
@returns(200)
@errors {422}

@endgroup

@group deprecated
@endpoint GET /v2/deprecated/activity
@optional {actor_id: [str], actor_display_name: str, actor_type: [str], project_id: [str], env_id: [str], timestamp_from: int, timestamp_until: int, page: int=1, per_page: int=30}
@returns(200) {data: [map], total_count: int, page_count: int}
@errors {422}

@endpoint GET /v2/deprecated/activity/types
@returns(200)
@errors {422}

@endgroup

@group policy_guards
@endpoint GET /v2/policy_guards/scopes
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/policy_guards/scopes
@required {key: str}
@optional {policy_guard_scope_details: [map{project_id!: str}]=}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), policy_guard_scope_details: [map]}
@errors {422}

@endpoint GET /v2/policy_guards/scopes/{policy_guard_scope_id}
@required {policy_guard_scope_id: str}
@returns(200) {key: str, id: str(uuid), organization_id: str(uuid), policy_guard_scope_details: [map]}
@errors {422}

@endpoint DELETE /v2/policy_guards/scopes/{policy_guard_scope_id}
@required {policy_guard_scope_id: str}
@returns(204)
@errors {422}

@endpoint POST /v2/policy_guards/scopes/{policy_guard_scope_id}/associate
@required {policy_guard_scope_id: str, project_id: str}
@optional {wait: num=0}
@returns(200) {task_id: str, status: any, result: any, error: any}
@errors {422}

@endpoint DELETE /v2/policy_guards/scopes/{policy_guard_scope_id}/disassociate
@required {policy_guard_scope_id: str, project_id: str}
@returns(204)
@errors {422}

@endpoint GET /v2/policy_guards/scopes/{policy_guard_scope_id}/rules
@required {policy_guard_scope_id: str}
@optional {page: int=1, per_page: int=30}
@returns(200)
@errors {422}

@endpoint POST /v2/policy_guards/scopes/{policy_guard_scope_id}/rules
@required {policy_guard_scope_id: str, is_allowed: bool, resource_key: str, action_key: str}
@optional {wait: num=0, role_key: str, resource_set: any, user_set: any}
@returns(200) {task_id: str, status: any, result: any, error: any}
@errors {422}

@endpoint DELETE /v2/policy_guards/scopes/{policy_guard_scope_id}/rules
@required {policy_guard_scope_id: str, resource_key: str, action_key: str}
@optional {role_key: str, resource_set: any, user_set: any}
@returns(204)
@errors {422}

@endgroup

@group projects
@endpoint GET /v2/projects/{proj_id}/{env_id}/opal_scope
@required {proj_id: str, env_id: str}
@returns(200) {data: map{entries: [map]}, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint PUT /v2/projects/{proj_id}/{env_id}/opal_scope
@required {proj_id: str, env_id: str}
@optional {data: map{entries: [map]}}
@returns(200) {data: map{entries: [map]}, id: str(uuid), organization_id: str(uuid), project_id: str(uuid), environment_id: str(uuid), created_at: str(date-time), updated_at: str(date-time)}
@errors {422}

@endpoint DELETE /v2/projects/{proj_id}/{env_id}/opal_scope
@required {proj_id: str, env_id: str}
@returns(204)
@errors {422}

@endgroup

@group audit-log-replay
@endpoint POST /v2/audit-log-replay
@required {pdp_url: str}
@optional {start_time: int, end_time: int, concurrency_limit: int=10, graceful_shutdown_s: int=60}
@returns(202) {message: str, document_count: int}
@errors {422}

@endgroup

@group internal
@endpoint GET /v2/internal/opal_data/{org_id}/{proj_id}/{env_id}/optimized
@required {org_id: str(uuid), proj_id: str, env_id: str}
@optional {X-Shard-ID: int}
@returns(200) {use_debugger: bool, users: map, tenants: map, roles: map, condition_set_rules: map, condition_set_rules_expand: map, relationships: map, resource_types: map, condition_sets: map, role_assignments: map, role_permissions: map, mapping_rules: map, resource_instances: map}
@errors {422}

@endpoint GET /v2/internal/opal_data/{org_id}/{proj_id}/{env_id}
@required {org_id: str(uuid), proj_id: str, env_id: str}
@optional {timeout: num=600, X-Shard-ID: int}
@returns(200)
@errors {422}

@endpoint GET /v2/internal/opal_data/{org_id}/{proj_id}/{env_id}/users
@required {org_id: str(uuid), proj_id: str, env_id: str}
@optional {timeout: num=600, X-Shard-ID: int}
@returns(200)
@errors {422}

@endpoint GET /v2/internal/opal_data/{org_id}/{proj_id}/{env_id}/role_assignments
@required {org_id: str(uuid), proj_id: str, env_id: str}
@optional {timeout: num=600, X-Shard-ID: int}
@returns(200)
@errors {422}

@endpoint GET /v2/internal/opal_data/{org_id}/{proj_id}/{env_id}/resource_instances
@required {org_id: str(uuid), proj_id: str, env_id: str}
@optional {timeout: num=600, X-Shard-ID: int}
@returns(200)
@errors {422}

@endpoint GET /v2/internal/opal_data/{org_id}/{proj_id}/{env_id}/relationships
@required {org_id: str(uuid), proj_id: str, env_id: str}
@optional {timeout: num=600, X-Shard-ID: int}
@returns(200)
@errors {422}

@endgroup

@end
