Site context

Manage context records, connections, and topics for a docs site.

Manage the contextual records and topics used by your site to power AI experiences and insights.

List all context records

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

Query parameters
pagestringOptional

Identifier of the page results to fetch.

limitnumber · max: 1000Optional

The number of results per page

typestring · enumOptional

Filter context records by type.

Possible values:
connectorone ofOptional

Filter context records by connector type.

stringOptional

Integration source

Pattern: ^integration:[^:]+$
or
string · enumOptional

Builtin sources

Possible values:
connectionstringOptional

Filter context records by connection id.

Responses
200
OK
application/json
Responseall of
get
GET /v1/orgs/{organizationId}/sites/{siteId}/context-records HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "object": "context-record",
      "id": "text",
      "title": "text",
      "description": "text",
      "type": "ticket",
      "createdAt": "2026-02-15T20:38:00.117Z",
      "processedAt": "2026-02-15T20:38:00.117Z",
      "connection": "text",
      "connector": "text",
      "topics": [
        "text"
      ],
      "urls": {
        "location": "https://example.com",
        "source": "https://example.com"
      }
    }
  ]
}

Create or update context records

put
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

Bodyobject[]

Input to ingest a new context record

idstringRequired

Unique local identifier for the record

typestring · enumRequiredPossible values:
titlestring · min: 1 · max: 256Required

Title for the context record

descriptionstring · max: 512Optional

Optional short description of the context record

bodystringRequired

Body content of the record as markdown

urlstring · uriOptional

URL of the record

Responses
204
The context records have been created or updated
put
PUT /v1/orgs/{organizationId}/sites/{siteId}/context-records HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 155

[
  {
    "id": "text",
    "type": "ticket",
    "title": "text",
    "description": "text",
    "body": "text",
    "url": "https://example.com",
    "metadata": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    }
  }
]
204

The context records have been created or updated

No content

List all context connections

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

Query parameters
pagestringOptional

Identifier of the page results to fetch.

limitnumber · max: 1000Optional

The number of results per page

Responses
200
OK
application/json
Responseall of
get
GET /v1/orgs/{organizationId}/sites/{siteId}/context-connections HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "object": "context-connection",
      "id": "text",
      "createdAt": "2026-02-15T20:38:00.117Z",
      "syncedAt": "2026-02-15T20:38:00.117Z",
      "label": "text",
      "status": "pending",
      "records": 1,
      "failureMessage": "text",
      "email": {
        "ingestionAddress": "name@gmail.com"
      },
      "usageSettings": {
        "changeRequests": true,
        "search": true
      },
      "urls": {
        "location": "https://example.com"
      },
      "connector": "builtin:email"
    }
  ]
}

Create a context connection

post
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

Body
all ofOptional
one ofOptional
or
or
or
and
Responses
201
Created connection
application/json
Responseall of
and
one ofOptional
or
or
or
post
POST /v1/orgs/{organizationId}/sites/{siteId}/context-connections HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 83

{
  "connector": "builtin:email",
  "usageSettings": {
    "changeRequests": true,
    "search": true
  }
}
201

Created connection

{
  "object": "context-connection",
  "id": "text",
  "createdAt": "2026-02-15T20:38:00.117Z",
  "syncedAt": "2026-02-15T20:38:00.117Z",
  "label": "text",
  "status": "pending",
  "records": 1,
  "failureMessage": "text",
  "email": {
    "ingestionAddress": "name@gmail.com"
  },
  "usageSettings": {
    "changeRequests": true,
    "search": true
  },
  "urls": {
    "location": "https://example.com"
  },
  "connector": "builtin:email"
}

Get a context connection

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

siteContextConnectionIdstringRequired

The unique id of the context connection

Responses
200
OK
application/json
Responseall of
and
one ofOptional
or
or
or
get
GET /v1/orgs/{organizationId}/sites/{siteId}/context-connections/{siteContextConnectionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "object": "context-connection",
  "id": "text",
  "createdAt": "2026-02-15T20:38:00.117Z",
  "syncedAt": "2026-02-15T20:38:00.117Z",
  "label": "text",
  "status": "pending",
  "records": 1,
  "failureMessage": "text",
  "email": {
    "ingestionAddress": "name@gmail.com"
  },
  "usageSettings": {
    "changeRequests": true,
    "search": true
  },
  "urls": {
    "location": "https://example.com"
  },
  "connector": "builtin:email"
}

Update a context connection

patch
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

siteContextConnectionIdstringRequired

The unique id of the context connection

