> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.airweave.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.airweave.ai/_mcp/server.

# Classic Search

POST https://api.airweave.ai/collections/{readable_id}/search/classic
Content-Type: application/json

AI-optimized search.

Reference: https://docs.airweave.ai/api-reference/collections/classic

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

- `https://api.airweave.ai` (Production, default)
- `http://localhost:8001` (Local)

## Request

### Path parameters

- `readable_id` (string, required)

### Body (application/json)

This endpoint expects a ClassicSearchRequest.

- `query` (string, required) — Search query text.
- `filter` (list of FilterGroup, optional, nullable) — Filter groups (combined with OR).
- `limit` (integer, optional, default: 100) — Max results to return.
- `offset` (integer, optional, default: 0) — Number of results to skip.

## Response

### 200

Successful Response

- `results` (list of SearchResult, optional) — Search results ordered by relevance.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### FilterGroup

A group of filter conditions combined with AND. Multiple filter groups are combined with OR, allowing expressions like: (A AND B) OR (C AND D) Examples: Single group (AND): \{"conditions": \[ \{"field": "airweave\_system\_metadata.source\_name", "operator": "equals", "value": "slack"}, \{"field": "airweave\_system\_metadata.entity\_type", "operator": "equals", "value": "SlackMessageEntity"} ]} Multiple groups (OR between groups, AND within): \[ \{"conditions": \[\{"field": "name", "operator": "equals", "value": "doc1"}]}, \{"conditions": \[\{"field": "name", "operator": "equals", "value": "doc2"}]} ] Breadcrumb filtering: \{"conditions": \[ \{"field": "breadcrumbs.name", "operator": "contains", "value": "Engineering"} ]}

- `conditions` (list of FilterCondition, required) — Filter conditions within this group, combined with AND

### SearchResult

Search result.

- `entity_id` (string, required) — Original entity ID.
- `name` (string, required) — Entity display name.
- `relevance_score` (double, required) — Relevance score from the search engine.
- `breadcrumbs` (list of SearchBreadcrumb, required) — Breadcrumbs showing entity hierarchy.
- `textual_representation` (string, required) — Semantically searchable text content
- `airweave_system_metadata` (SearchSystemMetadata, required) — System metadata
- `access` (SearchAccessControl, required) — Access control
- `web_url` (string, required) — URL to view the entity in its source application (e.g., Notion, Asana).
- `raw_source_fields` (map from string to any, required) — All source-specific fields.
- `created_at` (string, optional, nullable) — When the entity was created.
- `updated_at` (string, optional, nullable) — When the entity was last updated.
- `url` (string, optional, nullable) — Download URL for file entities. Only present for FileEntity types.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### FilterCondition

A single filter condition. Pydantic validates that: * `field` is a valid FilterableField enum value * `operator` is a valid FilterOperator enum value * `value` matches the expected types * The combination of field + operator + value is semantically valid Invalid filters raise `pydantic.ValidationError` automatically. Examples: \{"field": "airweave\_system\_metadata.source\_name", "operator": "equals", "value": "notion"} \{"field": "created\_at", "operator": "greater\_than", "value": "2024-01-01T00:00:00Z"} \{"field": "breadcrumbs.name", "operator": "contains", "value": "Engineering"}

- `field` (enum, required) — Field to filter on (use dot notation for nested fields).
  - Allowed values: `entity_id`, `name`, `created_at`, `updated_at`, `breadcrumbs.entity_id`, `breadcrumbs.name`, `breadcrumbs.entity_type`, `airweave_system_metadata.entity_type`, `airweave_system_metadata.source_name`, `airweave_system_metadata.original_entity_id`, `airweave_system_metadata.chunk_index`, `airweave_system_metadata.sync_id`, `airweave_system_metadata.sync_job_id`
- `operator` (enum, required) — The comparison operator to use.
  - Allowed values: `equals`, `not_equals`, `contains`, `greater_than`, `less_than`, `greater_than_or_equal`, `less_than_or_equal`, `in`, `not_in`
- `value` (FilterConditionValue, required) — Value to compare against. Use a list for 'in' and 'not_in' operators.

### SearchBreadcrumb

Breadcrumb in search result.

- `entity_id` (string, required) — ID of the entity in the source.
- `name` (string, required) — Display name of the entity.
- `entity_type` (string, required) — Entity class name (e.g., 'AsanaProjectEntity').

### SearchSystemMetadata

System metadata in search result.

- `source_name` (string, required) — Name of the source this entity belongs to.
- `entity_type` (string, required) — Type of the entity this entity represents in the source.
- `chunk_index` (integer, required) — Index of the chunk in the file.
- `original_entity_id` (string, required) — Original entity ID
- `sync_id` (string, optional, nullable) — ID of the sync this entity belongs to (None for federated).
- `sync_job_id` (string, optional, nullable) — ID of the sync job this entity belongs to (None for federated).

### SearchAccessControl

Access control in search result.

- `viewers` (list of string, optional, nullable) — Principal IDs who can view this entity. None if unknown.
- `is_public` (boolean, optional, nullable) — Whether this entity is publicly accessible. None if unknown.

### ValidationErrorLocItems

- string
- integer

### FilterConditionValue

Value to compare against. Use a list for 'in' and 'not_in' operators.

- string
- integer
- boolean
- list of string
- list of integer

## Examples

**Request**

```json
{
  "query": "quarterly revenue report",
  "limit": 10
}
```

**Response**

```json
{
  "results": [
    {
      "entity_id": "page-abc123",
      "name": "Production Deployment Guide",
      "relevance_score": 0.94,
      "breadcrumbs": [
        {
          "entity_id": "ws-1",
          "name": "Acme Workspace",
          "entity_type": "NotionWorkspaceEntity"
        },
        {
          "entity_id": "db-eng",
          "name": "Engineering",
          "entity_type": "NotionDatabaseEntity"
        }
      ],
      "textual_representation": "# Production Deployment Guide\n\nThis document covers the standard deployment process for production releases.",
      "airweave_system_metadata": {
        "source_name": "notion",
        "entity_type": "NotionPageEntity",
        "chunk_index": 0,
        "original_entity_id": "page-abc123",
        "sync_id": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f80",
        "sync_job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
      },
      "access": {
        "viewers": null,
        "is_public": null
      },
      "web_url": "https://notion.so/Deployment-Guide-abc123",
      "raw_source_fields": {
        "icon": "🚀",
        "archived": false,
        "parent_type": "database_id"
      },
      "created_at": "2025-02-10T09:15:00Z",
      "updated_at": "2025-03-18T16:30:00Z",
      "url": null
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/classic"

payload = {
    "query": "quarterly revenue report",
    "limit": 10
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/classic';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"query":"quarterly revenue report","limit":10}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/classic"

	payload := strings.NewReader("{\n  \"query\": \"quarterly revenue report\",\n  \"limit\": 10\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/classic")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"query\": \"quarterly revenue report\",\n  \"limit\": 10\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/classic")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"query\": \"quarterly revenue report\",\n  \"limit\": 10\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/classic', [
  'body' => '{
  "query": "quarterly revenue report",
  "limit": 10
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/classic");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"query\": \"quarterly revenue report\",\n  \"limit\": 10\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "query": "quarterly revenue report",
  "limit": 10
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/classic")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```