# Get collections

To get collections via API, a user needs to get the **process\_id** from one of the following sources:

* [Get process](https://alphamoon.gitbook.io/documentation/~/changes/E5WHATIwrsF0u91xTwvD/api/get-processes)[es](https://alphamoon.gitbook.io/documentation/~/changes/E5WHATIwrsF0u91xTwvD/api/get-processes) endpoint
* Create process endpoint
* URL\
  **e.g.** <https://workspace.alphamoon.ai/queue/**2080d36bf94c4147b2e543104342fc2f>\*\*

### Get collections endpoint

The following endpoint returns the list of collections along with **collection\_id**s:

## Get collections

<mark style="color:blue;">`GET`</mark> `/api/v0.3/processes/{process_id}/collections`

#### Path Parameters

| Name                                          | Type   | Description           |
| --------------------------------------------- | ------ | --------------------- |
| process\_id<mark style="color:red;">\*</mark> | String | The ID of the process |

#### Query Parameters

| Name       | Type   |
| ---------- | ------ |
| limit      | String |
| order      | String |
| query      | String |
| date\_from | String |
| date\_to   | String |
| priority   | String |
| status     | String |

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

```json
{
  "collections": [
    {
      "id": "5c8c5791635c44c4b74e08fd5e79163c",
      "name": "Invoice example.pdf",
      "files": [
        {
          "id": "b59ef112be5641cdadf9f9e81a13f0d6",
          "collectionId": "5c8c5791635c44c4b74e08fd5e79163c",
          "name": "Invoice example.pdf",
          "status": "Needs Review",
          "progress": 100,
          "numberOfPages": 1,
          "createdAt": "2023-07-13T12:16:33Z",
          "updatedAt": "2023-07-13T12:16:48Z",
          "metadata": {}
        }
      ],
      "priority": false,
      "split": false,
      "status": "Needs Review",
      "progress": 100,
      "numberOfPages": 1,
      "processId": "93580f176efb48cda64f25cba74d8ca4",
      "createdAt": "2023-07-13T12:16:33Z",
      "updatedAt": "2023-07-13T12:16:48Z",
      "metadata": {}
    }
  ],
  "pagination": {
    "offset": 0,
    "limit": 100,
    "total": 1
  }
} 
```

{% endtab %}

{% tab title="422: Unprocessable Entity Validation error" %}

```json
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="API call" %}

```bash
curl -X 'GET' \
  'https://workspace.alphamoon.ai/api/v0.3/processes/93580f176efb48cda64f25cba74d8ca4/collections?offset=0&limit=100&order=created_date%3Adesc' \
  -H 'accept: application/json' \
  -H 'Authorization: Basic API_KEY_BASE64_ENCODED'
```

{% endtab %}

{% tab title="Server response" %}

```json
{
  "collections": [
    {
      "id": "5c8c5791635c44c4b74e08fd5e79163c",
      "name": "Invoice example.pdf",
      "files": [
        {
          "id": "b59ef112be5641cdadf9f9e81a13f0d6",
          "collectionId": "5c8c5791635c44c4b74e08fd5e79163c",
          "name": "Invoice example.pdf",
          "status": "Needs Review",
          "progress": 100,
          "numberOfPages": 1,
          "createdAt": "2023-07-13T12:16:33Z",
          "updatedAt": "2023-07-13T12:16:48Z",
          "metadata": {}
        }
      ],
      "priority": false,
      "split": false,
      "status": "Needs Review",
      "progress": 100,
      "numberOfPages": 1,
      "processId": "93580f176efb48cda64f25cba74d8ca4",
      "createdAt": "2023-07-13T12:16:33Z",
      "updatedAt": "2023-07-13T12:16:48Z",
      "metadata": {}
    }
  ],
  "pagination": {
    "offset": 0,
    "limit": 100,
    "total": 1
  }
}
```

{% endtab %}
{% endtabs %}

:

#### See next:
