# Retrieve documents

{% openapi src="<https://2952947711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNqpTh7Mh66N0RnO0k24%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media&token=cbad765b-1613-4222-b591-9ae17a3b7cfa>" path="/documents/" method="get" %}
[rememberizer\_openapi.yml](https://2952947711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNqpTh7Mh66N0RnO0k24%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cbad765b-1613-4222-b591-9ae17a3b7cfa)
{% endopenapi %}

## Example Requests

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET \
  "https://api.rememberizer.ai/api/v1/documents/?page=1&page_size=20&integration_type=google_drive" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

{% hint style="info" %}
Replace `YOUR_JWT_TOKEN` with your actual JWT token.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const getDocuments = async (page = 1, pageSize = 20, integrationType = 'google_drive') => {
  const url = new URL('https://api.rememberizer.ai/api/v1/documents/');
  url.searchParams.append('page', page);
  url.searchParams.append('page_size', pageSize);
  if (integrationType) {
    url.searchParams.append('integration_type', integrationType);
  }
  
  const response = await fetch(url.toString(), {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  const data = await response.json();
  console.log(data);
};

getDocuments();
```

{% hint style="info" %}
Replace `YOUR_JWT_TOKEN` with your actual JWT token.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def get_documents(page=1, page_size=20, integration_type=None):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    params = {
        "page": page,
        "page_size": page_size
    }
    
    if integration_type:
        params["integration_type"] = integration_type
    
    response = requests.get(
        "https://api.rememberizer.ai/api/v1/documents/",
        headers=headers,
        params=params
    )
    
    data = response.json()
    print(data)

get_documents(integration_type="google_drive")
```

{% hint style="info" %}
Replace `YOUR_JWT_TOKEN` with your actual JWT token.
{% endhint %}
{% endtab %}
{% endtabs %}

## Request Parameters

| Parameter         | Type    | Description                                                                                            |
| ----------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| page              | integer | Page number for pagination. Default is 1.                                                              |
| page\_size        | integer | Number of items per page. Default is 10.                                                               |
| integration\_type | string  | Filter documents by integration type. Options: google\_drive, slack, dropbox, gmail, common\_knowledge |

## Response Format

```json
{
  "count": 257,
  "next": "https://api.rememberizer.ai/api/v1/documents/?page=2&page_size=20&integration_type=google_drive",
  "previous": null,
  "results": [
    {
      "document_id": "1aBcD2efGhIjK3lMnOpQrStUvWxYz",
      "name": "Project Proposal.docx",
      "type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      "path": "/Documents/Projects/Proposal.docx",
      "url": "https://drive.google.com/file/d/1aBcD2efGhIjK3lMnOpQrStUvWxYz/view",
      "id": 12345,
      "integration_type": "google_drive",
      "source": "user@example.com",
      "status": "indexed",
      "indexed_on": "2023-06-15T10:30:00Z",
      "size": 250000
    },
    // ... more documents
  ]
}
```

## Available Integration Types

| Integration Type  | Description                   |
| ----------------- | ----------------------------- |
| google\_drive     | Documents from Google Drive   |
| slack             | Messages and files from Slack |
| dropbox           | Files from Dropbox            |
| gmail             | Emails from Gmail             |
| common\_knowledge | Public knowledge sources      |

This endpoint retrieves a list of documents from your connected data sources. You can filter by integration type to focus on specific sources.
