---
title: "Views and search | Docs | DMS by R&D Copilot"
description: "Which filters of listDocuments make a saved view, how to page through a list and how searchDocuments finds a document by its words."
canonical: "https://documents.rdcopilot.com/docs/concepts/views-and-search/"
language: en
updated: 2026-11-23
---

# Views and search

Which filters of `listDocuments` make a saved view, how to page through a list and how `searchDocuments` finds a document by its words.

A view is a set of filters on `listDocuments`, such as the documents that wait for you. `searchDocuments` finds documents by their words.

Documents that wait for your approval

curl

```bash
curl "$RDC_BASE_URL/documents/v1/documents?awaitingApprover=ioana-marin" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/documents/v1/documents?awaitingApprover=ioana-marin`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/documents/v1/documents?awaitingApprover=ioana-marin',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/documents/v1/documents?awaitingApprover=ioana-marin');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
    ],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/documents/v1/documents?awaitingApprover=ioana-marin");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 200

```json
{
  "items": [
    {
      "id": "af784fd4-dcdb-4ac4-9e0a-3f59571d40c9",
      "number": "DOC-2026-0401",
      "name": "Invoice BO-2026-0733",
      "class": "invoice",
      "counterpartyId": "f8888efb-9a9e-4556-82a4-687b8880629f",
      "counterparty": "Brânzeturi Obcina SRL",
      "project": "Purchasing",
      "owner": "sorin-avram",
      "date": "2026-11-19",
      "amount": "18940.50",
      "currency": "RON",
      "status": "in-review",
      "version": 1,
      "returned": false,
      "keepUntil": "2036-12-31",
      "changedAt": "2026-11-19T07:51:00Z",
      "approval": {
        "route": [
          "ioana-marin"
        ],
        "decisions": [],
        "next": "ioana-marin"
      },
      "signature": null,
      "readers": {
        "groups": [
          "finance",
          "purchasing"
        ],
        "people": [
          "sorin-avram",
          "ioana-marin"
        ]
      },
      "revision": 2
    }
  ],
  "nextCursor": null
}
```

## Filter the list

`listDocuments` returns the documents, the most recently changed first. Send several filters to narrow the list: a document must match every one.

| Filter | Keeps | Value |
| --- | --- | --- |
| `class` | Documents of one class. | `contract`, `invoice`, `offer` or `report` |
| `status` | Documents in one status. | `draft`, `in-review`, `approved`, `signed` or `archived` |
| `counterpartyId` | Documents with one counterparty. | The `id` of the counterparty. |
| `owner` | The documents of one owner. | The identifier of the person. |
| `awaitingApprover` | Documents in review that wait for this approver to decide. | The identifier of the approver. |
| `keepUntilBefore` | Documents whose keep-until date is on or before this day. | A day, `YYYY-MM-DD`. |

`awaitingApprover` names the next approver only. When a first approver approves, the document leaves that list and enters the list of the second.

## Saved views

A saved view is a request you keep and send again. These three cover most lists.

| View | Query |
| --- | --- |
| All documents | no filter |
| Awaiting my approval | `awaitingApprover=ioana-marin` |
| Expiring in 90 days | `status=archived&keepUntilBefore=2027-02-21` |

For the view that expires in 90 days, compute the day yourself: today plus 90 days, which is 2027-02-21 for a request sent on 2026-11-23.

Archived documents whose keep-until date falls in the next 90 days

curl

```bash
curl "$RDC_BASE_URL/documents/v1/documents?status=archived&keepUntilBefore=2027-02-21" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/documents/v1/documents?status=archived&keepUntilBefore=2027-02-21`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/documents/v1/documents?status=archived&keepUntilBefore=2027-02-21',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/documents/v1/documents?status=archived&keepUntilBefore=2027-02-21');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
    ],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/documents/v1/documents?status=archived&keepUntilBefore=2027-02-21");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 200

