# Search the organization knowledge (hybrid lexical + vector, RRF).

`POST /api/plugins/docs/knowledge/search`

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

Schema: [KnowledgeSearchDTO](https://sourcey-gauzy.pages.dev/api-reference/models/knowledgesearchdto/index.md)

- `query` (required)
  Type: string
  
  The search query (2–500 characters)

- `topK` (optional)
  Type: number
  
  minimum: 1
  
  maximum: 12

- `documentIds` (optional)
  Type: array
  
  Items:
    Type: string

- `categoryIds` (optional)
  Type: array
  
  Items:
    Type: string

- `tagIds` (optional)
  Type: array
  
  Items:
    Type: string

- `kinds` (optional)
  Type: array
  
  Items:
    Type: string

- `entity` (optional)
  Type: string
  
  enum: ["Broadcast","Candidate","Comment","Contact","Currency","DailyPlan","Dashboard","DashboardWidget","Document","Employee","Expense","Invoice","Income","Language","Organization","OrganizationContact","OrganizationDepartment","OrganizationDocument","OrganizationProject","OrganizationTeam","OrganizationProjectModule","OrganizationSprint","OrganizationVendor","ResourceLink","ScreeningTask","OrganizationStrategicInitiative","Task","TaskLinkedIssue","TaskView","User","Tenant"]

- `entityId` (optional)
  Type: string

Responses:

- 200: Ranked chunk hits with citation locators.

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/plugins/docs/knowledge/search' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "query": "string",
  "topK": 1,
  "documentIds": [
    "string"
  ],
  "categoryIds": [
    "string"
  ],
  "tagIds": [
    "string"
  ],
  "kinds": [
    "string"
  ],
  "entity": "Broadcast",
  "entityId": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "query": "string",
  "topK": 1,
  "documentIds": [
    "string"
  ],
  "categoryIds": [
    "string"
  ],
  "tagIds": [
    "string"
  ],
  "kinds": [
    "string"
  ],
  "entity": "Broadcast",
  "entityId": "string"
}`;

const response = await fetch('http://localhost:3000/api/plugins/docs/knowledge/search', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "query": "string",
  "topK": 1,
  "documentIds": [
    "string"
  ],
  "categoryIds": [
    "string"
  ],
  "tagIds": [
    "string"
  ],
  "kinds": [
    "string"
  ],
  "entity": "Broadcast",
  "entityId": "string"
}'''

response = requests.post(
    'http://localhost:3000/api/plugins/docs/knowledge/search',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
