Taofiq Aiyelabegan
12/09/2025, 10:03 AMERROR:scripts.setup_rebac:Error setting up ReBAC structure: 'PermitApiClient' object has no attribute 'resource_relations
await permit_client.api.resource_relations.create(
"document",
{"key": "parent", "name": "Parent", "subject_resource": "department"},
)Ask Inkeep
12/09/2025, 10:03 AMAsk Inkeep
12/09/2025, 10:04 AMresource_relations as a property on the API client. Based on the Python SDK source, the correct usage is:
await permit.api.resource_relations.create(
"document",
{
"key": "parent",
"name": "Parent",
"subject_resource": "department",
}
)
(1)
Make sure you're using permit.api.resource_relations (not permit_client.api.resource_relations) , and that your permit object is properly initialized with the Permit SDK.
If you're still encountering this error, please share the following so our engineers can investigate:
1. Which Workspace / Project / Environment you're using
2. The full SDK initialization code you're using
3. Which PDP version you're running
4. Any relevant logs from your PDP
Also, ensure you have the latest version of the Python SDK installed:
pip install permit
(1) Ask Inkeep
12/09/2025, 10:04 AMTaofiq Aiyelabegan
12/09/2025, 10:05 AMfrom permit import Permit
permit_client = Permit(token=PERMIT_API_KEY, pdp=PERMIT_PDP_URL)
I am initializing the client hereTaofiq Aiyelabegan
12/09/2025, 10:05 AMfrom permit import Permit
permit_client = Permit(token=PERMIT_API_KEY, pdp=PERMIT_PDP_URL)
I am initializing the client here
@Ask InkeepAsk Inkeep
12/09/2025, 10:05 AMAsk Inkeep
12/09/2025, 10:05 AMresource_relations API is available in the Python SDK, but the error suggests you may be running an older version of the SDK that doesn't include this feature.
Try upgrading to the latest version:
pip install --upgrade permit
After upgrading, your code should work:
from permit import Permit
permit_client = Permit(token=PERMIT_API_KEY, pdp=PERMIT_PDP_URL)
await permit_client.api.resource_relations.create(
"document",
{"key": "parent", "name": "Parent", "subject_resource": "department"},
)
You can verify your installed version with:
pip show permit
If upgrading doesn't resolve the issue, please share:
1. Which Workspace / Project / Environment you're using
2. The exact SDK version you have installed (pip show permit)
3. Which PDP version you're running
4. Any relevant logs from your PDP
This will help our engineers investigate further.Ask Inkeep
12/09/2025, 10:06 AMAlon Boshi
12/09/2025, 10:08 AMTaofiq Aiyelabegan
12/09/2025, 10:09 AMAlon Boshi
12/09/2025, 10:09 AMTaofiq Aiyelabegan
12/09/2025, 10:10 AMAlon Boshi
12/09/2025, 10:29 AMpip show permit (or pip list) to confirm the current version.Taofiq Aiyelabegan
12/09/2025, 10:30 AMpermit==2.8.3 as i saw on PyPi and the method is getting called nowTaofiq Aiyelabegan
12/09/2025, 10:30 AMTaofiq Aiyelabegan
12/09/2025, 10:30 AMAlon Boshi
12/09/2025, 10:30 AM