For the complete documentation index, see llms.txt. This page is also available as Markdown.

Ask a question in a site

The response is streamed.

post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organizationIdstringRequired

A unique entity identifier

Pattern: ^[a-zA-Z0-9_-]+$
siteIdstringRequired

The unique id of the site

Query parameters
formatstring · enumOptional

Output format for the content.

Possible values:
Body
questionstring · max: 512Required
scopeone ofRequired
or
or
or
Responses
200

OK

text/event-stream
typestring · enumRequiredPossible values:
post/orgs/{organizationId}/sites/{siteId}/ask
POST /v1/orgs/{organizationId}/sites/{siteId}/ask HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 189

{
  "question": "text",
  "context": {
    "siteSpaceId": "text",
    "goal": "text"
  },
  "scope": {
    "mode": "default",
    "currentSiteSpace": "text",
    "restrictTo": "text"
  },
  "session": {
    "visitorId": "text",
    "sessionId": "text"
  }
}
200

OK

{
  "type": "answer",
  "answer": {
    "answer": {
      "markdown": "# Hello World\n\nThis is a markdown document linking to [another page](/pages/page_id).\n"
    },
    "followupQuestions": [
      "text"
    ],
    "sources": [
      {
        "type": "page",
        "reason": "text",
        "page": "text",
        "revision": "text",
        "space": "text",
        "sections": [
          "text"
        ]
      }
    ]
  }
}

Last updated

Was this helpful?

Powered by GitBook