Wiki source code of REST API

Last modified by superadmin on 2026/11/25 21:25

Hide last authors
Michael Hamann 1.1 1 == Collections Resource ==
2
3 GET /wikis/{wikiName}/aiLLM/collections
4
5 Returns a list of all collection IDs that the current user can access as an array of strings.
6
7 == Collection Resource ==
8
9 A collection object has the following properties:
10
11 |=Name |=Type |=Description
12 |id |String| id of the collection
13 |title |String|pretty name of the collection
14 |embedding_model|String|the embedding model as reference of the page that defines the model
15 |chunking_method|String|the chunking method, should be maxChars
16 |chunking_max_size|int| the maximum size of a chunk
17 |chunking_overlap_offset|int|the overlap of chunks
gabrielc 2.1 18 |document_spaces|List of strings|the list of XWiki spaces indexed by this collection when its document store is the XWiki store
Michael Hamann 1.1 19 |allow_guests|boolean|if guests can query this collection (as part of a chat completion)
20 |query_groups|List of strings|the list of groups that are allowed to query this collection (as part of a chat completion). This is only used when guests aren't allowed to query the collection.
21 |rights_check_method|String|the method used for checking access rights of individual documents during queries. Supported values: public, external. See also [[the Authorization section of the Index for the LLM Application>>||anchor="HAuthorization"]].
22 |rights_check_method_configuration|Object|options of the rights check method, values depend on the selected rights check method. The "external" rights check method supports the url parameter which is the URL that is used to check rights for all found documents.
23
24 === GET /wikis/{wikiName}/aiLLM/collections/{collectionName} ===
25
26 Returns the collection of the given name.
27
28 === PUT /wikis/{wikiName}/aiLLM/collections/{collectionName} ===
29
30 Creates or updates the collection of the given name. The body of the request is a collection, if not all properties are specified, only the specified properties are updated.
31
32 === DELETE /wikis/{wikiName}/aiLLM/collections/{collectionName} ===
33
gabrielc 2.1 34 Deletes the collection of the given name. The documents of the internal store are deleted with it; the wiki pages that a collection of the XWiki store indexes are kept.
Michael Hamann 1.1 35
36 === GET /wikis/{wikiName}/aiLLM/collections/{collectionName}/documents ===
37
38 Returns a list of document IDs that are contained in the collection of the given name. This resource supports the following query parameters:
39
40 |=Name|=Description
41 |start|the index of the first document to retrieve (default: 0)
42 |number|the number of documents to retrieve (default: -1)
43
44 == Document Resource ==
45
46 A document object has the following properties, all properties are strings:
47
48 |=Name|=Description
49 |id|id of the document
50 |title|pretty name of the document
51 |language|the language of the document (currently not used)
52 |url|the URL of the document, used to display a link to the original resource when the document is used as context in a chat
53 |collection|the name of the collection the document is part of
54 |mimetype|the mime type of the document, currently not used, could be used in the future to use a chunking method that is specific to the mime type
55 |content|the content of the document that is indexed
56
57 === GET /wikis/{wikiName}/aiLLM/collections/{collectionName}/documents/{documentID} ===
58
59 Returns the document of the given name in the collection of the given name.
60
61 === PUT /wikis/{wikiName}/aiLLM/collections/{collectionName}/documents/{documentID} ===
62
63 Creates or updates the document of the given name in the collection of the given name. The body of the request is a document, if not all properties are specified, only the specified properties are updated.
64
65 === DELETE /wikis/{wikiName}/aiLLM/collections/{collectionName}/documents/{documentID} ===
66
67 Deletes the document of the given name in the collection of the given name.
68
69 {{version since="0.8" product="LLM"}}
70 == Search Resource ==
71
72 The search resource allows searching in indexed content. In contrast to the previous APIs, rights aren't checked based on standard XWiki rights but based on the ##allow_guests## flag and the query groups. This API is basically the same as the ##search_wiki## tool in the [[MCP Server>>documentation.extensions.user.llm.mcp-server.WebHome]].
73
74 ##POST /wikis/{wikiName}/aiLLM/search##
75
76 Supported parameters:
77
78 |=Name|=Type|=Description
79 |query|String|The query to search for
80 |collection|String (can be specified several times)|The IDs of the collections to search in, when omitted, all accessible collections are searched
81 |limitKeywordResults|int|The maximum number of results to return based on keyword search (default: 10)
82 |limitSemanticResults|int|The maximum number of results to return based on semantic search (default: 10)
83
84 == Search Collections Resource ==
85
86 The search collections resource returns all collections that the current user can access for search. This allows presenting users a list of collections they can select for search.
87
88 ##GET /wikis/{wikiName}/aiLLM/search/collections##
89
90 Supported parameters: none.
91
92 Result: A list of [[collection resources>>||anchor="HCollectionResource"]] with only ##id## and ##title## properties.
93 {{/version}}

Get Connected