Site AI ask
Allow AI-driven queries within a specific docs site.
Give your users a way to ask content-aware AI queries that are scoped entirely to the site’s published documents.
The response is streamed.
Authorizations
Path parameters
organizationIdstringRequired
The unique id of the organization
siteIdstringRequired
The unique id of the site
Query parameters
formatstring · enumOptionalPossible values:
Output format for the content.
Body
questionstring · max: 512Required
scopeone ofRequired
or
or
Responses
200
OK
text/event-stream
post
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"
]
}
}
200
OK
{
"type": "answer",
"answer": {
"answer": {
"markdown": "text"
},
"followupQuestions": [
"text"
],
"sources": [
{
"type": "page",
"reason": "text",
"page": "text",
"revision": "text",
"space": "text",
"sections": [
"text"
]
}
]
}
}
The response is streamed.
Authorizations
Path parameters
organizationIdstringRequired
The unique id of the organization
siteIdstringRequired
The unique id of the site
Responses
200
OK
text/event-stream
get
GET /v1/orgs/{organizationId}/sites/{siteId}/ask/questions HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200
OK
{
"question": "text"
}
Was this helpful?