Site structure
Retrieve and manipulate the entire hierarchical layout of a site.
Provides a complete overview of how content is organized on a site. With this API, you can discover page nesting, identify sections, and reorder site elements as needed.
Attributes
one ofoptional
The SiteStructure object
{
"type": "sections",
"structure": [
{
"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-04-24T03:42:21.650Z",
"updatedAt": "2025-04-24T03:42:21.650Z",
"deletedAt": "2025-04-24T03:42:21.650Z",
"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-04-24T03:42:21.650Z"
},
"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"
}
]
}
Get the complete structure of a site that includes all its site-sections and site-spaces.
Authorizations
Path parameters
organizationIdstringrequired
The unique id of the organization
siteIdstringrequired
The unique id of the site
Query parameters
shareKeystringoptional
For sites published via share-links, the share key is useful to resolve published URLs.
Responses
application/json
application/json
get
curl -L \
--url 'https://api.gitbook.com/v1/orgs/{organizationId}/sites/{siteId}/structure' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
200
404
{
"type": "sections",
"structure": [
{
"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-04-24T03:42:21.650Z",
"updatedAt": "2025-04-24T03:42:21.650Z",
"deletedAt": "2025-04-24T03:42:21.650Z",
"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-04-24T03:42:21.650Z"
},
"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"
}
]
}
OK
Was this helpful?