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.
The unique id of the organization
The unique id of the site
Identifier of the page results to fetch.
The number of results per page
Filter context records by type.
Filter context records by connector type.
Integration source
^integration:[^:]+$Builtin sources
Filter context records by connection id.
GET /v1/orgs/{organizationId}/sites/{siteId}/context-records HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
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"
}
}
]
}The unique id of the organization
The unique id of the site
Input to ingest a new context record
Unique local identifier for the record
Title for the context record
Optional short description of the context record
Body content of the record as markdown
URL of the record
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"
}
}
]The context records have been created or updated
No content
The unique id of the organization
The unique id of the site
Identifier of the page results to fetch.
The number of results per page
GET /v1/orgs/{organizationId}/sites/{siteId}/context-connections HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
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"
}
]
}The unique id of the organization
The unique id of the site
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
}
}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"
}The unique id of the organization
The unique id of the site
The unique id of the context connection
GET /v1/orgs/{organizationId}/sites/{siteId}/context-connections/{siteContextConnectionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
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"
}The unique id of the organization
The unique id of the site
The unique id of the context connection
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"
}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"
}The unique id of the organization
The unique id of the site
The unique id of the context connection
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
The unique id of the organization
The unique id of the site
Identifier of the page results to fetch.
The number of results per page
GET /v1/orgs/{organizationId}/sites/{siteId}/context-topics HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
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"
}
}
]
}The unique id of the organization
The unique id of the site
The unique id of the context topic
GET /v1/orgs/{organizationId}/sites/{siteId}/context-topics/{siteContextTopicId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
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"
}
}The unique id of the organization
The unique id of the site
The unique id of the context topic
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
}
}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?