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
curl -L \
  --request POST \
  --url 'https://api.gitbook.com/v1/orgs/{organizationId}/ask' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "text"
  }'
{
  "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
curl -L \
  --url 'https://api.gitbook.com/v1/orgs/{organizationId}/ask/questions' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "questions": [
    "text"
  ]
}

List recommended questions to ask in an organization (streamed)

get
Authorizations
Path parameters
organizationIdstringrequired

The unique id of the organization

Responses
curl -L \
  --url 'https://api.gitbook.com/v1/orgs/{organizationId}/ask/questions/stream' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "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
curl -L \
  --url 'https://api.gitbook.com/v1/orgs/{organizationId}/ask/stream?query=text' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "type": "answer",
  "answer": {
    "answer": {
      "markdown": "text"
    },
    "followupQuestions": [
      "text"
    ],
    "sources": [
      {
        "type": "page",
        "reason": "text",
        "page": "text",
        "revision": "text",
        "space": "text",
        "sections": [
          "text"
        ]
      }
    ]
  }
}

Was this helpful?