> ## Documentation Index
> Fetch the complete documentation index at: https://docs.forestreet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Market Collections

> Get all the collections that the current user is allowed to access.

A user can include markets in a market collection to categorise their list of markets they have access to. Any market
can only exists in a single collection at a time, and each user starts with a default collection that all markets will
belong to by default.

Collections are useful for users to group markets together for specific purposes, for example:

* markets that are generated for a specific project,
* markets that are reviewed by QA team,
* markets that are archived due to change in business needs.

This endpoints return all the collections that the user API Key has permission to access. Use this endpoint to fetch the
collection desired, before using the `collectionId` query parameter in selected endpoints to filter your results to the
given collection.

### Response

<ResponseExample>
  ```JSON theme={null}
  {
    "meta": {
        "totalItems": 2
    },
    "collections": [
        {
            "id": 411,
            "name": "Staging Markets",
            "description": "A collection of all unverified markets; this is the default location for all new markets.",
            "createdDate": "2022-12-11T10:09:08.000Z",
            "isDefault": 1
        },
        {
            "id": 123,
            "name": "Verified Market Archives",
            "description": "A collection of all manually validated markets.",
            "createdDate": "2022-01-01T02:03:04.000Z",
            "isDefault": 0
        }
    ]
  }
  ```
</ResponseExample>

<ResponseField name="meta" type="object">
  Pagination details and metadata about the search results.

  <Expandable title="meta">
    <ResponseField name="totalItems" type="number">
      The total number of collections returned by this endpoint.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="collections" type="array">
  An array of collections.

  **Default endpoint will always be the first item**, with the rest sorted by their
  \*creation dates in ascending order.

  <Expandable title="collection">
    Represents a single collection.

    <ResponseField name="id" type="number">
      The ID of the collection.

      This is the ID to be used as `collectionId` in selected endpoints.
    </ResponseField>

    <ResponseField name="name" type="string">
      The name of the collection.
    </ResponseField>

    <ResponseField name="description" type="string">
      The description of the collection.
    </ResponseField>

    <ResponseField name="createdDate" type="time">
      The creation date of the collection in ISO 8601 format.
    </ResponseField>
  </Expandable>
</ResponseField>
