Search Content

Search across document content in one or more libraries. Returns ranked passages (document parts) with full document metadata. Supports neural (semantic) and keyword search modes.

GET /api/search

Authentication

Requires a Bearer token. See Getting Started.

Authorization: Bearer <your-api-key>

Query parameters

ParameterTypeDefaultDescription
searchstringRequiredSearch query. Supports advanced query syntax.
modestring"neural"Search mode: "neural" or "keyword".
librariesstring[]["private"]Libraries to search. Pass multiple values with libraries=a&libraries=b or libraries[]=a&libraries[]=b.
pageinteger1Page number (1-indexed).
per_pageinteger10Results per page. Min: 1, Max: 100.
authorstringFilter by author name (partial match).
publication_datestringFilter by publication year.
isbnstringFilter by ISBN or ISBN-13.
idstringFilter by a specific document ID.
document_idstringSearch within a specific document.
teamstringTeam slug. Automatically inferred from your API key if not provided.
user_idstringUser ID for private library access. Automatically inferred from session-based auth.

Response

Success response

{
  "data": [SearchResult],
  "count": 42,
  "error": null
}
FieldTypeDescription
dataSearchResult[]Array of matching document parts.
countintegerEstimated total number of results (for pagination).
errornullnull on success.

SearchResult object

FieldTypeDescription
idstringUnique ID of the document part.
created_atstringISO 8601 timestamp.
document_idstringID of the parent document.
indexstring | numberURN reference within the document (e.g. urn:vulgate:doc-id:section), or a numeric position.
content_renderedstring | nullHTML-rendered content of the matching passage.
headingsstring[] | nullSection headings associated with this passage.
languagestring | nullISO language code (e.g. "en", "la", "grc").
namespacestringTeam slug / namespace the result belongs to.
documentsobjectParent document metadata (see below).

Documents object

FieldTypeDescription
idstringDocument ID.
titlestring | nullDocument title.
authorstring | nullAuthor name.
publication_datestring | nullPublication year.
publication_placestring | nullPlace of publication.
isbnstring | nullISBN-10.
isbn_13string | nullISBN-13.
publisherstring | nullPublisher name.
document_formatstring | nullDocument format (e.g. "PDF", "MEDIA", "DOC").
scopestring | nullVisibility scope: "private" or "organization".

Error response

{
  "data": null,
  "count": 0,
  "error": {
    "code": "no-libraries-selected",
    "message": "No libraries selected"
  }
}
HTTP StatusError CodeDescription
400Validation error (invalid parameters).
400no-libraries-selectedNo libraries were included in the request.
400private-library-no-user-idPrivate library requires a user_id.
401Missing or invalid authentication.
403Magisterium AI library requires a paid plan.

Examples

curl -G "https://vulgate.ai/api/search" \
  -H "Authorization: Bearer $VULGATE_API_KEY" \
  --data-urlencode "search=the role of bishops in early Christianity" \
  --data-urlencode "libraries=mai" \
  --data-urlencode "mode=neural" \
  --data-urlencode "per_page=10" \
  --data-urlencode "page=1"
curl -G "https://vulgate.ai/api/search" \
  -H "Authorization: Bearer $VULGATE_API_KEY" \
  --data-urlencode "search=Nicene Creed" \
  --data-urlencode "libraries=mai" \
  --data-urlencode "mode=keyword"

Filter by author

curl -G "https://vulgate.ai/api/search" \
  -H "Authorization: Bearer $VULGATE_API_KEY" \
  --data-urlencode "search=grace" \
  --data-urlencode "author=Augustine" \
  --data-urlencode "libraries=orientale"

Search within a document

curl -G "https://vulgate.ai/api/search" \
  -H "Authorization: Bearer $VULGATE_API_KEY" \
  --data-urlencode "search=sacraments" \
  --data-urlencode "document_id=doc-xyz789" \
  --data-urlencode "libraries=mai"

Search multiple libraries

curl -G "https://vulgate.ai/api/search" \
  -H "Authorization: Bearer $VULGATE_API_KEY" \
  --data-urlencode "search=liturgical calendar" \
  --data-urlencode "libraries=orientale" \
  --data-urlencode "libraries=mai"

Search private documents

curl -G "https://vulgate.ai/api/search" \
  -H "Authorization: Bearer $VULGATE_API_KEY" \
  --data-urlencode "search=meeting notes" \
  --data-urlencode "libraries=private" \
  --data-urlencode "user_id=your-user-id"

Pagination

Results are paginated. Use page and per_page to navigate through results.

The count field in the response provides an estimated total number of matching results. This is suitable for rendering pagination controls but should not be treated as an exact count.

# Page 1
?search=theology&per_page=20&page=1
 
# Page 2
?search=theology&per_page=20&page=2

Scope and permissions

Search results respect document visibility scopes:

  • Private documents are only returned when the authenticated user matches the document uploader. Requires user_id to be set (inferred automatically with session auth).
  • Organization documents are returned for any authenticated team member.
  • Magisterium AI library (mai) requires the team to have an active paid subscription.

When searching both private and organization libraries simultaneously, results from both scopes are merged and paginated together.

Search Content | Vulgate AI