Change who may access an entity
POST /Platform/entities/{entity_type}/{entity_id}/acl
Change who may access an entity. ACL changes are main-only.
Every action writes an audit commit and rewrites the ACL across all of the entity's existing rows on every branch, so restricting an entity also un-publishes its earlier commits.
Referential integrity is enforced fail-loud in both directions and there is no force: widening is refused while a referenced child is not readable by the new readers, and restricting is refused while a referencing parent's readers would lose access. The error names the blockers — widen the children, or detach/tighten the parents, first.
Path parameters
entity_type: str. Entity class name.entity_id: str. Entity id.
Body parameters
action: "share" or "unshare" or "set" or "private" or "org_visible" or 2 more. One ofshare(grant one principal, needsuser),unshare(remove one principal, needsuser),set(set both lists exactly fromacl/acl_write),private(restrict to the owner alone),org_visible(clear both lists back to org-wide),lock(empty the write list: read-only for everyone except the owner and the system principal; readers unchanged),unlock(restore writers = readers; only the owner or system passes the write check on a locked entity, so a non-owner cannot unlock).user: optional str. Principal forshare/unshare.acl: optional List[Any]. Read list forset; omit for org-visible.acl_write: optional List[Any]. Write list forset; omit for writers = readers.mode: optional "read" or "write". Forshareonly —readorwrite.
Returns
EntityAclResponse
entity_type: optional str or null. Entity class name.entity_id: optional str or null. Entity id.acl: optional List[str] or null. Principals who may read, besides the owner; None means everyone in the organization.acl_write: optional List[str] or null. Principals who may write; None means the same as the readers.owner: optional str or null. Principal that created the entity.can_write: optional bool. Whether the calling principal may write.locked: optional bool. True when only the owner and the system may write.commit_id: optional str or null. Audit commit written by an ACL change.
Example request
curl -X POST "https://api.hilus.ai/Platform/entities/{entity_type}/{entity_id}/acl" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'