Body
any ofOptional
one ofOptional
or
or
or
or
Responses
200
OK
application/json
Responseall of
and
one ofOptional
or
or
or
patch
PATCH /v1/orgs/{organizationId}/sites/{siteId}/context-connections/{siteContextConnectionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "connector": "builtin:email"
}
200

OK

{
  "object": "context-connection",
  "id": "text",
  "createdAt": "2026-02-15T20:38:00.117Z",
  "syncedAt": "2026-02-15T20:38:00.117Z",
  "label": "text",
  "status": "pending",
  "records": 1,
  "failureMessage": "text",
  "email": {
    "ingestionAddress": "name@gmail.com"
  },
  "usageSettings": {
    "changeRequests": true,
    "search": true
  },
  "urls": {
    "location": "https://example.com"
  },
  "connector": "builtin:email"
}

Trigger a sync for a context connection

post
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

siteContextConnectionIdstringRequired

The unique id of the context connection

Responses
204
Sync started
post
POST /v1/orgs/{organizationId}/sites/{siteId}/context-connections/{siteContextConnectionId}/sync HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

List all context topics

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

Query parameters
pagestringOptional

Identifier of the page results to fetch.

limitnumber · max: 1000Optional

The number of results per page

Responses
200
OK
application/json
Responseall of
get
GET /v1/orgs/{organizationId}/sites/{siteId}/context-topics HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "object": "context-topic",
      "id": "text",
      "label": "text",
      "createdAt": "2026-02-15T20:38:00.117Z",
      "updatedAt": "2026-02-15T20:38:00.117Z",
      "icon": "gear",
      "summary": {
        "object": "document",
        "data": {
          "schemaVersion": 1,
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "nodes": [
          "[Circular Reference]"
        ],
        "meta": {
          "token": "text"
        }
      },
      "usageSettings": {
        "changeRequests": true,
        "search": true
      },
      "weeklyPulse": [
        1
      ],
      "connectors": {
        "ANY_ADDITIONAL_PROPERTY": 1
      },
      "stats": {
        "records": 1
      },
      "urls": {
        "location": "https://example.com"
      }
    }
  ]
}

Get a context topic

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

siteContextTopicIdstringRequired

The unique id of the context topic

Responses
200
OK
application/json
get
GET /v1/orgs/{organizationId}/sites/{siteId}/context-topics/{siteContextTopicId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "object": "context-topic",
  "id": "text",
  "label": "text",
  "createdAt": "2026-02-15T20:38:00.117Z",
  "updatedAt": "2026-02-15T20:38:00.117Z",
  "icon": "gear",
  "summary": {
    "object": "document",
    "data": {
      "schemaVersion": 1,
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "nodes": [
      {
        "object": "block",
        "type": "paragraph",
        "key": "text",
        "nodes": [
          "[Circular Reference]"
        ],
        "isVoid": false,
        "data": {
          "align": "start"
        }
      }
    ],
    "meta": {
      "token": "text"
    }
  },
  "usageSettings": {
    "changeRequests": true,
    "search": true
  },
  "weeklyPulse": [
    1
  ],
  "connectors": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "stats": {
    "records": 1
  },
  "urls": {
    "location": "https://example.com"
  }
}

Update a context topic

patch
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

siteContextTopicIdstringRequired

The unique id of the context topic

Body
Responses
200
OK
application/json
patch
PATCH /v1/orgs/{organizationId}/sites/{siteId}/context-topics/{siteContextTopicId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 55

{
  "usageSettings": {
    "changeRequests": true,
    "search": true
  }
}
200

OK

{
  "object": "context-topic",
  "id": "text",
  "label": "text",
  "createdAt": "2026-02-15T20:38:00.117Z",
  "updatedAt": "2026-02-15T20:38:00.117Z",
  "icon": "gear",
  "summary": {
    "object": "document",
    "data": {
      "schemaVersion": 1,
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "nodes": [
      {
        "object": "block",
        "type": "paragraph",
        "key": "text",
        "nodes": [
          "[Circular Reference]"
        ],
        "isVoid": false,
        "data": {
          "align": "start"
        }
      }
    ],
    "meta": {
      "token": "text"
    }
  },
  "usageSettings": {
    "changeRequests": true,
    "search": true
  },
  "weeklyPulse": [
    1
  ],
  "connectors": {
    "ANY_ADDITIONAL_PROPERTY": 1
  },
  "stats": {
    "records": 1
  },
  "urls": {
    "location": "https://example.com"
  }
}

Last updated

Was this helpful?