---
title: "Search Nicer's knowledge"
---

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

# Search Nicer's knowledge

Path: Nicer API › Assistant

`GET /agent/knowledge`

URL: `https://api.nicer.travel/agent/knowledge`

Searches what Nicer knows as a whole, rather than what it knows about one traveler: itineraries that advisors actually built and sent, community threads where somebody answered a question, and Nicer's own product documentation, narrowed to one kind of source when kind says so. Ask it in words, the way you would ask a colleague ("four nights in Cartagena with two children", "how do I send a proposal for approval"), and quote what comes back rather than inventing around it. Any signed-in person may call it, travelers included: results come only from the caller's own agencies and what is public, and no argument reaches another agency's knowledge.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Query parameters

- `query` (`agent.knowledge.list.query.query`; string, required) — What to look for, in words, as you would ask a colleague.
  - maxLength: `1000` · minLength: `3`
- `kind` (`agent.knowledge.list.query.kind`; string, optional) — Narrow to one sort of source: `itinerary` for trips that were built, `thread` for community conversations, `doc` for Nicer's product documentation.
  - one of `"itinerary"`, `"thread"`, `"doc"`

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
});

await nicer.agent.knowledge.list({
  "query": "string"
});
```

### Nicer CLI

```bash
nicer agent knowledge list --query 'string'
```

### cURL

```bash
curl --request GET \
  --url 'https://api.nicer.travel/agent/knowledge?query=string' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/agent/knowledge?query=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.nicer.travel/agent/knowledge?query=string"

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

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "results": [
    {
      "companyName": "string",
      "excerpt": "string",
      "kind": "string",
      "score": 0,
      "title": "string"
    }
  ]
}
```

- `results` (`agent.knowledge.list.response.200.results`; array of object, required)
  - `companyName` (`agent.knowledge.list.response.200.results.companyName`; any of, required)
    - any of the following: `string`, `null`
  - `excerpt` (`agent.knowledge.list.response.200.results.excerpt`; string, required)
  - `kind` (`agent.knowledge.list.response.200.results.kind`; any of, required)
    - any of the following: `string`, `null`
  - `score` (`agent.knowledge.list.response.200.results.score`; any of, required)
    - any of the following: `number`, `null`
  - `title` (`agent.knowledge.list.response.200.results.title`; any of, required)
    - any of the following: `string`, `null`

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.knowledge.list.response.400.errorCode`; string, required)
- `errorMessage` (`agent.knowledge.list.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.knowledge.list.response.401.errorCode`; string, required)
- `errorMessage` (`agent.knowledge.list.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.knowledge.list.response.403.errorCode`; string, required)
- `errorMessage` (`agent.knowledge.list.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Assistant/agent.knowledge.list/index.md
