Documents

Query documents with natural language

Changed on

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

  • Base URL
    https://app.getoutline.com/api
  • URL
    https://app.getoutline.com/api/documents.answerQuestion
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: https://app.getoutline.com/oauth/authorize
      Token URL: https://app.getoutline.com/oauth/token scopes: read, write

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",
      "icon": "🎉",
      "text": "…",
      "urlId": "hDYep1TPAM",
      "createdBy": {
        "name": "Jane Doe"
      },
      "updatedBy": {
        "name": "Jane Doe"
      },
      "deletedBy": {
        "name": "Jane Doe"
      }
    }
  ],
  "policies": [
    {
      "abilities": {
        "read": true,
        "update": true,
        "delete": false
      }
    }
  ],
  "search": {
    "query": "What is our hiring policy?",
    "answer": "Our hiring policy can be summarized as…",
    "source": "app"
  }
}

Changes

    • info

      added the optional property // to the response with the status

    • info

      response property documents/items/url deprecated

    • info

      added the optional property // to the response with the status