# Collections

## 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"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.myjson.online/endpoints/collections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
