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

# All collections

You can use this endpoint to get all the collections you made in **Baag App**, like "New arrivals" or "Summer". It's handy for a menu or a row of categories on your website.

```method: GET theme={null}
https://api.baag.cc/v1/collections
```

## Authorization

All you need is your **API key** in the `Authorization` header.

<ParamField header="Authorization" type="string" required>
  `Bearer`, a space, then your API key. You can find it in **Baag App** → **Settings** → **Developers**.
</ParamField>

## Response

When everything goes well, you get back status `200` with all your collections in `data`, newest first:

```json theme={null}
{
  "data": [
    {
      "id": "cm8x2k1qv0003l70f9h2d5abc",
      "name": "New arrivals",
      "imageUrl": "https://…/new-arrivals.jpg"
    }
  ]
}
```

Here is what each part means:

* `id` is the collection's id. Keep it: you will need it to get the [collection's products](/collections/get).
* `imageUrl` is the collection's cover photo, or `null` when it has none.

<Note>Collections are part of the **Pro** plan. On the **Basic** plan, `data` is always an empty list.</Note>

## Error Responses

<AccordionGroup>
  <Accordion title="Missing API key">
    Returned with status `401` when the request has no `Authorization` header. Add your key as `Authorization: Bearer pk_live_xxxxxxxxx`.

    ```json theme={null}
    {
      "error": {
        "code": "missing_api_key",
        "message": "Send your API key as: Authorization: Bearer <key>."
      }
    }
    ```
  </Accordion>

  <Accordion title="Invalid API key">
    Returned with status `401` when the key is wrong, or it was regenerated in **Baag App**. Copy your key again from **Settings** → **Developers**.

    ```json theme={null}
    {
      "error": {
        "code": "invalid_api_key",
        "message": "That API key isn't valid. It may have been regenerated."
      }
    }
    ```
  </Accordion>

  <Accordion title="Plan required">
    Returned with status `403` when your store's plan doesn't include the API. Your key works again as soon as your store is on the **Basic** or **Pro** plan.

    ```json theme={null}
    {
      "error": {
        "code": "plan_required",
        "message": "This store's plan doesn't include API access."
      }
    }
    ```
  </Accordion>

  <Accordion title="Rate limited">
    Returned with status `429` when your key sent too many requests in a short time. Wait a moment, then try again.

    ```json theme={null}
    {
      "error": {
        "code": "rate_limited",
        "message": "Too many requests. Slow down and try again shortly."
      }
    }
    ```
  </Accordion>

  <Accordion title="Internal error">
    Returned with status `500` when something went wrong on Baag's side. It's not your fault. Wait a moment, then try again.

    ```json theme={null}
    {
      "error": {
        "code": "internal_error",
        "message": "Something went wrong on our side. Please try again."
      }
    }
    ```
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.