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.

The SiteStructure object

Attributes
one ofOptional
or

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-10-09T23:30:17.302Z",  "updatedAt": "2025-10-09T23:30:17.302Z",  "deletedAt": "2025-10-09T23:30:17.302Z",  "editMode": "live",  "mergeRules": {  "type": "inherit"  },  "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",  "language": "en",  "gitSync": {  "repoName": "text",  "installationProvider": "github",  "integration": "text",  "url": "text",  "updatedAt": "2025-10-09T23:30:17.302Z"  },  "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,  "installIntegration": true  }  },  "title": "text",  "default": true,  "condition": "text",  "hasAdvancedCustomizationFeature": true,  "urls": {  "published": "https://example.com"  }  }  ],  "urls": {  "published": "https://example.com"  },  "icon": "gear"  }  ] }

Get a site structure

get

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
200

OK

application/json
Responseone of
or
get
GET /v1/orgs/{organizationId}/sites/{siteId}/structure HTTP/1.1 Host: api.gitbook.com Authorization: Bearer YOUR_SECRET_TOKEN Accept: */* 
{  "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-10-09T23:30:17.302Z",  "updatedAt": "2025-10-09T23:30:17.302Z",  "deletedAt": "2025-10-09T23:30:17.302Z",  "editMode": "live",  "mergeRules": {  "type": "inherit"  },  "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",  "language": "en",  "gitSync": {  "repoName": "text",  "installationProvider": "github",  "integration": "text",  "url": "text",  "updatedAt": "2025-10-09T23:30:17.302Z"  },  "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,  "installIntegration": true  }  },  "title": "text",  "default": true,  "condition": "text",  "hasAdvancedCustomizationFeature": true,  "urls": {  "published": "https://example.com"  }  }  ],  "urls": {  "published": "https://example.com"  },  "icon": "gear"  }  ] }

Was this helpful?