Collection Management
Manage collections in R2R
Occasionally this SDK documentation falls out of date, cross-check with the automatically generated API Reference documentation for the latest parameters.
A collection in R2R is a logical grouping of users and documents that allows for efficient access control and organization. Collections enable you to manage permissions and access to documents at a collection level, rather than individually.
R2R provides a comprehensive set of collection features, allowing you to implement efficient access control and organization of users and documents in your applications.
Collection permissioning in R2R is still under development and as a result the API will likely evolve.
Collection Creation and Management
Create a Collection
Create a new collection with a name and optional description:
Get Collection Details
Retrieve details about a specific collection:
Update a Collection
Update a collection’s name or description:
List Collections
Get a list of all collections:
User Management in Collections
Add User to Collection
Add a user to a collection:
Remove User from Collection
Remove a user from a collection:
List Users in Collection
Get a list of all users in a specific collection:
Get User’s Collections
Get all collections that a user is a member of:
Document Management in Collections
Assign Document to Collection
Assign a document to a collection:
Remove Document from Collection
Remove a document from a collection:
List Documents in Collection
Get a list of all documents in a specific collection:
Get Document’s Collections
Get all collections that a document is assigned to:
Advanced Collection Management
Collection Overview
Get an overview of collections, including user and document counts:
Delete a Collection
Delete a collection:
Pagination and Filtering
Many collection-related methods support pagination and filtering:
Security Considerations
When implementing collection permissions, consider the following security best practices:
- Always use HTTPS in production to encrypt data in transit.
- Implement the principle of least privilege by assigning the minimum necessary permissions to users and collections.
- Regularly audit collection memberships and document assignments.
- Ensure that only authorized users (e.g., admins) can perform collection management operations.
- Implement comprehensive logging for all collection-related actions.
- Consider implementing additional access controls or custom roles within your application logic for more fine-grained permissions.
For more advanced use cases or custom implementations, refer to the R2R documentation or reach out to the community for support.