Collection Assignments
Assign a collection to a person or a group, either to limit what they see to that collection or only to preselect it for them, and list or remove assignments.
An assignment gives a collection to a person (user) or a group (group) of the workspace. In mode enforced, the person sees only the documents of their enforced collections; in mode default, the collection is only preselected for them and they still see everything else they may see. Assigning the same person or group again changes the mode instead of failing.
Assignments decide who sees what, so changing them is Admin only, as in the web app: documents:write, and the key's person must be an Admin of the workspace; anyone else gets 403 insufficient_role. Listing assignments needs the read scope (or documents:read) and any member. The person or group must belong to the workspace, or the call answers 400.
/v1/collections/{id}/assignments/v1/collections/{id}/assignmentsBody parameters
user or group.enforced limits what they see to their enforced collections; default only preselects this one.Limit a person to one account
curl -X POST https://api.talonic.com/v1/collections/$COLLECTION_ID/assignments \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"principal_type": "user", "principal_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e", "mode": "enforced"}'/v1/collections/{id}/assignments/{assignmentId}enforced assignment narrows what the person sees everywhere, including through their own API keys. Check GET /v1/collections/mine with their key to confirm what they now see.