# Search records, facts, and events

## `POST /v1/search`

Search workspace text. The limit applies separately to each result category. Requires the `read` scope.

```json
{
  "tags": [
    "Retrieval"
  ],
  "operationId": "search",
  "summary": "Search records, facts, and events",
  "description": "Search workspace text. The limit applies separately to each result category. Requires the `read` scope.",
  "x-retainer-scope": "read",
  "parameters": [],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "limit": {
              "default": 10,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "includeContext": {
              "type": "boolean"
            }
          },
          "required": [
            "query"
          ],
          "additionalProperties": false
        },
        "example": {
          "query": "Acme renewal",
          "limit": 10
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Successful response.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SearchResult"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "default": {
      "$ref": "#/components/responses/ApiError"
    }
  }
}
```

[Full OpenAPI contract](/openapi.json)
