Site sections
Create and organize high-level sections for your docs site.
Sections help partition your site’s content at the top level. They can be modified, deleted, or reorganized to reflect your site’s changing structure.
The object type, which is always "site-section"
Unique identifier of the site section
Title of the site section
Description of the site section
Whether this is the default section for the site
Path to the section on the site
Conditional expression used to evaluate whether the site section should be shown to the site's visitor.
ID of the section group the section belongs to in the site
Name of the icon
gear
The SiteSection object
{
"object": "site-section",
"id": "text",
"title": "text",
"description": "text",
"default": true,
"path": "text",
"condition": "text",
"sectionGroup": "text",
"siteSpaces": [
{
"object": "site-space",
"id": "text",
"path": "text",
"section": "text",
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-06-21T02:26:33.754Z",
"updatedAt": "2025-06-21T02:26:33.754Z",
"deletedAt": "2025-06-21T02:26:33.754Z",
"editMode": "live",
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"published": "https://example.com",
"public": "https://example.com",
"icon": "https://example.com"
},
"organization": "text",
"parent": "text",
"gitSync": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-06-21T02:26:33.754Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"view": true,
"access": true,
"admin": true,
"viewInviteLinks": true,
"edit": true,
"triggerGitSync": true,
"comment": true,
"merge": true,
"review": true
}
},
"title": "text",
"default": true,
"condition": "text",
"hasAdvancedCustomizationFeature": true,
"urls": {
"published": "https://example.com"
}
}
],
"urls": {
"published": "https://example.com"
},
"icon": "gear"
}
The unique id of the organization
The unique id of the site
For sites published via share-links, the share key is useful to resolve published URLs.
Identifier of the page results to fetch.
The number of results per page
GET /v1/orgs/{organizationId}/sites/{siteId}/sections HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"object": "site-section",
"id": "text",
"title": "text",
"description": "text",
"default": true,
"path": "text",
"condition": "text",
"sectionGroup": "text",
"siteSpaces": [
{
"object": "site-space",
"id": "text",
"path": "text",
"section": "text",
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-06-21T02:26:33.754Z",
"updatedAt": "2025-06-21T02:26:33.754Z",
"deletedAt": "2025-06-21T02:26:33.754Z",
"editMode": "live",
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"published": "https://example.com",
"public": "https://example.com",
"icon": "https://example.com"
},
"organization": "text",
"parent": "text",
"gitSync": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-06-21T02:26:33.754Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"view": true,
"access": true,
"admin": true,
"viewInviteLinks": true,
"edit": true,
"triggerGitSync": true,
"comment": true,
"merge": true,
"review": true
}
},
"title": "text",
"default": true,
"condition": "text",
"hasAdvancedCustomizationFeature": true,
"urls": {
"published": "https://example.com"
}
}
],
"urls": {
"published": "https://example.com"
},
"icon": "gear"
}
]
}
The unique id of the organization
The unique id of the site
ID of the space to be added to the section as a site space variant
Title of the site section
Name of the icon
gear
POST /v1/orgs/{organizationId}/sites/{siteId}/sections HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 47
{
"spaceId": "text",
"title": "text",
"icon": "gear"
}
Section added to the site
{
"object": "site-section",
"id": "text",
"title": "text",
"description": "text",
"default": true,
"path": "text",
"condition": "text",
"sectionGroup": "text",
"siteSpaces": [
{
"object": "site-space",
"id": "text",
"path": "text",
"section": "text",
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-06-21T02:26:33.754Z",
"updatedAt": "2025-06-21T02:26:33.754Z",
"deletedAt": "2025-06-21T02:26:33.754Z",
"editMode": "live",
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"published": "https://example.com",
"public": "https://example.com",
"icon": "https://example.com"
},
"organization": "text",
"parent": "text",
"gitSync": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-06-21T02:26:33.754Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"view": true,
"access": true,
"admin": true,
"viewInviteLinks": true,
"edit": true,
"triggerGitSync": true,
"comment": true,
"merge": true,
"review": true
}
},
"title": "text",
"default": true,
"condition": "text",
"hasAdvancedCustomizationFeature": true,
"urls": {
"published": "https://example.com"
}
}
],
"urls": {
"published": "https://example.com"
},
"icon": "gear"
}
The unique id of the organization
The unique id of the site
The unique id of the section within a site
DELETE /v1/orgs/{organizationId}/sites/{siteId}/sections/{siteSectionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Site section has been deleted
No content
The unique id of the organization
The unique id of the site
The unique id of the section within a site
Title of the site section
Path to the section on the site
ID of the site-space to be used as the default in this section.
Conditional expression used to evaluate whether the site section should be shown to the site's visitor (should evaluate to a boolean). If not set, the condition will remain unchanged. If set to null, the condition will be removed.
Name of the icon
gear
Description of the site section
PATCH /v1/orgs/{organizationId}/sites/{siteId}/sections/{siteSectionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 110
{
"title": "text",
"path": "text",
"defaultSiteSpace": "text",
"condition": "text",
"icon": "gear",
"description": "text"
}
OK
{
"object": "site-section",
"id": "text",
"title": "text",
"description": "text",
"default": true,
"path": "text",
"condition": "text",
"sectionGroup": "text",
"siteSpaces": [
{
"object": "site-space",
"id": "text",
"path": "text",
"section": "text",
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-06-21T02:26:33.754Z",
"updatedAt": "2025-06-21T02:26:33.754Z",
"deletedAt": "2025-06-21T02:26:33.754Z",
"editMode": "live",
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"published": "https://example.com",
"public": "https://example.com",
"icon": "https://example.com"
},
"organization": "text",
"parent": "text",
"gitSync": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-06-21T02:26:33.754Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"view": true,
"access": true,
"admin": true,
"viewInviteLinks": true,
"edit": true,
"triggerGitSync": true,
"comment": true,
"merge": true,
"review": true
}
},
"title": "text",
"default": true,
"condition": "text",
"hasAdvancedCustomizationFeature": true,
"urls": {
"published": "https://example.com"
}
}
],
"urls": {
"published": "https://example.com"
},
"icon": "gear"
}
The unique id of the organization
The unique id of the site
The unique id of the section within a site
POST /v1/orgs/{organizationId}/sites/{siteId}/sections/{siteSectionId}/move HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 121
{
"position": {
"before": {
"type": "site-section",
"siteSection": "text"
},
"after": {
"type": "site-section",
"siteSection": "text"
}
}
}
{
"object": "site-section",
"id": "text",
"title": "text",
"description": "text",
"default": true,
"path": "text",
"condition": "text",
"sectionGroup": "text",
"siteSpaces": [
{
"object": "site-space",
"id": "text",
"path": "text",
"section": "text",
"space": {
"object": "space",
"id": "text",
"title": "text",
"emoji": "🎉",
"visibility": "public",
"createdAt": "2025-06-21T02:26:33.754Z",
"updatedAt": "2025-06-21T02:26:33.754Z",
"deletedAt": "2025-06-21T02:26:33.754Z",
"editMode": "live",
"urls": {
"location": "https://example.com",
"app": "https://example.com",
"published": "https://example.com",
"public": "https://example.com",
"icon": "https://example.com"
},
"organization": "text",
"parent": "text",
"gitSync": {
"repoName": "text",
"installationProvider": "github",
"integration": "text",
"url": "text",
"updatedAt": "2025-06-21T02:26:33.754Z"
},
"visitorAuth": {
"backend": "custom"
},
"revision": "text",
"defaultLevel": "admin",
"comments": 1,
"changeRequests": 1,
"changeRequestsOpen": 1,
"changeRequestsDraft": 1,
"permissions": {
"view": true,
"access": true,
"admin": true,
"viewInviteLinks": true,
"edit": true,
"triggerGitSync": true,
"comment": true,
"merge": true,
"review": true
}
},
"title": "text",
"default": true,
"condition": "text",
"hasAdvancedCustomizationFeature": true,
"urls": {
"published": "https://example.com"
}
}
],
"urls": {
"published": "https://example.com"
},
"icon": "gear"
}
Was this helpful?