# Search manual

Search Brigg's user manual by keyword and meaning in one language. Returns the best-matching sections with their full text and a URL to each section. The manual is the same for every workspace; no workspace data is read.

POST https://api.brigg.app/v1/operations/manual.SearchManual

## Access & visibility

Allow `manual.SearchManual` on your API key.

**Workspace access by default.** Private member data requires [approved member delegation](https://developer.brigg.app/authentication#member-delegation) through `Brigg-Act-As`; the key supplies permissions while private ownership and project boundaries remain enforced.

[Set up authentication](https://developer.brigg.app/authentication) · [Choose permissions](https://developer.brigg.app/permissions)

## Request fields

Send a JSON object with the following fields. Required fields must be included; omit optional fields you do not need.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | A question or keywords, in the manual's language. At least 1 character. At most 400 characters. |
| `locale` | string | No | Manual language: no (Norwegian), sv (Swedish), da (Danish) or en (English). Allowed: `"no"`, `"sv"`, `"da"`, `"en"`. |
| `limit` | integer | No | Maximum sections to return. Default 8. Range: 1 to 50. |
| `mode` | string | No | hybrid (default) fuses keyword and semantic retrieval; the other two run one channel alone. Allowed: `"hybrid"`, `"keyword"`, `"semantic"`. |

## Response

Returns **200 OK** with a JSON body.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `locale` | string | Yes | The manual language this answer is in. |
| `hits` | array of [object](#response-hits) | Yes | The best-matching sections, most relevant first. |
| `index_rebuilding` | boolean | Yes | True while the search index is catching up with a new manual: matching by meaning may be partial. |

### response.hits[]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `page_id` | string | Yes | The page the section belongs to; manual.GetManualPage reads it whole. |
| `title` | string | Yes | The heading of the page the section belongs to. |
| `heading` | string | Yes | The section's heading path, page first. |
| `text` | string | Yes | The section's full text. |
| `url` | string | Yes | Public URL straight to the section. |
| `score` | number | Yes | Relevance of the section to the query; higher is better, comparable within one answer only. |
| `channels` | array of string | Yes | Which retrieval found the section: `keyword` (its words), `semantic` (its meaning), or both. |

## Errors & retries

This operation reads data. It needs no idempotency key and can be retried after a transient failure.

For rate limits, follow the server’s retry guidance and back off. See [HTTP errors](https://developer.brigg.app/http#errors) and [safe retries and limits](https://developer.brigg.app/reliability).

| HTTP status | Code | What to do |
| --- | --- | --- |
| 400 | `invalid_json` | Send a JSON object with Content-Type: application/json. |
| 400 | `invalid_input` | Check the request fields and types. |
| 401 | `invalid_key` | The workspace API key is missing, invalid or revoked. |
| 403 | `forbidden` | Check the key’s operation and resource grants. If Brigg-Act-As is supplied, the key must be authorized to delegate to that member. |
| 404 | `not_found` | The requested operation or resource is not available to this credential. |
| 429 | `rate_limited` | Wait for Retry-After before retrying. |

## Next steps

[Download OpenAPI](https://developer.brigg.app/openapi.json) · [Versioning & retirement](https://developer.brigg.app/versioning)

## Examples

### Example request

Fictional values. Replace IDs and business details with values from your workspace.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/manual.SearchManual' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "query": "import contacts",
  "locale": "en",
  "limit": 3
}'
```

#### TypeScript


```typescript
const response = await fetch("https://api.brigg.app/v1/operations/manual.SearchManual", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "query": "import contacts",
    "locale": "en",
    "limit": 3
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

payload = {
  "query": "import contacts",
  "locale": "en",
  "limit": 3
}
request = Request(
    "https://api.brigg.app/v1/operations/manual.SearchManual",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "locale": "en",
  "index_rebuilding": false,
  "hits": [
    {
      "page_id": "apps/customers",
      "title": "Customers",
      "heading": "Customers › Import contacts",
      "text": "Upload a spreadsheet to add many contacts at once.",
      "url": "https://brigg.com/help/apps/customers#import-contacts",
      "score": 0.82,
      "channels": [
        "keyword",
        "semantic"
      ]
    }
  ]
}
```

## JSON schemas


```json-schema-request
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 400,
      "description": "A question or keywords, in the manual's language."
    },
    "locale": {
      "type": "string",
      "enum": [
        "no",
        "sv",
        "da",
        "en"
      ],
      "description": "Manual language: no (Norwegian), sv (Swedish), da (Danish) or en (English)."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "description": "Maximum sections to return. Default 8."
    },
    "mode": {
      "type": "string",
      "enum": [
        "hybrid",
        "keyword",
        "semantic"
      ],
      "description": "hybrid (default) fuses keyword and semantic retrieval; the other two run one channel alone."
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "query": "import contacts",
      "locale": "en",
      "limit": 3
    }
  ]
}
```


```json-schema-response
{
  "type": "object",
  "properties": {
    "locale": {
      "type": "string",
      "description": "The manual language this answer is in."
    },
    "hits": {
      "type": "array",
      "description": "The best-matching sections, most relevant first.",
      "items": {
        "type": "object",
        "properties": {
          "page_id": {
            "type": "string",
            "description": "The page the section belongs to; manual.GetManualPage reads it whole."
          },
          "title": {
            "type": "string",
            "description": "The heading of the page the section belongs to."
          },
          "heading": {
            "type": "string",
            "description": "The section's heading path, page first."
          },
          "text": {
            "type": "string",
            "description": "The section's full text."
          },
          "url": {
            "type": "string",
            "description": "Public URL straight to the section."
          },
          "score": {
            "type": "number",
            "description": "Relevance of the section to the query; higher is better, comparable within one answer only."
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which retrieval found the section: `keyword` (its words), `semantic` (its meaning), or both."
          }
        },
        "required": [
          "page_id",
          "title",
          "heading",
          "text",
          "url",
          "score",
          "channels"
        ],
        "additionalProperties": false
      }
    },
    "index_rebuilding": {
      "type": "boolean",
      "description": "True while the search index is catching up with a new manual: matching by meaning may be partial."
    }
  },
  "required": [
    "locale",
    "hits",
    "index_rebuilding"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "locale": "en",
      "index_rebuilding": false,
      "hits": [
        {
          "page_id": "apps/customers",
          "title": "Customers",
          "heading": "Customers › Import contacts",
          "text": "Upload a spreadsheet to add many contacts at once.",
          "url": "https://brigg.com/help/apps/customers#import-contacts",
          "score": 0.82,
          "channels": [
            "keyword",
            "semantic"
          ]
        }
      ]
    }
  ]
}
```

