---
title: "Semantic search over a space's indexed files"
---

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

# Semantic search over a space's indexed files

Path: CloudRaker Workspace API › Search

`GET /spaces/{spaceId}/search`

Runs semantic search over every indexed file in the space `:spaceId`. Authorization: the caller needs `space:read` on the space; organization administrators bypass this check. Lacking access returns **404** (existence is hidden), never 403. Query params: `q` (required) is the natural-language query text; callers never send vectors. An empty or whitespace-only `q` returns 400. `limit` (optional, default 20) is a positive integer, capped at 100; larger values are clamped to 100, and a non-integer or `< 1` returns 400. The search is always scoped to the space in the path. Returns `{ matches }`, an array ranked by relevance; each match has `id`, `namespace`, `tags[]`, `score` (higher = closer), and a `metadata` object carrying file grounding (file id, page, bbox, and/or audio timecode) when the source was indexed with it. There is no cursor pagination — bound the result count with `limit`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`searchSpace.path.spaceId`; string, required)

## Query parameters

- `q` (`searchSpace.query.q`; string, required) — Natural-language query text. Empty or whitespace-only returns 400. Callers never send vectors.
  - minLength 1
- `limit` (`searchSpace.query.limit`; integer, optional) — Maximum matches, clamped to 100. A non-integer or value below 1 returns 400.
  - min 1; max 100; default `20`

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/search?q=string' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/search?q=string';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/spaces/<spaceId>/search?q=string"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Ranked semantic matches within the space.

#### Example

```json
{
  "matches": [
    {
      "id": "string",
      "namespace": "space/3f1c…/file_01J…",
      "tags": [
        "string"
      ],
      "score": 0,
      "metadata": {
        "property1": null,
        "property2": null
      }
    }
  ]
}
```

- `matches` (`searchSpace.response.200.matches`; array<object>, required) — Ranked by relevance. No cursor.
  - `id` (`searchSpace.response.200.matches.id`; string, required) — Chunk id of the match.
  - `namespace` (`searchSpace.response.200.matches.namespace`; string, required)
    - example `"space/3f1c…/file_01J…"`
  - `tags` (`searchSpace.response.200.matches.tags`; array<string>, required)
  - `score` (`searchSpace.response.200.matches.score`; number, required) — Relevance; higher is closer.
  - `metadata` (`searchSpace.response.200.matches.metadata`; map<unknown>, optional) — File grounding when the source was indexed with it: file id, page, bbox, and/or audio timecode.


Source: https://docs.cloudraker.com/workspace/api/search/space/index.md