```json
{
  "items": [
    {
      "id": "3e6a4369-1e20-4d07-a2eb-c149cb1b3f41",
      "number": "DOC-2026-0393",
      "name": "Offer: harvest 2023 packaging",
      "class": "offer",
      "counterpartyId": "500ea9a4-e927-4423-8a69-e94d564a8be7",
      "counterparty": "Silozurile Zănești SRL",
      "project": "Imported archive",
      "owner": "andrei-pop",
      "date": "2023-11-15",
      "amount": "12500.00",
      "currency": "RON",
      "status": "archived",
      "version": 1,
      "returned": false,
      "keepUntil": "2026-12-31",
      "changedAt": "2026-03-02T09:02:00Z",
      "approval": {
        "route": [],
        "decisions": [],
        "next": null
      },
      "signature": null,
      "readers": {
        "groups": [
          "finance",
          "sales"
        ],
        "people": [
          "andrei-pop"
        ]
      },
      "revision": 1
    },
    {
      "id": "05f5f8fb-ce7f-4b61-b7c1-8951a5f63424",
      "number": "DOC-2026-0392",
      "name": "Annual inventory report 2021",
      "class": "report",
      "counterpartyId": null,
      "counterparty": null,
      "project": "Imported archive",
      "owner": "ioana-marin",
      "date": "2021-12-31",
      "amount": null,
      "currency": "RON",
      "status": "archived",
      "version": 1,
      "returned": false,
      "keepUntil": "2026-12-31",
      "changedAt": "2026-03-02T09:01:00Z",
      "approval": {
        "route": [],
        "decisions": [],
        "next": null
      },
      "signature": null,
      "readers": {
        "groups": [
          "finance",
          "warehouse"
        ],
        "people": [
          "ioana-marin"
        ]
      },
      "revision": 1
    },
    {
      "id": "58c746b5-b395-4583-9865-7dc739f3a65b",
      "number": "DOC-2026-0391",
      "name": "Invoice MV-2016-1450",
      "class": "invoice",
      "counterpartyId": "365fcde1-a8f1-4abc-bff5-001cc36ad963",
      "counterparty": "Moara Vadului SRL",
      "project": "Imported archive",
      "owner": "ioana-marin",
      "date": "2016-11-30",
      "amount": "5410.00",
      "currency": "RON",
      "status": "archived",
      "version": 1,
      "returned": false,
      "keepUntil": "2026-12-31",
      "changedAt": "2026-03-02T09:00:00Z",
      "approval": {
        "route": [],
        "decisions": [],
        "next": null
      },
      "signature": null,
      "readers": {
        "groups": [
          "finance",
          "purchasing"
        ],
        "people": [
          "ioana-marin"
        ]
      },
      "revision": 1
    }
  ],
  "nextCursor": null
}
```

## Page through a list

1.  Send the request
    
    Send the request without `cursor`. Set `limit` for the size of a page.
    
2.  Read the page
    
    Take the documents from `items`.
    
3.  Ask for the next page
    
    When `nextCursor` is not `null`, send the same request with `cursor` set to its value. Stop when it is `null`.
    

See [Pagination](https://documents.rdcopilot.com/docs/reference/pagination/) for the limits of a page.

## Search by words

curl

```bash
curl "$RDC_BASE_URL/documents/v1/search?q=carpatin&limit=20" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/documents/v1/search?q=carpatin&limit=20`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/documents/v1/search?q=carpatin&limit=20',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/documents/v1/search?q=carpatin&limit=20');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
    ],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/documents/v1/search?q=carpatin&limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 200

```json
{
  "items": [
    {
      "document": {
        "id": "c4619fe2-a7f9-49d9-98f7-46a02d5c39c3",
        "number": "DOC-2026-0400",
        "name": "Invoice AC-2026-0911",
        "class": "invoice",
        "counterpartyId": "a1f13366-0199-4955-9251-6bd2703ce5cf",
        "counterparty": "Ambalaje Carpatin SRL",
        "project": "Purchasing",
        "owner": "sorin-avram",
        "date": "2026-11-18",
        "amount": "34862.00",
        "currency": "RON",
        "status": "in-review",
        "version": 1,
        "returned": false,
        "keepUntil": "2036-12-31",
        "changedAt": "2026-11-20T09:40:00Z",
        "approval": {
          "route": [
            "ioana-marin",
            "ana-rusu"
          ],
          "decisions": [
            {
              "approver": "ioana-marin",
              "decision": "approved",
              "time": "2026-11-20T09:40:00Z"
            }
          ],
          "next": "ana-rusu"
        },
        "signature": null,
        "readers": {
          "groups": [
            "finance",
            "purchasing"
          ],
          "people": [
            "sorin-avram",
            "ioana-marin",
            "ana-rusu"
          ]
        },
        "revision": 3
      },
      "matched": [
        "name",
        "counterparty"
      ]
    }
  ],
  "nextCursor": null
}
```

`searchDocuments` returns the documents in which every word of `q` appears in the name, the number, the counterparty, the project or an extracted value. The best match comes first.

Each hit holds the `document` and `matched`, the properties in which the words were found, for example `name` and `counterparty`. Add `class` to search one class only.

| You know | Use |
| --- | --- |
| A class, a status, an owner, an approver or a counterparty | `listDocuments` |
| A day to keep a document until | `listDocuments` |
| A word of the name, the number or the project | `searchDocuments` |
| A value read from an invoice | `searchDocuments` |
