v6

latestOpenAPI 3.0.0raw.githubusercontent.com2024-10-187525179.6 KB
Documents

Query documents with natural language

This method allows asking direct questions of your documents – where possible an answer will be provided. Search results will be restricted to those accessible by the current access token. Note that "AI answers" must be enabled for the workspace.

post/documents.answerQuestion

Request body

querystring
userIdstring uuid

Any documents that have not been edited by the user identifier will be filtered out

collectionIdstring uuid

A collection to search within

documentIdstring uuid

A document to search within

statusFilter'draft' | 'archived' | 'published'

Any documents that are not in the specified status will be filtered out

dateFilter'day' | 'week' | 'month' | 'year'

Any documents that have not been updated within the specified period will be filtered out

Example request

{
  "query": "What is our holiday policy?"
}

Response

OK

Example response

{
  "documents": [
    {
      "title": "🎉 Welcome to Acme Inc",
      "emoji": "🎉",
      "text": "…",
      "urlId": "hDYep1TPAM",
      "collaborators": [
        {
          "name": "Jane Doe"
        }
      ],
      "createdBy": {
        "name": "Jane Doe"
      },
      "updatedBy": {
        "name": "Jane Doe"
      }
    }
  ],
  "search": {
    "query": "What is our hiring policy?",
    "answer": "Our hiring policy can be summarized as…",
    "source": "app"
  }
}