# Collection

A **collection** is a group of records. The collection can either be [public](#public-collection) or [private](#private-collection).&#x20;

Access rules for a private **collection** are governed by access tokens, which can be assigned either read or write access, or both. Access to a private collection is restricted to those with a valid access token, providing an added layer of security and control over the data.&#x20;

The access rules for a collection apply to all of its records, which can be created, retrieved, updated, or deleted via our RESTful API.&#x20;

With **collections**, you can organize your records and control access to them in a scalable and flexible way.

{% hint style="info" %}
If a record is not assigned to a collection, it will be publicly accessible.
{% endhint %}

### Private collection <a href="#private-collection" id="private-collection"></a>

Private collections are an essential feature of myJson, providing a secure and granular way to manage access to your data. When you create a private collection, you can assign it an access token that controls who can read, write, or modify the collection's records.&#x20;

With private collections, you can share your data with trusted parties while keeping it protected from unauthorized access.&#x20;

### Public collection

Public collections are a powerful feature of our app, allowing you to share your data with a wider audience. When you create a public collection, anyone with the record ID can potentially read and edit the data it contains.&#x20;

This can be a great way to share information with a broad group of users or to make your data more easily accessible to third-party applications. However, it's important to remember that because public collections are accessible to anyone, you should carefully consider the sensitivity of the data you share through this method.&#x20;

We strongly recommend that you only use public collections for non-sensitive information.
