Search Documents
Search for documents by title. Returns document-level results (not individual passages). Useful for document lookups, autocomplete, and navigation.
GET /api/search/documents
Authentication
Requires a Bearer token. See Getting Started.
Authorization: Bearer <your-api-key>
Query parameters
| Parameter | Type | Default | Description |
|---|
search | string | Required | Search query (matched against document titles). |
team | string | — | Team slug. Automatically inferred from your API key if not provided. |
page | integer | 1 | Page number. |
per_page | integer | 10 | Results per page. |
Response
Success response
{
"data": [
{
"id": "doc-xyz789",
"title": "Ecclesia de Eucharistia",
"author": "John Paul II",
"teams": [
{ "slug": "magisterium" }
]
}
],
"error": null
}
| Field | Type | Description |
|---|
data | array | Array of matching documents. |
data[].id | string | Document ID. |
data[].title | string | Document title. |
data[].author | string | Author name. |
data[].teams | array | Teams associated with the document. |
error | null | object | null on success. |
Error response
{
"data": [],
"error": {
"message": "Search query is required"
}
}
| Condition | Error Message |
|---|
Missing search parameter | "Search query is required" |
Missing team parameter (and not inferred) | "Team is required" |
Example
curl -G "https://vulgate.ai/api/search/documents" \
-H "Authorization: Bearer $VULGATE_API_KEY" \
--data-urlencode "search=Lumen Gentium"
{
"data": [
{
"id": "doc-abc123",
"title": "Lumen Gentium",
"author": "Second Vatican Council",
"teams": [{ "slug": "magisterium" }]
}
],
"error": null
}
Notes
- Only published documents are returned.
- Title matching uses PostgreSQL full-text search with
websearch mode, which supports natural language queries including quoted phrases and boolean operators.
- This endpoint is designed for quick lookups rather than exhaustive search. Use
/api/search for full content search.