Ask AI

Ask questions in the context of a site.

Ask a question in a site. The response is streamed.

post
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

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
Responses
200

OK

text/event-stream
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: 109

{
  "question": "text",
  "context": {
    "siteSpaceId": "text"
  },
  "scope": {
    "mode": "default",
    "includedSiteSpaces": [
      "text"
    ]
  }
}
{
  "type": "answer",
  "answer": {
    "answer": {
      "markdown": "text"
    },
    "followupQuestions": [
      "text"
    ],
    "sources": [
      {
        "type": "page",
        "page": "text",
        "revision": "text",
        "space": "text",
        "sections": [
          "text"
        ]
      }
    ]
  }
}

Last updated

Was this helpful?