GitBook API API reference OrganizationsOrganization AI ask Unlock AI-driven answers for your organization’s content and data.
Enhance your team’s knowledge base with the Organization AI ask endpoint, which allows you to query AI models trained on your organization’s GitBook content for quick, intelligent responses.
Ask a question in an organization
post
https://api.gitbook.com/v1 /orgs/ {organizationId} /ask Ask a question to an AI across spaces that is accessible by the currently authenticated target.
organizationId string Required The unique id of the organization
format string · enum Optional Output format for the content.
Possible values: document
markdown
details boolean Optional Return query details in the result
previousQueries string[] · max: 10 Optional Deprecated
Response object
Show properties
Copy POST /v1/orgs/{organizationId}/ask HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"query": "text"
}
List recommended questions to ask in an organization
get
https://api.gitbook.com/v1 /orgs/ {organizationId} /ask/questions
organizationId string Required The unique id of the organization
Response object Questions recommended by the AI for the given content.
Show properties
Copy GET /v1/orgs/{organizationId}/ask/questions HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
List recommended questions to ask in an organization (streamed)
get
https://api.gitbook.com/v1 /orgs/ {organizationId} /ask/questions/stream
organizationId string Required The unique id of the organization
Response object
Show properties
Copy GET /v1/orgs/{organizationId}/ask/questions/stream HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Ask a question in an organization (streamed)
get
https://api.gitbook.com/v1 /orgs/ {organizationId} /ask/stream Ask a question to an AI across spaces that is accessible by the currently authenticated target and stream the answer as a Server-Sent Events URL.
organizationId string Required The unique id of the organization
format string · enum Optional Output format for the content.
Possible values: document
markdown
details boolean Optional Return query details in the result
Response object
Show properties
Copy GET /v1/orgs/{organizationId}/ask/stream HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*