---
title: "Retrieval | Docs | Private AI Workspace by R&D Copilot"
description: "Read the retrieval resources and their request and response fields."
canonical: "https://private-ai.rdcopilot.com/docs/api-reference/retrieval/"
language: en
updated: 2026-11-22
---

# Retrieval

Read the retrieval resources and their request and response fields.

## Find readable documents

GET `/private-ai/v1/retrieval`

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `limit` | query | `integer` | Nooptional | Records per page. Default `100` Range `1` – `500` |
| `cursor` | query | `string` | Nooptional | Opaque cursor from the preceding page. |
| `spaceId` | query | `string` | Yesrequired |  |
| `query` | query | `string` | Yesrequired |  |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | Current record state. | `RetrievalPage` |
| `401` | unauthorized | `Error` |
| `403` | forbidden | `Error` |
| `404` | Record not found in this installation. | `Error` |
| `429` | rate\_limited | `Error` |
| `503` | unavailable | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/private-ai/v1/retrieval?limit=20&spaceId=warehouse&query=damaged%20goods" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/private-ai/v1/retrieval?limit=20&spaceId=warehouse&query=damaged%20goods`, {
  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"]}/private-ai/v1/retrieval?limit=20&spaceId=warehouse&query=damaged%20goods',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/private-ai/v1/retrieval?limit=20&spaceId=warehouse&query=damaged%20goods');
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")}/private-ai/v1/retrieval?limit=20&spaceId=warehouse&query=damaged%20goods");
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

```json
{
  "items": [
    {
      "documentId": "doc-procedure",
      "spaceId": "warehouse",
      "title": "Receiving procedure",
      "locator": "Section 4, Damaged goods",
      "passage": "Damaged goods are photographed, moved to the quarantine bay and reported to the supplier within one working day."
    }
  ],
  "nextCursor": null
}
```

## List knowledge spaces

GET `/private-ai/v1/spaces`

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `limit` | query | `integer` | Nooptional | Records per page. Default `100` Range `1` – `500` |
| `cursor` | query | `string` | Nooptional | Opaque cursor from the preceding page. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | Current record state. | `SpacePage` |
| `401` | unauthorized | `Error` |
| `403` | forbidden | `Error` |
| `404` | Record not found in this installation. | `Error` |
| `429` | rate\_limited | `Error` |
| `503` | unavailable | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/private-ai/v1/spaces?limit=20" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/private-ai/v1/spaces?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"]}/private-ai/v1/spaces?limit=20',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/private-ai/v1/spaces?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")}/private-ai/v1/spaces?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

```json
{
  "items": [
    {
      "id": "warehouse",
      "name": "Warehouse",
      "permissionSource": "directory",
      "lastSync": "2026-11-23T06:00:00Z"
    },
    {
      "id": "finance",
      "name": "Finance",
      "permissionSource": "directory",
      "lastSync": "2026-11-23T06:00:00Z"
    }
  ],
  "nextCursor": null
}
```
