# Get Started

Effortlessly store and manage your JSON data with myJson's intuitive interface and powerful RESTful API!

{% hint style="warning" %}
myJson API V1 is deprecated. Please consider moving to the new [V2 API](https://docs.myjson.online/)
{% endhint %}

With our RESTful API, you can quickly create, retrieve and update JSON data ([record](/v1/terminology/record)). The nature of the RESTful API make it super easy to integrate with any programming language or platform.

Our platform is designed to be highly scalable and secure, providing you with the tools you need to store your JSON data with confidence.&#x20;

### Terminology

{% content-ref url="/pages/Z5OBomZWdNMtDzVTVEYI" %}
[Record](/v1/terminology/record)
{% endcontent-ref %}

{% content-ref url="/pages/9Z4X92KVb64cNvHuUaly" %}
[Collection](/v1/terminology/collection)
{% endcontent-ref %}

### Endpoints

{% content-ref url="/pages/PGeILWxmzbBbpTOgbTJR" %}
[Records](/v1/endpoints/records)
{% endcontent-ref %}


# Record

{% hint style="warning" %}
myJson API V1 is deprecated. Please consider moving to the new [V2 API](https://docs.myjson.online/)
{% endhint %}

A **record** is a self-contained unit of data that contains data in JSON format.

Each **record** can be thought of as a single document or object that encapsulates a particular set of data, which can be easily stored, queried, and manipulated.&#x20;

**Records** can be created, retrieved, updated, and deleted via our app's user interface or RESTful API, providing you with the flexibility and control you need to manage your data effectively. Using JSON data makes it easy to store and work with your information in a standardized and scalable format.

A **record** can either be privately or publicly accessible, depending on its parent [collection](/v1/terminology/collection). If a record is not assigned to a specific collection, it is publicly accessible by default.

{% hint style="danger" %}
**Public** record can be edited by anyone who have the record id.&#x20;
{% endhint %}


# Collection

{% hint style="warning" %}
myJson API V1 is deprecated. Please consider moving to the new [V2 API](https://docs.myjson.online/)
{% endhint %}

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.


# Records

The records route provides a flexible and powerful way to create, retrieve, update, and delete records within your app. The route is designed to be resource-oriented and follows standard HTTP verbs.

{% hint style="warning" %}
myJson API V1 is deprecated. Please consider moving to the new [V2 API](https://docs.myjson.online/)
{% endhint %}

### Create

## Create a record.

<mark style="color:green;">`POST`</mark> `https://api.myjson.online/v1/records`

#### Headers

| Name                                           | Type          | Description                      |
| ---------------------------------------------- | ------------- | -------------------------------- |
| x-collection-access-token                      | String        |                                  |
| Content-Type<mark style="color:red;">\*</mark> |               |                                  |
| x-record-metadata                              | true \| false | default to true, return metadata |

#### Request Body

| Name                                           | Type   | Description                                          |
| ---------------------------------------------- | ------ | ---------------------------------------------------- |
| jsonData<mark style="color:red;">\*</mark>     | JSON   | Your json data                                       |
| collectionId<mark style="color:red;">\*</mark> | String | myJson [`collection`](/v1/terminology/collection) id |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    data: JSON,
    id: String
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    error: "Bad Request",
    message: "Invalid request"
}
```

{% endtab %}
{% endtabs %}

```javascript
// Javascript example
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("x-collection-access-token", "YOUR_COLLECTION_ACCESS_TOKEN");

var urlencoded = new URLSearchParams();
urlencoded.append("jsonData", `{"firstName": "Tim", "lastName": "Cook"}`);
urlencoded.append("collectionId", "YOUR_COLLECTION_ID");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("https://api.myjson.online/v1/records", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

### Get

## Get a record

<mark style="color:blue;">`GET`</mark> `https://api.myjson.online/v1/records/:recordId`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| recordId<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name                                           | Type          | Description                      |
| ---------------------------------------------- | ------------- | -------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String        |                                  |
| x-collection-access-token                      | String        |                                  |
| x-record-metadata                              | true \| false | default to true, return metadata |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    data: JSON,
    id: String
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

```javascript
// Javascript example
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("x-collection-access-token", "YOUR_COLLECTION_ACCESS_TOKEN");

var requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://api.myjson.online/v1/records/YOUR_RECORD_ID", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
```

### Get by version

<mark style="color:blue;">`GET`</mark> `https://api.myjson.online/v1/records/:recordId/versions/:version`

Get a record version

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| recordId<mark style="color:red;">\*</mark> | String |             |
| version<mark style="color:red;">\*</mark>  | Number |             |

#### Headers

| Name                      | Type        | Description                      |
| ------------------------- | ----------- | -------------------------------- |
| x-collection-access-token | String      |                                  |
| x-record-metadata         | true\|false | default to true, return metadata |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}
{% endtabs %}

```javascript
// Javascript example
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("x-collection-access-token", "YOUR_COLLECTION_ACCESS_TOKEN");

var requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://api.myjson.online/v1/records/YOUR_RECORD_ID/versions/VERSION_NUMBER", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
```

### Update

## Update a record

<mark style="color:orange;">`PUT`</mark> `https://api.myjson.online/v1/records/:recordId`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| recordId<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name                                           | Type          | Description                      |
| ---------------------------------------------- | ------------- | -------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String        |                                  |
| x-collection-access-token                      | String        |                                  |
| x-record-metadata                              | true \| false | default to true, return metadata |

#### Request Body

| Name                                       | Type | Description |
| ------------------------------------------ | ---- | ----------- |
| jsonData<mark style="color:red;">\*</mark> | JSON |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    data: JSON,
    id: String
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

```javascript
// Javascript example
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("x-collection-access-token", "YOUR_COLLECTION_ACCESS_TOKEN");

var urlencoded = new URLSearchParams();
urlencoded.append("jsonData", `{"firstName": "Charles", "lastName": "Cook"}`);

var requestOptions = {
  method: 'PUT',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("https://api.myjson.online/v1/records/YOUR_RECORD_ID", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

## Patch

## Update specific property of the record

<mark style="color:purple;">`PATCH`</mark> `https://api.myjson.online/v1/records/:recordId`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| recordId<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name                                           | Type          | Description                      |
| ---------------------------------------------- | ------------- | -------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String        |                                  |
| x-collection-access-token                      | String        |                                  |
| x-record-metadata                              | true \| false | default to true, return metadata |

#### Request Body

| Name                                       | Type | Description |
| ------------------------------------------ | ---- | ----------- |
| jsonData<mark style="color:red;">\*</mark> | JSON |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    data: JSON,
    id: String
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

```javascript
// Javascript example
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("x-collection-access-token", "YOUR_COLLECTION_ACCESS_TOKEN");

var urlencoded = new URLSearchParams();
urlencoded.append("jsonData", `{"firstName": "Antoine"`);

var requestOptions = {
  method: 'PATCH',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("https://api.myjson.online/v1/records/YOUR_RECORD_ID", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

### Delete

## Delete a record

<mark style="color:red;">`DELETE`</mark> `https://api.myjson.online/v1/records/:recordId`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| recordId<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| Content-Type<mark style="color:red;">\*</mark> | String |             |
| x-collection-access-token                      | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    message: String
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

```javascript
// Javascript example
var myHeaders = new Headers();
myHeaders.append("x-collection-access-token", "YOUR_COLLECTION_ACCESS_TOKEN");

var urlencoded = new URLSearchParams();

var requestOptions = {
  method: 'DELETE',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("https://api.myjson.online/v1/records/YOUR_RECORD_ID", requestOptions)
  .then(response => response.jsont())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```


# Collections

The route is designed to be resource-oriented and follows standard HTTP verbs.

{% hint style="warning" %}
myJson API V1 is deprecated. Please consider moving to the new [V2 API](https://docs.myjson.online/)
{% endhint %}

## Get all records

## Return all records from the collection

<mark style="color:blue;">`GET`</mark> `https://api.myjson.online/v1/collections/:collectionId/records`

#### Path Parameters

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| collectionId<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name                      | Type          | Description                      |
| ------------------------- | ------------- | -------------------------------- |
| x-collection-access-token | String        |                                  |
| x-record-metadata         | true \| false | default to true, return metadata |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    records: [{ data, id }]
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    error: "Bad Request",
    message: "Invalid request"
}
```

{% endtab %}
{% endtabs %}

```javascript
// Javascript example
var myHeaders = new Headers();
myHeaders.append("x-collection-access-token", "YOUR_COLLECTION_ACCESS_TOKEN");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.myjson.online/v1/collections/YOUR_COLLECTION_ID/records", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

```


# Get Started

Effortlessly store and manage your JSON data with myJson's intuitive interface and powerful RESTful API!

With our RESTful API, you can quickly create, retrieve and update JSON data ([record](/terminology/record)). The nature of the RESTful API make it super easy to integrate with any programming language or platform.

Our platform is designed to be highly scalable and secure, providing you with the tools you need to store your JSON data with confidence.&#x20;

### Terminology

{% content-ref url="/pages/Z5OBomZWdNMtDzVTVEYI" %}
[Record](/terminology/record)
{% endcontent-ref %}

{% content-ref url="/pages/9Z4X92KVb64cNvHuUaly" %}
[Collection](/terminology/collection)
{% endcontent-ref %}

### Endpoints

{% content-ref url="/pages/PGeILWxmzbBbpTOgbTJR" %}
[Records](/endpoints/records)
{% endcontent-ref %}


# Record

A **record** is a self-contained unit of data that contains data in JSON format.

Each **record** can be thought of as a single document or object that encapsulates a particular set of data, which can be easily stored, queried, and manipulated.&#x20;

**Records** can be created, retrieved, updated, and deleted via our app's user interface or RESTful API, providing you with the flexibility and control you need to manage your data effectively. Using JSON data makes it easy to store and work with your information in a standardized and scalable format.

A **record** can either be privately or publicly accessible, depending on its parent [collection](/terminology/collection). If a record is not assigned to a specific collection, it is publicly accessible by default.

{% hint style="danger" %}
**Public** record can be edited by anyone who have the record id.&#x20;
{% endhint %}


# 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.


# Records

The records route provides a flexible and powerful way to create, retrieve, update, and delete records within your app. The route is designed to be resource-oriented and follows standard HTTP verbs.

## Create a new record

> Create a new record in a collection

```json
{"openapi":"3.1.0","info":{"title":"myJson API V2","version":"2.0.0"},"servers":[{"url":"https://api.myjson.online/v2","description":"Production server"}],"security":[{"CollectionAccessToken":[]}],"components":{"securitySchemes":{"CollectionAccessToken":{"type":"apiKey","in":"header","name":"x-collection-access-token","description":"Access token required for private collections (available on the specific collection's page)"}},"schemas":{"Record":{"type":"object","properties":{"data":{"type":"object","description":"The JSON data stored in the record"},"version":{"type":"integer"},"id":{"type":"string","format":"uuid"}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/records":{"post":{"summary":"Create a new record","description":"Create a new record in a collection","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["collectionId","data"],"properties":{"collectionId":{"type":"string","format":"uuid","description":"ID of the collection to create the record in"},"data":{"type":"object","description":"JSON object data to store in the record"},"metadata":{"type":"boolean","description":"Whether to include metadata in the response","default":true}}}}}},"responses":{"200":{"description":"Record created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient credit or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Collection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get a record

> Retrieve a record by its ID

```json
{"openapi":"3.1.0","info":{"title":"myJson API V2","version":"2.0.0"},"servers":[{"url":"https://api.myjson.online/v2","description":"Production server"}],"security":[{"CollectionAccessToken":[]}],"components":{"securitySchemes":{"CollectionAccessToken":{"type":"apiKey","in":"header","name":"x-collection-access-token","description":"Access token required for private collections (available on the specific collection's page)"}},"schemas":{"Record":{"type":"object","properties":{"data":{"type":"object","description":"The JSON data stored in the record"},"version":{"type":"integer"},"id":{"type":"string","format":"uuid"}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/records/{recordId}":{"get":{"summary":"Get a record","description":"Retrieve a record by its ID","parameters":[{"name":"metadata","in":"query","schema":{"type":"boolean","default":true},"description":"Whether to include metadata in the response"},{"name":"version","in":"query","schema":{"type":"integer"},"description":"Specific version of the record to retrieve"}],"responses":{"200":{"description":"Record retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient credit or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Update a record

> Update an existing record

```json
{"openapi":"3.1.0","info":{"title":"myJson API V2","version":"2.0.0"},"servers":[{"url":"https://api.myjson.online/v2","description":"Production server"}],"security":[{"CollectionAccessToken":[]}],"components":{"securitySchemes":{"CollectionAccessToken":{"type":"apiKey","in":"header","name":"x-collection-access-token","description":"Access token required for private collections (available on the specific collection's page)"}},"schemas":{"Record":{"type":"object","properties":{"data":{"type":"object","description":"The JSON data stored in the record"},"version":{"type":"integer"},"id":{"type":"string","format":"uuid"}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/records/{recordId}":{"put":{"summary":"Update a record","description":"Update an existing record","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["collectionId","data"],"properties":{"data":{"type":"object","description":"JSON object data to store in the record"},"metadata":{"type":"boolean","description":"Whether to include metadata in the response"}}}}}},"responses":{"200":{"description":"Record created/updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient credit or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Delete a record

> Remove a record permanently

```json
{"openapi":"3.1.0","info":{"title":"myJson API V2","version":"2.0.0"},"servers":[{"url":"https://api.myjson.online/v2","description":"Production server"}],"security":[{"CollectionAccessToken":[]}],"components":{"securitySchemes":{"CollectionAccessToken":{"type":"apiKey","in":"header","name":"x-collection-access-token","description":"Access token required for private collections (available on the specific collection's page)"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/records/{recordId}":{"delete":{"summary":"Delete a record","description":"Remove a record permanently","responses":{"200":{"description":"Record deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient credit or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Partially update a record

> Update specific fields of an existing record

```json
{"openapi":"3.1.0","info":{"title":"myJson API V2","version":"2.0.0"},"servers":[{"url":"https://api.myjson.online/v2","description":"Production server"}],"security":[{"CollectionAccessToken":[]}],"components":{"securitySchemes":{"CollectionAccessToken":{"type":"apiKey","in":"header","name":"x-collection-access-token","description":"Access token required for private collections (available on the specific collection's page)"}},"schemas":{"Record":{"type":"object","properties":{"data":{"type":"object","description":"The JSON data stored in the record"},"version":{"type":"integer"},"id":{"type":"string","format":"uuid"}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/records/{recordId}":{"patch":{"summary":"Partially update a record","description":"Update specific fields of an existing record","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","description":"JSON object data to update in the record"},"metadata":{"type":"boolean","description":"Whether to include metadata in the response"}}}}}},"responses":{"200":{"description":"Record updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient credit or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


# Collections

The route is designed to be resource-oriented and follows standard HTTP verbs.

## Get all records in a collection

> Retrieve all records belonging to a specific collection

```json
{"openapi":"3.1.0","info":{"title":"myJson API V2","version":"2.0.0"},"servers":[{"url":"https://api.myjson.online/v2","description":"Production server"}],"security":[{"CollectionAccessToken":[]}],"components":{"securitySchemes":{"CollectionAccessToken":{"type":"apiKey","in":"header","name":"x-collection-access-token","description":"Access token required for private collections (available on the specific collection's page)"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/collections/{collectionId}/records":{"get":{"summary":"Get all records in a collection","description":"Retrieve all records belonging to a specific collection","responses":{"200":{"description":"Records retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"data":{"type":"object","description":"The JSON data stored in the record"},"id":{"type":"string","format":"uuid","description":"Unique identifier of the record"},"version":{"type":"integer","description":"Version number of the record"}}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient credit or access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Collection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


