Organization 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

Ask a question to an AI across spaces that is accessible by the currently authenticated target.

Authorizations
Path parameters
organizationIdstringrequired

The unique id of the organization

Query parameters
formatstring · enumoptional

Output format for the content.

Available options:
detailsbooleanoptional

Return query details in the result

Body
querystringrequired
previousQueriesstring[] · max: 10optionalDeprecated
Responses
application/json
objectoptional
post
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"
}
200

OK

{
  "answer": {
    "answer": {
      "markdown": "text"
    },
    "followupQuestions": [
      "text"
    ],
    "sources": [
      {
        "type": "page",
        "reason": "text",
        "page": "text",
        "revision": "text",
        "space": "text",
        "sections": [
          "text"
        ]
      }
    ]
  }
}

List recommended questions to ask in an organization

get
Authorizations
Path parameters
organizationIdstringrequired

The unique id of the organization

Responses
application/json
objectoptional

Questions recommended by the AI for the given content.

get
GET /v1/orgs/{organizationId}/ask/questions HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "questions": [
    "text"
  ]
}

List recommended questions to ask in an organization (streamed)

get
Authorizations
Path parameters
organizationIdstringrequired

The unique id of the organization

Responses
text/event-stream
objectoptional
get
GET /v1/orgs/{organizationId}/ask/questions/stream HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "question": "text"
}

Ask a question in an organization (streamed)

get

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.

Authorizations
Path parameters
organizationIdstringrequired

The unique id of the organization

Query parameters
querystringrequired
formatstring · enumoptional

Output format for the content.

Available options:
detailsbooleanoptional

Return query details in the result

Responses
text/event-stream
objectoptional
get
GET /v1/orgs/{organizationId}/ask/stream HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "type": "answer",
  "answer": {
    "answer": {
      "markdown": "text"
    },
    "followupQuestions": [
      "text"
    ],
    "sources": [
      {
        "type": "page",
        "reason": "text",
        "page": "text",
        "revision": "text",
        "space": "text",
        "sections": [
          "text"
        ]
      }
    ]
  }
}

Was this helpful?