POST /v1/tenants/{tenant_id}/permissions/lookup-entity
Lookup Entity answers subject-based authorization questions of the form: “Which documents can user:1 edit?” Instead of querying every entity in bulk, Permify first resolves the relations linked to the requested permission in the schema, then queries those relations for the given subject — significantly reducing the number of database queries required.
Results are returned as a paginated array of entity IDs. Use the continuous_token in the response to retrieve subsequent pages for large datasets.
Path Parameters
The tenant identifier. Use
t1 for single-tenant deployments. Must match ^([a-zA-Z0-9_\-@\.:+]{1,128}|\*)$.Request Body
The type of entity to look up (e.g.
document, repository). Must match ^[a-zA-Z_]{1,64}$.The permission or relation to evaluate (e.g.
edit, view). Must match ^[a-zA-Z_]{1,64}$.The subject for whom authorized entities are being looked up.
Contextual data for this request.
Number of entity IDs to return per page. Must be
>= 1.Pagination token returned by the previous response. Omit for the first page.
Response
List of entity IDs the subject has the requested permission on.
Pagination token for retrieving the next page. Empty when there are no more results.
Example
Error Codes
| HTTP Status | Description |
|---|---|
400 | Bad request — invalid fields |
401 | Unauthorized |
404 | Tenant not found |
429 | Rate limit exceeded |
500 | Internal server error |