# Source: https://gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites.md

# Docs sites

The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.

## The Site object

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"components":{"schemas":{"Site":{"type":"object","properties":{"object":{"type":"string","enum":["site"]},"id":{"type":"string","description":"Unique identifier of the site"},"type":{"$ref":"#/components/schemas/SiteType"},"appliedType":{"$ref":"#/components/schemas/SiteType","description":"The currently applied type of the site. For example, frozen sites will have this set to Basic."},"title":{"$ref":"#/components/schemas/SiteTitle"},"icon":{"oneOf":[{"$ref":"#/components/schemas/CustomizationFavicon"},{"type":"string","nullable":true,"enum":[null]}]},"hostname":{"$ref":"#/components/schemas/SiteHostname"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"proxy":{"$ref":"#/components/schemas/SiteProxy"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"published":{"type":"boolean","description":"Whether the site is live or not. If true, the site is accessible to the audience defined by the visibility setting."},"siteSpaces":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"ads":{"$ref":"#/components/schemas/SiteAds"},"agentsContext":{"$ref":"#/components/schemas/SiteAgentsContext"},"features":{"description":"A list of all premium features enabled on this site. For each feature we list the plan they belong to and whether the feature is frozen. A frozen feature is still enabled but cannot be changed or modified.\n","type":"array","items":{"$ref":"#/components/schemas/SiteFeature"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the site in the API","format":"uri"},"app":{"type":"string","description":"URL of the site in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the site. Only defined when site is published.","format":"uri"}},"required":["app","location"]}},"required":["object","id","type","appliedType","title","visibility","published","createdAt","siteSpaces","features","agentsContext","urls"]},"SiteType":{"type":"string","description":"The type of the site","enum":["basic","premium","ultimate","sponsored","legacy-basic","legacy-premium"]},"SiteTitle":{"type":"string","description":"Title of the site","minLength":2,"maxLength":128},"CustomizationFavicon":{"oneOf":[{"type":"object","properties":{"icon":{"$ref":"#/components/schemas/CustomizationThemedURL"}},"required":["icon"]},{"type":"object","properties":{"emoji":{"$ref":"#/components/schemas/Emoji"}},"required":["emoji"]},{"type":"object","properties":{},"additionalProperties":false}]},"CustomizationThemedURL":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/URL"},"dark":{"$ref":"#/components/schemas/URL"}},"required":["light","dark"]},"URL":{"type":"string","format":"uri","maxLength":2048},"Emoji":{"type":"string","maxLength":50,"format":"emoji","description":"Unicode codepoint or character of the emoji"},"SiteHostname":{"type":"string","description":"Custom hostname for the site, for e.g. docs.mycompany.com","pattern":"^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$","maxLength":512},"SiteBasename":{"type":"string","description":"Basename for the site. For e.g. api","minLength":1,"maxLength":100},"SiteProxy":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/SiteProxyOrigin"},"target":{"type":"string","description":"The target URL to which the requests at the origin URL should be proxied to."}},"required":["origin","target"]},"SiteProxyOrigin":{"type":"string","description":"Proxy URL for the site, for e.g. company.com/docs or www.company.com/developer/docs etc.","pattern":"^([\\w-]+\\.)*[\\w-]+\\.[a-zA-Z]{2,}(\\/[\\w-]+)+$","maxLength":512},"SiteVisibility":{"type":"string","description":"The visibility setting of the site determines the audience of the site.\n* `public`: Anyone can access the site, and the site is indexed by search engines.\n* `unlisted`: Anyone can access the site, and the site is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the site.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the site.\n","enum":["public","unlisted","share-link","visitor-auth"]},"SiteAdaptiveContent":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether adaptive content should be enabled on the site."}},"required":["enabled"]},"SiteAds":{"oneOf":[{"type":"object","required":["status","submittable"],"properties":{"status":{"type":"string","enum":["pending"]},"submittable":{"type":"boolean","description":"True if the user can submit the site for review."}}},{"type":"object","required":["status","topic"],"properties":{"status":{"type":"string","enum":["in-review"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"}}},{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["rejected"]},"reason":{"type":"string","description":"Reason for the rejection"}}},{"type":"object","required":["status","topic","zoneId"],"properties":{"status":{"type":"string","enum":["live","disabled"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"},"zoneId":{"type":"string","description":"The ad network zone ID"}}}]},"SiteAdsTopic":{"type":"string","description":"Topic of the content","enum":["webdev","crypto"]},"SiteAgentsContext":{"type":"string","description":"Defines if the site will be included in the agent's context.\n- `excluded` means that the agent will not be able to access the site.\n- `included` means that the agent will be able to access the site.\n","enum":["excluded","included"]},"SiteFeature":{"type":"object","description":"A site feature and the plan it is available on.","properties":{"id":{"$ref":"#/components/schemas/SiteFeatureKey"},"plan":{"$ref":"#/components/schemas/SiteType"},"frozen":{"description":"A frozen feature is still enabled but cannot be changed or modified.","type":"boolean"},"customizations":{"description":"A list of the actual advanced customizations used (only applicable for sites-advanced-customization)","type":"array","items":{"$ref":"#/components/schemas/SiteCustomizationFeature"}}},"required":["id","plan","frozen"]},"SiteFeatureKey":{"type":"string","description":"The site feature identifier","enum":["sites-adaptive-content","sites-advanced-customization","sites-advanced-insights","sites-ads","sites-ai-search","sites-ai-assistant","sites-embed","sites-api-playground","sites-basic-customization","sites-custom-domain","sites-custom-fonts","sites-custom-subdirectory","sites-full-text-search","sites-multivariant-site","sites-no-custom-domain","sites-page-feedback","sites-page-traffic-insights","sites-pdf-export","sites-preview-deployments","sites-public-visibility","sites-redirects","sites-search-insights","sites-sections","sites-seo","sites-share-links","sites-unlisted-visibility","sites-user-contribution","sites-visitor-authentication","sites-visitors"]},"SiteCustomizationFeature":{"type":"string","description":"A list of all premium customizations.","enum":["header-logo","header-primary-link","theme-preset","premium-fonts","custom-icons","footer-logo","footer-links","footer-copyright","semantic-colors"]}}}}
```

## GET /orgs/{organizationId}/sites

> List all sites

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"listPage":{"name":"page","in":"query","description":"Identifier of the page results to fetch.","schema":{"type":"string"}},"listLimit":{"name":"limit","in":"query","description":"The number of results per page","schema":{"type":"number","minimum":0,"maximum":1000}}},"schemas":{"SiteType":{"type":"string","description":"The type of the site","enum":["basic","premium","ultimate","sponsored","legacy-basic","legacy-premium"]},"List":{"type":"object","properties":{"next":{"type":"object","properties":{"page":{"type":"string","description":"Unique identifier to query the next results page"}},"required":["page"]},"count":{"type":"number","description":"Total count of objects in the list"}}},"Site":{"type":"object","properties":{"object":{"type":"string","enum":["site"]},"id":{"type":"string","description":"Unique identifier of the site"},"type":{"$ref":"#/components/schemas/SiteType"},"appliedType":{"$ref":"#/components/schemas/SiteType","description":"The currently applied type of the site. For example, frozen sites will have this set to Basic."},"title":{"$ref":"#/components/schemas/SiteTitle"},"icon":{"oneOf":[{"$ref":"#/components/schemas/CustomizationFavicon"},{"type":"string","nullable":true,"enum":[null]}]},"hostname":{"$ref":"#/components/schemas/SiteHostname"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"proxy":{"$ref":"#/components/schemas/SiteProxy"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"published":{"type":"boolean","description":"Whether the site is live or not. If true, the site is accessible to the audience defined by the visibility setting."},"siteSpaces":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"ads":{"$ref":"#/components/schemas/SiteAds"},"agentsContext":{"$ref":"#/components/schemas/SiteAgentsContext"},"features":{"description":"A list of all premium features enabled on this site. For each feature we list the plan they belong to and whether the feature is frozen. A frozen feature is still enabled but cannot be changed or modified.\n","type":"array","items":{"$ref":"#/components/schemas/SiteFeature"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the site in the API","format":"uri"},"app":{"type":"string","description":"URL of the site in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the site. Only defined when site is published.","format":"uri"}},"required":["app","location"]}},"required":["object","id","type","appliedType","title","visibility","published","createdAt","siteSpaces","features","agentsContext","urls"]},"SiteTitle":{"type":"string","description":"Title of the site","minLength":2,"maxLength":128},"CustomizationFavicon":{"oneOf":[{"type":"object","properties":{"icon":{"$ref":"#/components/schemas/CustomizationThemedURL"}},"required":["icon"]},{"type":"object","properties":{"emoji":{"$ref":"#/components/schemas/Emoji"}},"required":["emoji"]},{"type":"object","properties":{},"additionalProperties":false}]},"CustomizationThemedURL":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/URL"},"dark":{"$ref":"#/components/schemas/URL"}},"required":["light","dark"]},"URL":{"type":"string","format":"uri","maxLength":2048},"Emoji":{"type":"string","maxLength":50,"format":"emoji","description":"Unicode codepoint or character of the emoji"},"SiteHostname":{"type":"string","description":"Custom hostname for the site, for e.g. docs.mycompany.com","pattern":"^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$","maxLength":512},"SiteBasename":{"type":"string","description":"Basename for the site. For e.g. api","minLength":1,"maxLength":100},"SiteProxy":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/SiteProxyOrigin"},"target":{"type":"string","description":"The target URL to which the requests at the origin URL should be proxied to."}},"required":["origin","target"]},"SiteProxyOrigin":{"type":"string","description":"Proxy URL for the site, for e.g. company.com/docs or www.company.com/developer/docs etc.","pattern":"^([\\w-]+\\.)*[\\w-]+\\.[a-zA-Z]{2,}(\\/[\\w-]+)+$","maxLength":512},"SiteVisibility":{"type":"string","description":"The visibility setting of the site determines the audience of the site.\n* `public`: Anyone can access the site, and the site is indexed by search engines.\n* `unlisted`: Anyone can access the site, and the site is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the site.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the site.\n","enum":["public","unlisted","share-link","visitor-auth"]},"SiteAdaptiveContent":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether adaptive content should be enabled on the site."}},"required":["enabled"]},"SiteAds":{"oneOf":[{"type":"object","required":["status","submittable"],"properties":{"status":{"type":"string","enum":["pending"]},"submittable":{"type":"boolean","description":"True if the user can submit the site for review."}}},{"type":"object","required":["status","topic"],"properties":{"status":{"type":"string","enum":["in-review"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"}}},{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["rejected"]},"reason":{"type":"string","description":"Reason for the rejection"}}},{"type":"object","required":["status","topic","zoneId"],"properties":{"status":{"type":"string","enum":["live","disabled"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"},"zoneId":{"type":"string","description":"The ad network zone ID"}}}]},"SiteAdsTopic":{"type":"string","description":"Topic of the content","enum":["webdev","crypto"]},"SiteAgentsContext":{"type":"string","description":"Defines if the site will be included in the agent's context.\n- `excluded` means that the agent will not be able to access the site.\n- `included` means that the agent will be able to access the site.\n","enum":["excluded","included"]},"SiteFeature":{"type":"object","description":"A site feature and the plan it is available on.","properties":{"id":{"$ref":"#/components/schemas/SiteFeatureKey"},"plan":{"$ref":"#/components/schemas/SiteType"},"frozen":{"description":"A frozen feature is still enabled but cannot be changed or modified.","type":"boolean"},"customizations":{"description":"A list of the actual advanced customizations used (only applicable for sites-advanced-customization)","type":"array","items":{"$ref":"#/components/schemas/SiteCustomizationFeature"}}},"required":["id","plan","frozen"]},"SiteFeatureKey":{"type":"string","description":"The site feature identifier","enum":["sites-adaptive-content","sites-advanced-customization","sites-advanced-insights","sites-ads","sites-ai-search","sites-ai-assistant","sites-embed","sites-api-playground","sites-basic-customization","sites-custom-domain","sites-custom-fonts","sites-custom-subdirectory","sites-full-text-search","sites-multivariant-site","sites-no-custom-domain","sites-page-feedback","sites-page-traffic-insights","sites-pdf-export","sites-preview-deployments","sites-public-visibility","sites-redirects","sites-search-insights","sites-sections","sites-seo","sites-share-links","sites-unlisted-visibility","sites-user-contribution","sites-visitor-authentication","sites-visitors"]},"SiteCustomizationFeature":{"type":"string","description":"A list of all premium customizations.","enum":["header-logo","header-primary-link","theme-preset","premium-fonts","custom-icons","footer-logo","footer-links","footer-copyright","semantic-colors"]}}},"paths":{"/orgs/{organizationId}/sites":{"get":{"operationId":"listSites","summary":"List all sites","tags":["sites","critical"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/listPage"},{"$ref":"#/components/parameters/listLimit"},{"name":"space","in":"query","description":"Identifier of the space to filter the sites by","required":false,"schema":{"type":"string"}},{"name":"title","in":"query","description":"Filter sites by their title","required":false,"schema":{"type":"string"}},{"name":"published","in":"query","description":"Filter sites by their published status","required":false,"schema":{"type":"boolean"}},{"name":"type","in":"query","description":"Filter by site type","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/SiteType"}}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"},{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Site"}}}}]}}}}}}}}}
```

## POST /orgs/{organizationId}/sites

> Create a site

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}}},"schemas":{"SiteType":{"type":"string","description":"The type of the site","enum":["basic","premium","ultimate","sponsored","legacy-basic","legacy-premium"]},"SiteTitle":{"type":"string","description":"Title of the site","minLength":2,"maxLength":128},"SiteVisibility":{"type":"string","description":"The visibility setting of the site determines the audience of the site.\n* `public`: Anyone can access the site, and the site is indexed by search engines.\n* `unlisted`: Anyone can access the site, and the site is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the site.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the site.\n","enum":["public","unlisted","share-link","visitor-auth"]},"Site":{"type":"object","properties":{"object":{"type":"string","enum":["site"]},"id":{"type":"string","description":"Unique identifier of the site"},"type":{"$ref":"#/components/schemas/SiteType"},"appliedType":{"$ref":"#/components/schemas/SiteType","description":"The currently applied type of the site. For example, frozen sites will have this set to Basic."},"title":{"$ref":"#/components/schemas/SiteTitle"},"icon":{"oneOf":[{"$ref":"#/components/schemas/CustomizationFavicon"},{"type":"string","nullable":true,"enum":[null]}]},"hostname":{"$ref":"#/components/schemas/SiteHostname"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"proxy":{"$ref":"#/components/schemas/SiteProxy"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"published":{"type":"boolean","description":"Whether the site is live or not. If true, the site is accessible to the audience defined by the visibility setting."},"siteSpaces":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"ads":{"$ref":"#/components/schemas/SiteAds"},"agentsContext":{"$ref":"#/components/schemas/SiteAgentsContext"},"features":{"description":"A list of all premium features enabled on this site. For each feature we list the plan they belong to and whether the feature is frozen. A frozen feature is still enabled but cannot be changed or modified.\n","type":"array","items":{"$ref":"#/components/schemas/SiteFeature"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the site in the API","format":"uri"},"app":{"type":"string","description":"URL of the site in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the site. Only defined when site is published.","format":"uri"}},"required":["app","location"]}},"required":["object","id","type","appliedType","title","visibility","published","createdAt","siteSpaces","features","agentsContext","urls"]},"CustomizationFavicon":{"oneOf":[{"type":"object","properties":{"icon":{"$ref":"#/components/schemas/CustomizationThemedURL"}},"required":["icon"]},{"type":"object","properties":{"emoji":{"$ref":"#/components/schemas/Emoji"}},"required":["emoji"]},{"type":"object","properties":{},"additionalProperties":false}]},"CustomizationThemedURL":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/URL"},"dark":{"$ref":"#/components/schemas/URL"}},"required":["light","dark"]},"URL":{"type":"string","format":"uri","maxLength":2048},"Emoji":{"type":"string","maxLength":50,"format":"emoji","description":"Unicode codepoint or character of the emoji"},"SiteHostname":{"type":"string","description":"Custom hostname for the site, for e.g. docs.mycompany.com","pattern":"^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$","maxLength":512},"SiteBasename":{"type":"string","description":"Basename for the site. For e.g. api","minLength":1,"maxLength":100},"SiteProxy":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/SiteProxyOrigin"},"target":{"type":"string","description":"The target URL to which the requests at the origin URL should be proxied to."}},"required":["origin","target"]},"SiteProxyOrigin":{"type":"string","description":"Proxy URL for the site, for e.g. company.com/docs or www.company.com/developer/docs etc.","pattern":"^([\\w-]+\\.)*[\\w-]+\\.[a-zA-Z]{2,}(\\/[\\w-]+)+$","maxLength":512},"SiteAdaptiveContent":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether adaptive content should be enabled on the site."}},"required":["enabled"]},"SiteAds":{"oneOf":[{"type":"object","required":["status","submittable"],"properties":{"status":{"type":"string","enum":["pending"]},"submittable":{"type":"boolean","description":"True if the user can submit the site for review."}}},{"type":"object","required":["status","topic"],"properties":{"status":{"type":"string","enum":["in-review"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"}}},{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["rejected"]},"reason":{"type":"string","description":"Reason for the rejection"}}},{"type":"object","required":["status","topic","zoneId"],"properties":{"status":{"type":"string","enum":["live","disabled"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"},"zoneId":{"type":"string","description":"The ad network zone ID"}}}]},"SiteAdsTopic":{"type":"string","description":"Topic of the content","enum":["webdev","crypto"]},"SiteAgentsContext":{"type":"string","description":"Defines if the site will be included in the agent's context.\n- `excluded` means that the agent will not be able to access the site.\n- `included` means that the agent will be able to access the site.\n","enum":["excluded","included"]},"SiteFeature":{"type":"object","description":"A site feature and the plan it is available on.","properties":{"id":{"$ref":"#/components/schemas/SiteFeatureKey"},"plan":{"$ref":"#/components/schemas/SiteType"},"frozen":{"description":"A frozen feature is still enabled but cannot be changed or modified.","type":"boolean"},"customizations":{"description":"A list of the actual advanced customizations used (only applicable for sites-advanced-customization)","type":"array","items":{"$ref":"#/components/schemas/SiteCustomizationFeature"}}},"required":["id","plan","frozen"]},"SiteFeatureKey":{"type":"string","description":"The site feature identifier","enum":["sites-adaptive-content","sites-advanced-customization","sites-advanced-insights","sites-ads","sites-ai-search","sites-ai-assistant","sites-embed","sites-api-playground","sites-basic-customization","sites-custom-domain","sites-custom-fonts","sites-custom-subdirectory","sites-full-text-search","sites-multivariant-site","sites-no-custom-domain","sites-page-feedback","sites-page-traffic-insights","sites-pdf-export","sites-preview-deployments","sites-public-visibility","sites-redirects","sites-search-insights","sites-sections","sites-seo","sites-share-links","sites-unlisted-visibility","sites-user-contribution","sites-visitor-authentication","sites-visitors"]},"SiteCustomizationFeature":{"type":"string","description":"A list of all premium customizations.","enum":["header-logo","header-primary-link","theme-preset","premium-fonts","custom-icons","footer-logo","footer-links","footer-copyright","semantic-colors"]}}},"paths":{"/orgs/{organizationId}/sites":{"post":{"operationId":"createSite","summary":"Create a site","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"description":"The type of the site, defaults to Basic","$ref":"#/components/schemas/SiteType"},"title":{"$ref":"#/components/schemas/SiteTitle"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"spaces":{"type":"array","description":"ID of spaces to be added to the site","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Site created","headers":{"Location":{"description":"API URL for the newly created site","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}}}}}}}
```

## GET /orgs/{organizationId}/sites/{siteId}

> Get a site by its ID

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"Site":{"type":"object","properties":{"object":{"type":"string","enum":["site"]},"id":{"type":"string","description":"Unique identifier of the site"},"type":{"$ref":"#/components/schemas/SiteType"},"appliedType":{"$ref":"#/components/schemas/SiteType","description":"The currently applied type of the site. For example, frozen sites will have this set to Basic."},"title":{"$ref":"#/components/schemas/SiteTitle"},"icon":{"oneOf":[{"$ref":"#/components/schemas/CustomizationFavicon"},{"type":"string","nullable":true,"enum":[null]}]},"hostname":{"$ref":"#/components/schemas/SiteHostname"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"proxy":{"$ref":"#/components/schemas/SiteProxy"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"published":{"type":"boolean","description":"Whether the site is live or not. If true, the site is accessible to the audience defined by the visibility setting."},"siteSpaces":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"ads":{"$ref":"#/components/schemas/SiteAds"},"agentsContext":{"$ref":"#/components/schemas/SiteAgentsContext"},"features":{"description":"A list of all premium features enabled on this site. For each feature we list the plan they belong to and whether the feature is frozen. A frozen feature is still enabled but cannot be changed or modified.\n","type":"array","items":{"$ref":"#/components/schemas/SiteFeature"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the site in the API","format":"uri"},"app":{"type":"string","description":"URL of the site in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the site. Only defined when site is published.","format":"uri"}},"required":["app","location"]}},"required":["object","id","type","appliedType","title","visibility","published","createdAt","siteSpaces","features","agentsContext","urls"]},"SiteType":{"type":"string","description":"The type of the site","enum":["basic","premium","ultimate","sponsored","legacy-basic","legacy-premium"]},"SiteTitle":{"type":"string","description":"Title of the site","minLength":2,"maxLength":128},"CustomizationFavicon":{"oneOf":[{"type":"object","properties":{"icon":{"$ref":"#/components/schemas/CustomizationThemedURL"}},"required":["icon"]},{"type":"object","properties":{"emoji":{"$ref":"#/components/schemas/Emoji"}},"required":["emoji"]},{"type":"object","properties":{},"additionalProperties":false}]},"CustomizationThemedURL":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/URL"},"dark":{"$ref":"#/components/schemas/URL"}},"required":["light","dark"]},"URL":{"type":"string","format":"uri","maxLength":2048},"Emoji":{"type":"string","maxLength":50,"format":"emoji","description":"Unicode codepoint or character of the emoji"},"SiteHostname":{"type":"string","description":"Custom hostname for the site, for e.g. docs.mycompany.com","pattern":"^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$","maxLength":512},"SiteBasename":{"type":"string","description":"Basename for the site. For e.g. api","minLength":1,"maxLength":100},"SiteProxy":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/SiteProxyOrigin"},"target":{"type":"string","description":"The target URL to which the requests at the origin URL should be proxied to."}},"required":["origin","target"]},"SiteProxyOrigin":{"type":"string","description":"Proxy URL for the site, for e.g. company.com/docs or www.company.com/developer/docs etc.","pattern":"^([\\w-]+\\.)*[\\w-]+\\.[a-zA-Z]{2,}(\\/[\\w-]+)+$","maxLength":512},"SiteVisibility":{"type":"string","description":"The visibility setting of the site determines the audience of the site.\n* `public`: Anyone can access the site, and the site is indexed by search engines.\n* `unlisted`: Anyone can access the site, and the site is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the site.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the site.\n","enum":["public","unlisted","share-link","visitor-auth"]},"SiteAdaptiveContent":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether adaptive content should be enabled on the site."}},"required":["enabled"]},"SiteAds":{"oneOf":[{"type":"object","required":["status","submittable"],"properties":{"status":{"type":"string","enum":["pending"]},"submittable":{"type":"boolean","description":"True if the user can submit the site for review."}}},{"type":"object","required":["status","topic"],"properties":{"status":{"type":"string","enum":["in-review"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"}}},{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["rejected"]},"reason":{"type":"string","description":"Reason for the rejection"}}},{"type":"object","required":["status","topic","zoneId"],"properties":{"status":{"type":"string","enum":["live","disabled"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"},"zoneId":{"type":"string","description":"The ad network zone ID"}}}]},"SiteAdsTopic":{"type":"string","description":"Topic of the content","enum":["webdev","crypto"]},"SiteAgentsContext":{"type":"string","description":"Defines if the site will be included in the agent's context.\n- `excluded` means that the agent will not be able to access the site.\n- `included` means that the agent will be able to access the site.\n","enum":["excluded","included"]},"SiteFeature":{"type":"object","description":"A site feature and the plan it is available on.","properties":{"id":{"$ref":"#/components/schemas/SiteFeatureKey"},"plan":{"$ref":"#/components/schemas/SiteType"},"frozen":{"description":"A frozen feature is still enabled but cannot be changed or modified.","type":"boolean"},"customizations":{"description":"A list of the actual advanced customizations used (only applicable for sites-advanced-customization)","type":"array","items":{"$ref":"#/components/schemas/SiteCustomizationFeature"}}},"required":["id","plan","frozen"]},"SiteFeatureKey":{"type":"string","description":"The site feature identifier","enum":["sites-adaptive-content","sites-advanced-customization","sites-advanced-insights","sites-ads","sites-ai-search","sites-ai-assistant","sites-embed","sites-api-playground","sites-basic-customization","sites-custom-domain","sites-custom-fonts","sites-custom-subdirectory","sites-full-text-search","sites-multivariant-site","sites-no-custom-domain","sites-page-feedback","sites-page-traffic-insights","sites-pdf-export","sites-preview-deployments","sites-public-visibility","sites-redirects","sites-search-insights","sites-sections","sites-seo","sites-share-links","sites-unlisted-visibility","sites-user-contribution","sites-visitor-authentication","sites-visitors"]},"SiteCustomizationFeature":{"type":"string","description":"A list of all premium customizations.","enum":["header-logo","header-primary-link","theme-preset","premium-fonts","custom-icons","footer-logo","footer-links","footer-copyright","semantic-colors"]}},"responses":{"NotFoundError":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[404]},"message":{"type":"string"}},"required":["code","message"]}}}}}}}},"paths":{"/orgs/{organizationId}/sites/{siteId}":{"get":{"operationId":"getSiteById","summary":"Get a site by its ID","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"404":{"description":"No matching site found","$ref":"#/components/responses/NotFoundError"}}}}}}
```

## DELETE /orgs/{organizationId}/sites/{siteId}

> Delete a site

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}}},"paths":{"/orgs/{organizationId}/sites/{siteId}":{"delete":{"operationId":"deleteSiteById","summary":"Delete a site","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"responses":{"204":{"description":"Site did not exist"},"205":{"description":"Site has been deleted"}}}}}}
```

## PATCH /orgs/{organizationId}/sites/{siteId}

> Update a site

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"SiteTitle":{"type":"string","description":"Title of the site","minLength":2,"maxLength":128},"SiteVisibility":{"type":"string","description":"The visibility setting of the site determines the audience of the site.\n* `public`: Anyone can access the site, and the site is indexed by search engines.\n* `unlisted`: Anyone can access the site, and the site is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the site.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the site.\n","enum":["public","unlisted","share-link","visitor-auth"]},"SiteBasename":{"type":"string","description":"Basename for the site. For e.g. api","minLength":1,"maxLength":100},"SiteAdaptiveContent":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether adaptive content should be enabled on the site."}},"required":["enabled"]},"SiteAgentsContext":{"type":"string","description":"Defines if the site will be included in the agent's context.\n- `excluded` means that the agent will not be able to access the site.\n- `included` means that the agent will be able to access the site.\n","enum":["excluded","included"]},"SiteProxyOrigin":{"type":"string","description":"Proxy URL for the site, for e.g. company.com/docs or www.company.com/developer/docs etc.","pattern":"^([\\w-]+\\.)*[\\w-]+\\.[a-zA-Z]{2,}(\\/[\\w-]+)+$","maxLength":512},"Site":{"type":"object","properties":{"object":{"type":"string","enum":["site"]},"id":{"type":"string","description":"Unique identifier of the site"},"type":{"$ref":"#/components/schemas/SiteType"},"appliedType":{"$ref":"#/components/schemas/SiteType","description":"The currently applied type of the site. For example, frozen sites will have this set to Basic."},"title":{"$ref":"#/components/schemas/SiteTitle"},"icon":{"oneOf":[{"$ref":"#/components/schemas/CustomizationFavicon"},{"type":"string","nullable":true,"enum":[null]}]},"hostname":{"$ref":"#/components/schemas/SiteHostname"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"proxy":{"$ref":"#/components/schemas/SiteProxy"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"published":{"type":"boolean","description":"Whether the site is live or not. If true, the site is accessible to the audience defined by the visibility setting."},"siteSpaces":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"ads":{"$ref":"#/components/schemas/SiteAds"},"agentsContext":{"$ref":"#/components/schemas/SiteAgentsContext"},"features":{"description":"A list of all premium features enabled on this site. For each feature we list the plan they belong to and whether the feature is frozen. A frozen feature is still enabled but cannot be changed or modified.\n","type":"array","items":{"$ref":"#/components/schemas/SiteFeature"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the site in the API","format":"uri"},"app":{"type":"string","description":"URL of the site in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the site. Only defined when site is published.","format":"uri"}},"required":["app","location"]}},"required":["object","id","type","appliedType","title","visibility","published","createdAt","siteSpaces","features","agentsContext","urls"]},"SiteType":{"type":"string","description":"The type of the site","enum":["basic","premium","ultimate","sponsored","legacy-basic","legacy-premium"]},"CustomizationFavicon":{"oneOf":[{"type":"object","properties":{"icon":{"$ref":"#/components/schemas/CustomizationThemedURL"}},"required":["icon"]},{"type":"object","properties":{"emoji":{"$ref":"#/components/schemas/Emoji"}},"required":["emoji"]},{"type":"object","properties":{},"additionalProperties":false}]},"CustomizationThemedURL":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/URL"},"dark":{"$ref":"#/components/schemas/URL"}},"required":["light","dark"]},"URL":{"type":"string","format":"uri","maxLength":2048},"Emoji":{"type":"string","maxLength":50,"format":"emoji","description":"Unicode codepoint or character of the emoji"},"SiteHostname":{"type":"string","description":"Custom hostname for the site, for e.g. docs.mycompany.com","pattern":"^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$","maxLength":512},"SiteProxy":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/SiteProxyOrigin"},"target":{"type":"string","description":"The target URL to which the requests at the origin URL should be proxied to."}},"required":["origin","target"]},"SiteAds":{"oneOf":[{"type":"object","required":["status","submittable"],"properties":{"status":{"type":"string","enum":["pending"]},"submittable":{"type":"boolean","description":"True if the user can submit the site for review."}}},{"type":"object","required":["status","topic"],"properties":{"status":{"type":"string","enum":["in-review"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"}}},{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["rejected"]},"reason":{"type":"string","description":"Reason for the rejection"}}},{"type":"object","required":["status","topic","zoneId"],"properties":{"status":{"type":"string","enum":["live","disabled"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"},"zoneId":{"type":"string","description":"The ad network zone ID"}}}]},"SiteAdsTopic":{"type":"string","description":"Topic of the content","enum":["webdev","crypto"]},"SiteFeature":{"type":"object","description":"A site feature and the plan it is available on.","properties":{"id":{"$ref":"#/components/schemas/SiteFeatureKey"},"plan":{"$ref":"#/components/schemas/SiteType"},"frozen":{"description":"A frozen feature is still enabled but cannot be changed or modified.","type":"boolean"},"customizations":{"description":"A list of the actual advanced customizations used (only applicable for sites-advanced-customization)","type":"array","items":{"$ref":"#/components/schemas/SiteCustomizationFeature"}}},"required":["id","plan","frozen"]},"SiteFeatureKey":{"type":"string","description":"The site feature identifier","enum":["sites-adaptive-content","sites-advanced-customization","sites-advanced-insights","sites-ads","sites-ai-search","sites-ai-assistant","sites-embed","sites-api-playground","sites-basic-customization","sites-custom-domain","sites-custom-fonts","sites-custom-subdirectory","sites-full-text-search","sites-multivariant-site","sites-no-custom-domain","sites-page-feedback","sites-page-traffic-insights","sites-pdf-export","sites-preview-deployments","sites-public-visibility","sites-redirects","sites-search-insights","sites-sections","sites-seo","sites-share-links","sites-unlisted-visibility","sites-user-contribution","sites-visitor-authentication","sites-visitors"]},"SiteCustomizationFeature":{"type":"string","description":"A list of all premium customizations.","enum":["header-logo","header-primary-link","theme-preset","premium-fonts","custom-icons","footer-logo","footer-links","footer-copyright","semantic-colors"]}}},"paths":{"/orgs/{organizationId}/sites/{siteId}":{"patch":{"operationId":"updateSiteById","summary":"Update a site","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"$ref":"#/components/schemas/SiteTitle"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"agentsContext":{"$ref":"#/components/schemas/SiteAgentsContext"},"defaultSiteSpace":{"type":"string","description":"ID of the site-space to be used as the default at the root level. If site has sections, this will mark the default site space in the site's default section."},"defaultSiteSection":{"type":"string","description":"ID of the site-section to be used as the default."},"proxy":{"description":"Configure a proxy URL for a site. For example, you can use it to host the site on a subdirectory of your domain like `https://company.com/docs`.\nUse `null` to remove the proxy.\n","oneOf":[{"$ref":"#/components/schemas/SiteProxyOrigin"},{"type":"string","nullable":true,"enum":[null]}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}}}}}}}
```

## GET /orgs/{organizationId}/sites/{siteId}/adaptive-schema

> Get the JSON schema describing the attributes expected for an Adaptive content site visitor.

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"SiteAdaptiveSchema":{"type":"object","properties":{"object":{"type":"string","enum":["site-adaptive-schema"]},"jsonSchema":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchema"},"updatedAt":{"description":"When the adaptive schema was updated.","$ref":"#/components/schemas/Timestamp"}},"required":["object","jsonSchema","updatedAt"]},"SiteAdaptiveJSONSchema":{"type":"object","description":"JSON schema describing the expected attributes of an Adaptive site schema.","properties":{"$schema":{"type":"string","enum":["http://json-schema.org/draft-07/schema#"]},"type":{"type":"string","enum":["object"]},"properties":{"type":"object","properties":{"unsigned":{"type":"object","description":"Unsigned claims of the site visitor.","properties":{"type":{"type":"string","enum":["object"]},"description":{"type":"string","enum":["Unsigned claims of the site visitor."]},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaClaimsProperties"}},"additionalProperties":{"type":"boolean","enum":[false]}},"required":["type","description","properties","additionalProperties"]}},"additionalProperties":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaClaimsProperties"}},"additionalProperties":{"type":"boolean","enum":[false]}},"required":["type","properties","additionalProperties"],"additionalProperties":false},"SiteAdaptiveJSONSchemaClaimsProperties":{"oneOf":[{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaPrimitives"},{"type":"object","properties":{"type":{"type":"string","enum":["array"]},"description":{"type":"string"},"items":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaPrimitives"}},"required":["type","description","items"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["object"]},"description":{"type":"string"},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaClaimsProperties"}},"additionalProperties":{"type":"boolean","enum":[false]}},"required":["type","description","properties","additionalProperties"],"additionalProperties":false}]},"SiteAdaptiveJSONSchemaPrimitives":{"oneOf":[{"$ref":"#/components/schemas/SiteAdaptiveDeterministicJSONSchemaPrimitives"},{"type":"object","properties":{"type":{"type":"string","enum":["string"]},"description":{"type":"string"}},"required":["type","description"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"description":{"type":"string"}},"required":["type","description"],"additionalProperties":false}]},"SiteAdaptiveDeterministicJSONSchemaPrimitives":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"description":{"type":"string"}},"required":["type","description"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["string"]},"enum":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["type","enum","description"],"additionalProperties":false}]},"Timestamp":{"type":"string","format":"date-time"},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}},"required":["code","message"]}}}},"responses":{"NotFoundError":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[404]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"UnexpectedError":{"description":"Unexpected Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/adaptive-schema":{"get":{"operationId":"getSiteAdaptiveSchema","summary":"Get the JSON schema describing the attributes expected for an Adaptive content site visitor.","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"responses":{"200":{"description":"The JSON schema that defines the attributes expected from a visitor of the Adaptive content site.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteAdaptiveSchema"}}}},"404":{"description":"No visitor attributes schema found for the site.","$ref":"#/components/responses/NotFoundError"},"default":{"$ref":"#/components/responses/UnexpectedError"}}}}}}
```

## PUT /orgs/{organizationId}/sites/{siteId}/adaptive-schema

> Update the JSON schema of the attributes expected for an Adaptive content site visitor.

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"SiteAdaptiveJSONSchema":{"type":"object","description":"JSON schema describing the expected attributes of an Adaptive site schema.","properties":{"$schema":{"type":"string","enum":["http://json-schema.org/draft-07/schema#"]},"type":{"type":"string","enum":["object"]},"properties":{"type":"object","properties":{"unsigned":{"type":"object","description":"Unsigned claims of the site visitor.","properties":{"type":{"type":"string","enum":["object"]},"description":{"type":"string","enum":["Unsigned claims of the site visitor."]},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaClaimsProperties"}},"additionalProperties":{"type":"boolean","enum":[false]}},"required":["type","description","properties","additionalProperties"]}},"additionalProperties":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaClaimsProperties"}},"additionalProperties":{"type":"boolean","enum":[false]}},"required":["type","properties","additionalProperties"],"additionalProperties":false},"SiteAdaptiveJSONSchemaClaimsProperties":{"oneOf":[{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaPrimitives"},{"type":"object","properties":{"type":{"type":"string","enum":["array"]},"description":{"type":"string"},"items":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaPrimitives"}},"required":["type","description","items"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["object"]},"description":{"type":"string"},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchemaClaimsProperties"}},"additionalProperties":{"type":"boolean","enum":[false]}},"required":["type","description","properties","additionalProperties"],"additionalProperties":false}]},"SiteAdaptiveJSONSchemaPrimitives":{"oneOf":[{"$ref":"#/components/schemas/SiteAdaptiveDeterministicJSONSchemaPrimitives"},{"type":"object","properties":{"type":{"type":"string","enum":["string"]},"description":{"type":"string"}},"required":["type","description"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"description":{"type":"string"}},"required":["type","description"],"additionalProperties":false}]},"SiteAdaptiveDeterministicJSONSchemaPrimitives":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["boolean"]},"description":{"type":"string"}},"required":["type","description"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["string"]},"enum":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["type","enum","description"],"additionalProperties":false}]},"SiteAdaptiveSchema":{"type":"object","properties":{"object":{"type":"string","enum":["site-adaptive-schema"]},"jsonSchema":{"$ref":"#/components/schemas/SiteAdaptiveJSONSchema"},"updatedAt":{"description":"When the adaptive schema was updated.","$ref":"#/components/schemas/Timestamp"}},"required":["object","jsonSchema","updatedAt"]},"Timestamp":{"type":"string","format":"date-time"},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}},"required":["code","message"]}}}},"responses":{"BadRequestError":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[400]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"UnexpectedError":{"description":"Unexpected Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/adaptive-schema":{"put":{"operationId":"updateSiteAdaptiveSchema","summary":"Update the JSON schema of the attributes expected for an Adaptive content site visitor.","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonSchema":{"description":"The JSON schema to set on the site.","$ref":"#/components/schemas/SiteAdaptiveJSONSchema"}},"required":["jsonSchema"]}}}},"responses":{"200":{"description":"The site adaptive schema has been updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteAdaptiveSchema"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"default":{"$ref":"#/components/responses/UnexpectedError"}}}}}}
```

## GET /orgs/{organizationId}/sites/{siteId}/adaptive-schema/template-conditions

> List templates of conditions generated based on the site visitor schema that can be used in adaptive content expressions.

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]},{"user-internal":[]},{"user-staff":[]},{"user-internal-or-staff":[]},{"integration":[]},{"integration-installation":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"},"user-internal":{"type":"http","scheme":"bearer"},"user-staff":{"type":"http","scheme":"bearer"},"user-internal-or-staff":{"type":"http","scheme":"bearer"},"integration":{"type":"http","scheme":"bearer"},"integration-installation":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"SiteAdaptiveTemplateCondition":{"type":"object","description":"A template condition based on the site visitor schema.","properties":{"description":{"type":"string","description":"A short description of the suggested condition."},"condition":{"type":"string","description":"The suggested condition."}},"required":["description","condition"]}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/adaptive-schema/template-conditions":{"get":{"operationId":"listSiteAdaptiveTemplateConditions","summary":"List templates of conditions generated based on the site visitor schema that can be used in adaptive content expressions.","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"responses":{"200":{"description":"List of template conditions generated based on the site visitor schema.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SiteAdaptiveTemplateCondition"}}},"required":["items"]}}}}}}}}}
```

## Get a published site

> Get the complete profile of a site in an organization to provide the published experience. It includes site, customization, structure, integration scripts etc.

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"siteShareKey":{"name":"shareKey","in":"query","description":"For sites published via share-links, the share key is useful to resolve published URLs.","schema":{"type":"string"}}},"schemas":{"PublishedContentSite":{"type":"object","properties":{"object":{"type":"string","enum":["published-content-site"]},"site":{"$ref":"#/components/schemas/Site"},"structure":{"$ref":"#/components/schemas/SiteStructure"},"customizations":{"type":"object","properties":{"site":{"$ref":"#/components/schemas/SiteCustomizationSettings"},"siteSpaces":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SiteCustomizationSettings"}}},"required":["site","siteSpaces"]},"scripts":{"type":"array","items":{"$ref":"#/components/schemas/SiteIntegrationScript"}}},"required":["object","site","structure","customizations","scripts"]},"Site":{"type":"object","properties":{"object":{"type":"string","enum":["site"]},"id":{"type":"string","description":"Unique identifier of the site"},"type":{"$ref":"#/components/schemas/SiteType"},"appliedType":{"$ref":"#/components/schemas/SiteType","description":"The currently applied type of the site. For example, frozen sites will have this set to Basic."},"title":{"$ref":"#/components/schemas/SiteTitle"},"icon":{"oneOf":[{"$ref":"#/components/schemas/CustomizationFavicon"},{"type":"string","nullable":true,"enum":[null]}]},"hostname":{"$ref":"#/components/schemas/SiteHostname"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"proxy":{"$ref":"#/components/schemas/SiteProxy"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"published":{"type":"boolean","description":"Whether the site is live or not. If true, the site is accessible to the audience defined by the visibility setting."},"siteSpaces":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"ads":{"$ref":"#/components/schemas/SiteAds"},"agentsContext":{"$ref":"#/components/schemas/SiteAgentsContext"},"features":{"description":"A list of all premium features enabled on this site. For each feature we list the plan they belong to and whether the feature is frozen. A frozen feature is still enabled but cannot be changed or modified.\n","type":"array","items":{"$ref":"#/components/schemas/SiteFeature"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the site in the API","format":"uri"},"app":{"type":"string","description":"URL of the site in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the site. Only defined when site is published.","format":"uri"}},"required":["app","location"]}},"required":["object","id","type","appliedType","title","visibility","published","createdAt","siteSpaces","features","agentsContext","urls"]},"SiteType":{"type":"string","description":"The type of the site","enum":["basic","premium","ultimate","sponsored","legacy-basic","legacy-premium"]},"SiteTitle":{"type":"string","description":"Title of the site","minLength":2,"maxLength":128},"CustomizationFavicon":{"oneOf":[{"type":"object","properties":{"icon":{"$ref":"#/components/schemas/CustomizationThemedURL"}},"required":["icon"]},{"type":"object","properties":{"emoji":{"$ref":"#/components/schemas/Emoji"}},"required":["emoji"]},{"type":"object","properties":{},"additionalProperties":false}]},"CustomizationThemedURL":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/URL"},"dark":{"$ref":"#/components/schemas/URL"}},"required":["light","dark"]},"URL":{"type":"string","format":"uri","maxLength":2048},"Emoji":{"type":"string","maxLength":50,"format":"emoji","description":"Unicode codepoint or character of the emoji"},"SiteHostname":{"type":"string","description":"Custom hostname for the site, for e.g. docs.mycompany.com","pattern":"^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$","maxLength":512},"SiteBasename":{"type":"string","description":"Basename for the site. For e.g. api","minLength":1,"maxLength":100},"SiteProxy":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/SiteProxyOrigin"},"target":{"type":"string","description":"The target URL to which the requests at the origin URL should be proxied to."}},"required":["origin","target"]},"SiteProxyOrigin":{"type":"string","description":"Proxy URL for the site, for e.g. company.com/docs or www.company.com/developer/docs etc.","pattern":"^([\\w-]+\\.)*[\\w-]+\\.[a-zA-Z]{2,}(\\/[\\w-]+)+$","maxLength":512},"SiteVisibility":{"type":"string","description":"The visibility setting of the site determines the audience of the site.\n* `public`: Anyone can access the site, and the site is indexed by search engines.\n* `unlisted`: Anyone can access the site, and the site is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the site.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the site.\n","enum":["public","unlisted","share-link","visitor-auth"]},"SiteAdaptiveContent":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether adaptive content should be enabled on the site."}},"required":["enabled"]},"SiteAds":{"oneOf":[{"type":"object","required":["status","submittable"],"properties":{"status":{"type":"string","enum":["pending"]},"submittable":{"type":"boolean","description":"True if the user can submit the site for review."}}},{"type":"object","required":["status","topic"],"properties":{"status":{"type":"string","enum":["in-review"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"}}},{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["rejected"]},"reason":{"type":"string","description":"Reason for the rejection"}}},{"type":"object","required":["status","topic","zoneId"],"properties":{"status":{"type":"string","enum":["live","disabled"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"},"zoneId":{"type":"string","description":"The ad network zone ID"}}}]},"SiteAdsTopic":{"type":"string","description":"Topic of the content","enum":["webdev","crypto"]},"SiteAgentsContext":{"type":"string","description":"Defines if the site will be included in the agent's context.\n- `excluded` means that the agent will not be able to access the site.\n- `included` means that the agent will be able to access the site.\n","enum":["excluded","included"]},"SiteFeature":{"type":"object","description":"A site feature and the plan it is available on.","properties":{"id":{"$ref":"#/components/schemas/SiteFeatureKey"},"plan":{"$ref":"#/components/schemas/SiteType"},"frozen":{"description":"A frozen feature is still enabled but cannot be changed or modified.","type":"boolean"},"customizations":{"description":"A list of the actual advanced customizations used (only applicable for sites-advanced-customization)","type":"array","items":{"$ref":"#/components/schemas/SiteCustomizationFeature"}}},"required":["id","plan","frozen"]},"SiteFeatureKey":{"type":"string","description":"The site feature identifier","enum":["sites-adaptive-content","sites-advanced-customization","sites-advanced-insights","sites-ads","sites-ai-search","sites-ai-assistant","sites-embed","sites-api-playground","sites-basic-customization","sites-custom-domain","sites-custom-fonts","sites-custom-subdirectory","sites-full-text-search","sites-multivariant-site","sites-no-custom-domain","sites-page-feedback","sites-page-traffic-insights","sites-pdf-export","sites-preview-deployments","sites-public-visibility","sites-redirects","sites-search-insights","sites-sections","sites-seo","sites-share-links","sites-unlisted-visibility","sites-user-contribution","sites-visitor-authentication","sites-visitors"]},"SiteCustomizationFeature":{"type":"string","description":"A list of all premium customizations.","enum":["header-logo","header-primary-link","theme-preset","premium-fonts","custom-icons","footer-logo","footer-links","footer-copyright","semantic-colors"]},"SiteStructure":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["sections"]},"structure":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/SiteSection"},{"$ref":"#/components/schemas/SiteSectionGroup"}]}}},"required":["type","structure"]},{"type":"object","properties":{"type":{"type":"string","enum":["siteSpaces"]},"structure":{"type":"array","items":{"$ref":"#/components/schemas/SiteSpace"}}},"required":["type","structure"]}]},"SiteSection":{"type":"object","properties":{"object":{"type":"string","description":"The object type, which is always \"site-section\"","enum":["site-section"]},"id":{"type":"string","description":"Unique identifier of the site section"},"title":{"$ref":"#/components/schemas/SiteSectionTitle"},"description":{"$ref":"#/components/schemas/SiteSectionDescription"},"default":{"type":"boolean","description":"Whether this is the default section for the site"},"path":{"$ref":"#/components/schemas/SiteSectionPath"},"condition":{"description":"Conditional expression used to evaluate whether the site section should be shown to the site's visitor.","$ref":"#/components/schemas/Expression"},"sectionGroup":{"type":"string","description":"ID of the section group the section belongs to in the site"},"siteSpaces":{"type":"array","items":{"$ref":"#/components/schemas/SiteSpace"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"published":{"type":"string","description":"URL of the published version of the site section. Only defined when site is published.","format":"uri"}}},"icon":{"$ref":"#/components/schemas/Icon"}},"required":["object","id","title","path","siteSpaces","urls"]},"SiteSectionTitle":{"type":"string","description":"Title of the site section","minLength":2,"maxLength":128},"SiteSectionDescription":{"type":"string","description":"Description of the site section","minLength":0,"maxLength":256},"SiteSectionPath":{"type":"string","description":"Path to the section on the site","minLength":1,"maxLength":100},"Expression":{"type":"string","description":"Expression to evaluate","minLength":0,"maxLength":1024},"SiteSpace":{"type":"object","properties":{"object":{"type":"string","description":"The object type, which is always \"site-space\"","enum":["site-space"]},"id":{"type":"string","description":"Unique identifier of the site-space"},"path":{"$ref":"#/components/schemas/SiteSpacePath"},"section":{"type":"string","description":"ID of the section the space belongs to in the site"},"space":{"$ref":"#/components/schemas/Space"},"title":{"type":"string"},"default":{"type":"boolean","description":"Whether this is the default space for the site"},"condition":{"description":"Conditional expression used to evaluate whether the site space should be shown to the site's visitor.","$ref":"#/components/schemas/Expression"},"hasAdvancedCustomizationFeature":{"type":"boolean","description":"Whether the space has advanced customization feature enabled"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"published":{"type":"string","description":"URL of the published version of the site-space. Only defined when site is published.","format":"uri"}}},"hidden":{"type":"boolean","description":"Whether the site space is hidden. If true, the site space will not be shown in the site's navigation."}},"required":["object","id","space","title","path","urls"]},"SiteSpacePath":{"type":"string","description":"Path to the space on the site","minLength":1,"maxLength":100},"Space":{"type":"object","properties":{"object":{"type":"string","description":"Type of Object, always equals to \"space\"","enum":["space"]},"id":{"type":"string","description":"Unique identifier for the space"},"title":{"$ref":"#/components/schemas/SpaceTitle"},"emoji":{"description":"An emoji for this space. It'll match the emoji shown in the GitBook app.","$ref":"#/components/schemas/Emoji"},"visibility":{"$ref":"#/components/schemas/ContentVisibility"},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"deletedAt":{"$ref":"#/components/schemas/Timestamp"},"editMode":{"$ref":"#/components/schemas/SpaceEditMode"},"mergeRules":{"$ref":"#/components/schemas/MergeRulesSpaceConfiguration"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the space in the API","format":"uri"},"app":{"type":"string","description":"URL of the space in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the space. Only defined when visibility is not \"private.\"","format":"uri"},"public":{"type":"string","description":"URL of the public version of the space. Only defined when visibility is \"public\".","format":"uri"},"icon":{"description":"URL of the icon of this space, if defined.","$ref":"#/components/schemas/URL"}},"required":["app","location"]},"organization":{"type":"string","description":"ID of the organization owning this space"},"parent":{"type":"string","description":"ID of the parent collection."},"language":{"$ref":"#/components/schemas/TranslationLanguage"},"gitSync":{"$ref":"#/components/schemas/GitSyncState"},"visitorAuth":{"$ref":"#/components/schemas/VisitorAuth"},"revision":{"type":"string","description":"ID of the active revision in the space."},"defaultLevel":{"$ref":"#/components/schemas/DefaultLevel"},"comments":{"type":"number","description":"Count of opened comments on the space."},"changeRequests":{"type":"number","description":"Total count of change requests on the space."},"changeRequestsOpen":{"type":"number","description":"Count of open change requests on the space."},"changeRequestsDraft":{"type":"number","description":"Count of draft change requests on the space."},"internal_poweredByV2":{"type":"boolean","description":"Whether the space is powered by V2 of the content system."},"permissions":{"type":"object","description":"The set of permissions for the space","properties":{"view":{"type":"boolean","description":"Can the user view the space content."},"access":{"type":"boolean","description":"Can the user access the space in the application."},"admin":{"type":"boolean","description":"Can the user edit the title, install integrations, and manage the space."},"viewInviteLinks":{"type":"boolean","description":"Can the user view the invite links of the space."},"edit":{"type":"boolean","description":"Can the user edit the content of the space by creating a change request."},"triggerGitSync":{"type":"boolean","description":"Can the user trigger a git sync."},"comment":{"type":"boolean","description":"Can the user comment on the content."},"merge":{"type":"boolean","description":"Can the user merge change requests."},"review":{"type":"boolean","description":"Can the user review change requests."},"installIntegration":{"type":"boolean","description":"Can the user install integrations in the space."}},"required":["view","access","admin","viewInviteLinks","edit","triggerGitSync","comment","merge","review","installIntegration"]}},"required":["object","id","title","emoji","organization","visibility","revision","createdAt","updatedAt","comments","changeRequests","changeRequestsOpen","changeRequestsDraft","mergeRules","urls","defaultLevel","permissions"]},"SpaceTitle":{"type":"string","description":"Title of the space","maxLength":50},"ContentVisibility":{"type":"string","description":"* `public`: Anyone can access the content, and the content is indexed by search engines.\n* `unlisted`: Anyone can access the content, and the content is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the content.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the content.\n* `in-collection`: Anyone who can access the parent collection can access the content.\n  Only available for spaces in a collection.\n* `private`: Authorized members can access the content.\n","enum":["public","unlisted","share-link","visitor-auth","in-collection","private"]},"Timestamp":{"type":"string","format":"date-time"},"SpaceEditMode":{"type":"string","description":"Determines how a Space can be edited.\n* `live`: Users can directly edit the space\n* `locked`: All edits are locked for this space.\n","enum":["live","locked"]},"MergeRulesSpaceConfiguration":{"oneOf":[{"$ref":"#/components/schemas/MergeRulesConfigurationInherit"},{"$ref":"#/components/schemas/MergeRulesStandaloneConfiguration"}]},"MergeRulesConfigurationInherit":{"type":"object","description":"The merge rules inherits from the organization configuration.","properties":{"type":{"type":"string","enum":["inherit"]}},"required":["type"]},"MergeRulesStandaloneConfiguration":{"oneOf":[{"$ref":"#/components/schemas/MergeRulesConfigurationRules"},{"$ref":"#/components/schemas/MergeRulesConfigurationNone"}]},"MergeRulesConfigurationRules":{"type":"object","description":"The merge rules are composed of individual rules that must all pass.","properties":{"type":{"type":"string","enum":["rules"]},"rules":{"type":"array","items":{"$ref":"#/components/schemas/MergeRule"}}},"required":["type","rules"]},"MergeRule":{"oneOf":[{"type":"object","properties":{"rule":{"type":"string","enum":["require_specific_reviewers"]},"users":{"type":"array","description":"List of user IDs.","items":{"type":"string"}}},"required":["rule","users"]},{"type":"object","properties":{"rule":{"type":"string","enum":["require_one_of_specific_reviewers"]},"users":{"type":"array","description":"List of user IDs.","items":{"type":"string"}}},"required":["rule","users"]},{"type":"object","properties":{"rule":{"type":"string","enum":["allow_bypass"]},"users":{"type":"array","description":"List of user IDs.","items":{"type":"string"}}},"required":["rule","users"]},{"type":"object","properties":{"rule":{"type":"string","enum":["require_at_least_one_review","require_at_least_one_approved_review","require_all_reviews_approved","require_agent_review","require_up_to_date_change_request","require_change_request_subject","require_change_request_description","require_author_to_merge"]}},"required":["rule"]},{"type":"object","description":"The merge rule is written in the advanced custom expression syntax.","properties":{"rule":{"type":"string","enum":["custom"]},"expression":{"$ref":"#/components/schemas/Expression"}},"required":["rule","expression"]}]},"MergeRulesConfigurationNone":{"type":"object","description":"The merge rules are disabled, change requests can be merged without review.","properties":{"type":{"type":"string","enum":["none"]}},"required":["type"]},"TranslationLanguage":{"type":"string","enum":["en","fr","de","es","it","pt","pt-br","ru","ja","zh","yue","ko","ar","hi","nl","pl","tr","sv","no","da","fi","el","cs","hu","ro","th","vi","id","ms","he","uk","sk","bg","hr","lt","lv","et","sl"]},"GitSyncState":{"type":"object","properties":{"repoName":{"type":"string","description":"Repository name."},"installationProvider":{"$ref":"#/components/schemas/GitSyncProvider"},"integration":{"type":"string","description":"The integration name providing the Git Sync."},"url":{"type":"string","description":"The URL to the repository tree, used when rendering public content."},"updatedAt":{"description":"When the Git provider details were last updated","$ref":"#/components/schemas/Timestamp"}}},"GitSyncProvider":{"type":"string","description":"The provider of the Git Sync installation.","enum":["github","gitlab","github-legacy"]},"VisitorAuth":{"oneOf":[{"$ref":"#/components/schemas/VisitorAuthCustomBackend"},{"allOf":[{"$ref":"#/components/schemas/VisitorAuthIntegrationBackend"},{"type":"object","properties":{"integration":{"type":"string","description":"Name of integration being used as the backend for authenticated access"}},"required":["integration"]}]}]},"VisitorAuthCustomBackend":{"type":"object","title":"Custom backend for authenticated access","properties":{"backend":{"type":"string","description":"Custom backend for authenticated access","enum":["custom"]}},"required":["backend"]},"VisitorAuthIntegrationBackend":{"type":"object","title":"Integration backend for authenticated access","properties":{"backend":{"type":"string","description":"Integration as backend for authenticated access","enum":["integration"]}},"required":["backend"]},"DefaultLevel":{"description":"Default level for a piece of content","oneOf":[{"$ref":"#/components/schemas/MemberRoleOrGuest"},{"type":"string","enum":["inherit"]}]},"MemberRoleOrGuest":{"description":"The role of a member in an organization, null for guests","oneOf":[{"$ref":"#/components/schemas/MemberRole"},{"type":"string","nullable":true,"enum":[null]}]},"MemberRole":{"type":"string","description":"\"The role of a member in an organization.\n\"admin\": Can administrate the content: create, delete spaces, ...\n\"create\": Can create content.\n\"review\": Can review content.\n\"edit\": Can edit the content (live or change requests).\n\"comment\": Can access the content and its discussions.\n\"read\": Can access the content, but cannot update it in any way.\n","enum":["admin","create","edit","review","comment","read"]},"Icon":{"type":"string","maxLength":50,"format":"icon","description":"Name of the icon"},"SiteSectionGroup":{"type":"object","properties":{"object":{"type":"string","description":"The object type, which is always \"site-section-group\"","enum":["site-section-group"]},"id":{"type":"string","description":"Unique identifier of the site section group"},"title":{"$ref":"#/components/schemas/SiteSectionGroupTitle"},"sections":{"type":"array","deprecated":true,"description":"List of site section ids that are members of the group. Use `children` instead.","items":{"$ref":"#/components/schemas/SiteSection"}},"sectionGroup":{"type":"string","description":"ID of the parent section group this group belongs to"},"children":{"type":"array","description":"List of all child sections and groups nested under this group","items":{"oneOf":[{"$ref":"#/components/schemas/SiteSection"},{"$ref":"#/components/schemas/SiteSectionGroup"}]}},"icon":{"$ref":"#/components/schemas/Icon"}},"required":["object","id","title","sections","children"]},"SiteSectionGroupTitle":{"type":"string","description":"Title of the site section group","minLength":1,"maxLength":100},"SiteCustomizationSettings":{"type":"object","properties":{"title":{"description":"Title to use for the published site. If not defined, it'll fallback to the default content title.","$ref":"#/components/schemas/SiteTitle"},"styling":{"type":"object","properties":{"theme":{"$ref":"#/components/schemas/CustomizationTheme"},"primaryColor":{"$ref":"#/components/schemas/CustomizationThemedColor"},"tint":{"$ref":"#/components/schemas/CustomizationTint"},"infoColor":{"$ref":"#/components/schemas/CustomizationThemedColor"},"successColor":{"$ref":"#/components/schemas/CustomizationThemedColor"},"warningColor":{"$ref":"#/components/schemas/CustomizationThemedColor"},"dangerColor":{"$ref":"#/components/schemas/CustomizationThemedColor"},"corners":{"$ref":"#/components/schemas/CustomizationCorners"},"depth":{"$ref":"#/components/schemas/CustomizationDepth"},"links":{"$ref":"#/components/schemas/CustomizationLinksStyle"},"font":{"$ref":"#/components/schemas/CustomizationFont"},"monospaceFont":{"$ref":"#/components/schemas/CustomizationMonospaceFont"},"background":{"deprecated":true,"$ref":"#/components/schemas/CustomizationBackground"},"icons":{"$ref":"#/components/schemas/CustomizationIconsStyle"},"codeTheme":{"type":"object","properties":{"default":{"$ref":"#/components/schemas/CustomizationThemedCodeTheme"},"openapi":{"$ref":"#/components/schemas/CustomizationThemedCodeTheme"}},"required":["default","openapi"]},"sidebar":{"type":"object","properties":{"background":{"$ref":"#/components/schemas/CustomizationSidebarBackgroundStyle"},"list":{"$ref":"#/components/schemas/CustomizationSidebarListStyle"}},"required":["background","list"]},"search":{"$ref":"#/components/schemas/CustomizationSearchStyle"}},"required":["theme","primaryColor","infoColor","successColor","warningColor","dangerColor","corners","depth","links","font","monospaceFont","codeTheme","background","icons","sidebar","search"]},"internationalization":{"type":"object","deprecated":true,"properties":{"locale":{"$ref":"#/components/schemas/CustomizationLocale"}},"required":["locale"]},"favicon":{"$ref":"#/components/schemas/CustomizationFavicon"},"header":{"type":"object","properties":{"preset":{"$ref":"#/components/schemas/CustomizationHeaderPreset"},"logo":{"$ref":"#/components/schemas/CustomizationThemedURL"},"primaryLink":{"description":"Destination to open when visitors click the site title/logo in the header.","$ref":"#/components/schemas/ContentRef"},"backgroundColor":{"deprecated":true,"description":"Color of the background in the header. This value is now deprecated in favour of the new theming colors.","$ref":"#/components/schemas/CustomizationThemedColor"},"linkColor":{"deprecated":true,"description":"Color of the links in the header. This value is now deprecated and will be phased out in favour of the new theming colors.","$ref":"#/components/schemas/CustomizationThemedColor"},"links":{"type":"array","items":{"$ref":"#/components/schemas/CustomizationHeaderItem"}}},"required":["preset","links"]},"footer":{"type":"object","properties":{"logo":{"$ref":"#/components/schemas/CustomizationThemedURL"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomizationFooterGroup"}},"copyright":{"type":"string","maxLength":300}},"required":["groups"]},"announcement":{"$ref":"#/components/schemas/CustomizationAnnouncement"},"themes":{"description":"Customization options for the dark/light theme modes.\n","type":"object","properties":{"default":{"$ref":"#/components/schemas/CustomizationThemeMode"},"toggeable":{"description":"Should the reader be able to switch between dark and light mode","type":"boolean"}},"required":["default","toggeable"]},"pdf":{"type":"object","properties":{"enabled":{"type":"boolean","description":"If true, PDF export is enabled for the published site."}},"required":["enabled"]},"feedback":{"type":"object","properties":{"enabled":{"type":"boolean","description":"If true, feedback gathering is enabled"}},"required":["enabled"]},"ai":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/CustomizationAIMode"},"suggestions":{"$ref":"#/components/schemas/CustomizationSuggestedQuestions"}},"required":["mode"]},"advancedCustomization":{"type":"object","properties":{"enabled":{"type":"boolean","description":"If true, Advanced customization is enabled"}},"required":["enabled"]},"git":{"type":"object","properties":{"showEditLink":{"type":"boolean","description":"Whether the published site should show a link to edit the content on the git provider set up in the Git Sync"}},"required":["showEditLink"]},"pageActions":{"type":"object","properties":{"externalAI":{"type":"boolean","description":"Whether actions to open ChatGPT, Anthropic, etc. should be available in the page menu."},"markdown":{"type":"boolean","description":"Whether the copy and open the markdown version of the page should be available in the page menu."},"mcp":{"type":"boolean","description":"Whether an action to connect to the docs using the MCP server should be available in the page menu."}},"required":["externalAI","markdown","mcp"]},"externalLinks":{"type":"object","properties":{"target":{"$ref":"#/components/schemas/SiteExternalLinksTarget"}},"required":["target"]},"pagination":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the pagination navigation should be displayed on pages."}},"required":["enabled"]},"trademark":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the GitBook trademark (\"Powered by GitBook\") should be visible"}},"required":["enabled"]},"privacyPolicy":{"type":"object","properties":{"url":{"$ref":"#/components/schemas/URL"}}},"socialPreview":{"type":"object","properties":{"url":{"$ref":"#/components/schemas/URL"}}},"socialAccounts":{"$ref":"#/components/schemas/SiteSocialAccounts"},"insights":{"type":"object","properties":{"trackingCookie":{"type":"boolean","description":"Whether GitBook identifies the visitor on the site using a cookie.","default":true}},"required":["trackingCookie"]}},"required":["styling","internationalization","favicon","header","footer","themes","pdf","feedback","ai","advancedCustomization","trademark","externalLinks","pagination","pageActions","git","privacyPolicy","socialPreview","socialAccounts","insights"]},"CustomizationTheme":{"type":"string","description":"The theme to apply to the site. Supercedes the old header preset themes.\n- `clean`: Modern theme featuring translucency and minimally-styled elements.\n- `muted`: Sophisticated theme with decreased contrast between elements.\n- `bold`: High-impact theme with prominent colors and strong contrasts.\n- `gradient`: Trendy theme featuring colorful gradients and splashes of color.\n","enum":["clean","muted","bold","gradient"]},"CustomizationThemedColor":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/Color"},"dark":{"$ref":"#/components/schemas/Color"}},"required":["light","dark"]},"Color":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}){1,2}$"},"CustomizationTint":{"type":"object","properties":{"color":{"$ref":"#/components/schemas/CustomizationThemedColor"}},"required":["color"]},"CustomizationCorners":{"type":"string","enum":["straight","rounded","circular"]},"CustomizationDepth":{"type":"string","description":"The degree of visual depth (through shadows, gradients and elevation effects) of elements on the site.\n- `subtle`: Subtle shadows and minimal elevation.\n- `flat`: Flat elements, no shadows and no elevation.\n","enum":["subtle","flat"]},"CustomizationLinksStyle":{"type":"string","description":"The style used for regular links in the main content, header and footer. Sidebar items are styled separately.\n- `default`: Links are colored in the primary color and feature an underline in the same color.\n- `accent`: Links are colored the same as body text and feature an underline in the primary color.\n","enum":["default","accent"]},"CustomizationFont":{"oneOf":[{"$ref":"#/components/schemas/CustomizationDefaultFont"},{"$ref":"#/components/schemas/CustomizationFontDefinitionInput"}]},"CustomizationDefaultFont":{"type":"string","enum":["ABCFavorit","Inter","Roboto","RobotoSlab","OpenSans","SourceSansPro","Lato","Ubuntu","Raleway","Merriweather","Overpass","NotoSans","IBMPlexSerif","Poppins","FiraSans"]},"CustomizationFontDefinitionInput":{"type":"object","description":"Defines a font family along with its various font-face declarations for use in CSS '@font-face' rules.","properties":{"id":{"type":"string","description":"A globally unique identifier for the font definition."},"custom":{"type":"boolean","description":"Whether the font is a custom font. If false, this font is provided by GitBook."},"fontFamily":{"$ref":"#/components/schemas/FontFamily"},"fontFaces":{"type":"array","description":"A list of font-face definitions, specifying variations such as weight and style.","items":{"$ref":"#/components/schemas/FontFace"},"minItems":1}},"required":["id","custom","fontFamily","fontFaces"]},"FontFamily":{"type":"string","description":"The human-readable font-family name used in CSS (e.g., \"Open Sans\", \"Playfair Display\").","minLength":1,"maxLength":50},"FontFace":{"type":"object","description":"A single font-face declaration specifying the weight and source files for a particular variation of the font.","properties":{"weight":{"$ref":"#/components/schemas/FontWeight"},"sources":{"type":"array","description":"Font source files provided in supported formats (e.g., woff2, woff).","items":{"$ref":"#/components/schemas/FontSource"},"minItems":1}},"required":["weight","sources"]},"FontWeight":{"type":"integer","description":"Numeric representation of the font weight (400=regular, 500=medium, 700=bold, 900=black).","minimum":1,"maximum":1000},"FontSource":{"type":"object","description":"A font file referenced within a font-face declaration, specifying the file's location and format.","properties":{"url":{"description":"The absolute or relative URL pointing to the font file.","$ref":"#/components/schemas/URL"},"format":{"type":"string","description":"The format of the font file. Prefer 'woff2' for modern browsers.","enum":["woff2","woff"]}},"required":["url"]},"CustomizationMonospaceFont":{"oneOf":[{"$ref":"#/components/schemas/CustomizationDefaultMonospaceFont"},{"$ref":"#/components/schemas/CustomizationFontDefinitionInput"}]},"CustomizationDefaultMonospaceFont":{"type":"string","enum":["FiraCode","IBMPlexMono","JetBrainsMono","SourceCodePro","RobotoMono","SpaceMono","DMMono","Inconsolata"]},"CustomizationBackground":{"type":"string","enum":["plain","match"],"deprecated":true,"description":"The background style has been deprecated and will be removed in a future release. Use the `tint` settings instead."},"CustomizationIconsStyle":{"type":"string","enum":["regular","solid","duotone","light","thin"]},"CustomizationThemedCodeTheme":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/CustomizationCodeTheme"},"dark":{"$ref":"#/components/schemas/CustomizationCodeTheme"}},"required":["light","dark"]},"CustomizationCodeTheme":{"type":"string","enum":["default-light","default-dark","monochrome-light","monochrome-dark","andromeeda","aurora-x","ayu-dark","catppuccin-frappe","catppuccin-latte","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","everforest-light","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","github-light","github-light-default","github-light-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","houston","kanagawa-dragon","kanagawa-lotus","kanagawa-wave","laserwave","light-plus","material-theme","material-theme-darker","material-theme-lighter","material-theme-ocean","material-theme-palenight","min-dark","min-light","monokai","night-owl","nord","one-dark-pro","one-light","plastic","poimandres","red","rose-pine","rose-pine-dawn","rose-pine-moon","slack-dark","slack-ochin","snazzy-light","solarized-dark","solarized-light","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark","vitesse-light"]},"CustomizationSidebarBackgroundStyle":{"type":"string","description":"- `default`: No background, content sits directly against sidebar edge.\n- `filled`: Muted background color that extends to sidebar edges.\n","enum":["default","filled"]},"CustomizationSidebarListStyle":{"type":"string","description":"- `default`: Simple list items without special styling, groups are inset with a line.\n- `pill`: Rounded capsule shape around selected/active items.\n- `line`: Continuous line next to all items, with colored line part for selected/active items.\n","enum":["default","pill","line"]},"CustomizationSearchStyle":{"type":"string","description":"The style of the search button.\n- `prominent`: large search bar in the middle of the header, with less room for other header items,\n- `subtle`: small search bar in the corner of the header, with more room for other header items.\n","enum":["prominent","subtle"]},"CustomizationLocale":{"type":"string","description":"Language for the UI element","deprecated":true,"enum":["en","fr","es","zh","ja","de","nl","no","pt-br","ru"]},"CustomizationHeaderPreset":{"type":"string","deprecated":true,"description":"The header preset to use for the site. This is a legacy setting and the site styling theme should be used instead.","enum":["default","bold","contrast","custom","none"]},"ContentRef":{"description":"A relative reference to content in GitBook.","oneOf":[{"$ref":"#/components/schemas/ContentRefFile"},{"$ref":"#/components/schemas/ContentRefURL"},{"$ref":"#/components/schemas/ContentRefPage"},{"$ref":"#/components/schemas/ContentRefAnchor"},{"$ref":"#/components/schemas/ContentRefUser"},{"$ref":"#/components/schemas/ContentRefCollection"},{"$ref":"#/components/schemas/ContentRefSpace"},{"$ref":"#/components/schemas/ContentRefReusableContent"},{"$ref":"#/components/schemas/ContentRefOpenAPI"}]},"ContentRefFile":{"type":"object","properties":{"kind":{"type":"string","enum":["file"]},"file":{"type":"string"},"space":{"description":"ID of the space the file is in. The file is considered as in the current space if none is provided.","type":"string"}},"required":["kind","file"]},"ContentRefURL":{"type":"object","properties":{"kind":{"type":"string","enum":["url"]},"url":{"type":"string"}},"required":["kind","url"]},"ContentRefPage":{"type":"object","properties":{"kind":{"type":"string","enum":["page"]},"page":{"type":"string"},"space":{"description":"ID of the space the page is in. The page is considered as in the current space if none is provided.","type":"string"}},"required":["kind","page"]},"ContentRefAnchor":{"type":"object","properties":{"kind":{"type":"string","enum":["anchor"]},"anchor":{"type":"string"},"space":{"description":"ID of the space the page is in. The page is considered as in the current space if none is provided.","type":"string"},"page":{"description":"ID of the page the anchor is in. The anchor is considered as in the current page if none is provided.","type":"string"}},"required":["kind","anchor"]},"ContentRefUser":{"type":"object","properties":{"kind":{"type":"string","enum":["user"]},"user":{"type":"string"}},"required":["kind","user"]},"ContentRefCollection":{"type":"object","properties":{"kind":{"type":"string","enum":["collection"]},"collection":{"type":"string"}},"required":["kind","collection"]},"ContentRefSpace":{"type":"object","properties":{"kind":{"type":"string","enum":["space"]},"space":{"type":"string"}},"required":["kind","space"]},"ContentRefReusableContent":{"type":"object","properties":{"kind":{"type":"string","enum":["reusable-content"]},"reusableContent":{"type":"string"},"space":{"type":"string","description":"The space in which the reusable content is defined. If undefined, the reusable content is assumed to be in the same space as the content reference."}},"required":["kind","reusableContent"]},"ContentRefOpenAPI":{"type":"object","properties":{"kind":{"type":"string","enum":["openapi"]},"spec":{"type":"string","description":"Slug of the OpenAPI specification"}},"required":["kind","spec"]},"CustomizationHeaderItem":{"type":"object","properties":{"title":{"type":"string"},"style":{"type":"string","enum":["link","button-primary","button-secondary"]},"to":{"oneOf":[{"$ref":"#/components/schemas/ContentRef"},{"type":"string","nullable":true,"enum":[null]}]},"links":{"type":"array","items":{"$ref":"#/components/schemas/CustomizationContentLink"}},"condition":{"description":"Conditional expression used to evaluate whether the header item should be shown to the site's visitor.","$ref":"#/components/schemas/Expression"}},"required":["title","links","to"]},"CustomizationContentLink":{"type":"object","properties":{"title":{"$ref":"#/components/schemas/CustomizationContentLinkTitle"},"to":{"$ref":"#/components/schemas/ContentRef"}},"required":["title","to"]},"CustomizationContentLinkTitle":{"type":"string","maxLength":64},"CustomizationFooterGroup":{"type":"object","properties":{"title":{"type":"string"},"links":{"type":"array","items":{"$ref":"#/components/schemas/CustomizationContentLink"}}},"required":["title","links"]},"CustomizationAnnouncement":{"type":"object","properties":{"enabled":{"description":"Whether to show the site's announcement.","type":"boolean"},"message":{"$ref":"#/components/schemas/CustomizationAnnouncementMessage"},"link":{"description":"The content or URL the announcement links to when clicked.","$ref":"#/components/schemas/CustomizationContentLink"},"style":{"description":"The style of the announcement. Used to style the banner with the right semantic color and enable/disable features like hiding the banner.","type":"string","enum":["info","warning","danger","success"]}},"required":["enabled","message","style"]},"CustomizationAnnouncementMessage":{"description":"The text content of the announcement.","type":"string","minLength":2,"maxLength":128},"CustomizationThemeMode":{"type":"string","enum":["light","dark"]},"CustomizationAIMode":{"type":"string","enum":["none","search","assistant"]},"CustomizationSuggestedQuestions":{"type":"array","description":"Suggested questions to display at the start of the chosen AI mode.","items":{"$ref":"#/components/schemas/CustomizationSuggestedQuestion"},"maxItems":5},"CustomizationSuggestedQuestion":{"type":"string","minLength":3,"maxLength":64},"SiteExternalLinksTarget":{"type":"string","description":"How external links should open when clicked.\n- `self`: External links open in the current tab.\n- `blank`: External links open in a new browser tab.\n","enum":["self","blank"]},"SiteSocialAccounts":{"type":"array","description":"The social accounts of the site.","items":{"$ref":"#/components/schemas/SiteSocialAccount"},"maxItems":10},"SiteSocialAccount":{"type":"object","properties":{"platform":{"$ref":"#/components/schemas/SiteSocialAccountPlatform"},"handle":{"$ref":"#/components/schemas/SiteSocialAccountHandle"},"display":{"type":"object","properties":{"footer":{"type":"boolean","default":true}},"required":["footer"]}},"required":["platform","handle","display"]},"SiteSocialAccountPlatform":{"description":"The platform of the social handle.","type":"string","enum":["twitter","instagram","facebook","linkedin","github","discord","slack","youtube","tiktok","reddit","bluesky","mastodon","threads","medium"]},"SiteSocialAccountHandle":{"description":"A handle on a social platform, without prefixes like the @ symbol.","type":"string","minLength":1,"maxLength":128},"SiteIntegrationScript":{"type":"object","properties":{"script":{"description":"Script URL to load.","$ref":"#/components/schemas/URL"},"contentSecurityPolicy":{"description":"Content Security Policy to secure the loading of this script.","type":"string"},"cookies":{"type":"boolean","description":"If true, the script will potentially load use cookies and visitors should be aware."}},"required":["script","cookies"]}},"responses":{"NotFoundError":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[404]},"message":{"type":"string"}},"required":["code","message"]}}}}}}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/published":{"get":{"operationId":"getPublishedContentSite","summary":"Get a published site","description":"Get the complete profile of a site in an organization to provide the published experience. It includes site, customization, structure, integration scripts etc.","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/siteShareKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishedContentSite"}}}},"404":{"description":"No matching site found","$ref":"#/components/responses/NotFoundError"}}}}}}
```

## POST /orgs/{organizationId}/sites/{siteId}/publish

> Publish a site

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"Site":{"type":"object","properties":{"object":{"type":"string","enum":["site"]},"id":{"type":"string","description":"Unique identifier of the site"},"type":{"$ref":"#/components/schemas/SiteType"},"appliedType":{"$ref":"#/components/schemas/SiteType","description":"The currently applied type of the site. For example, frozen sites will have this set to Basic."},"title":{"$ref":"#/components/schemas/SiteTitle"},"icon":{"oneOf":[{"$ref":"#/components/schemas/CustomizationFavicon"},{"type":"string","nullable":true,"enum":[null]}]},"hostname":{"$ref":"#/components/schemas/SiteHostname"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"proxy":{"$ref":"#/components/schemas/SiteProxy"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"published":{"type":"boolean","description":"Whether the site is live or not. If true, the site is accessible to the audience defined by the visibility setting."},"siteSpaces":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"ads":{"$ref":"#/components/schemas/SiteAds"},"agentsContext":{"$ref":"#/components/schemas/SiteAgentsContext"},"features":{"description":"A list of all premium features enabled on this site. For each feature we list the plan they belong to and whether the feature is frozen. A frozen feature is still enabled but cannot be changed or modified.\n","type":"array","items":{"$ref":"#/components/schemas/SiteFeature"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the site in the API","format":"uri"},"app":{"type":"string","description":"URL of the site in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the site. Only defined when site is published.","format":"uri"}},"required":["app","location"]}},"required":["object","id","type","appliedType","title","visibility","published","createdAt","siteSpaces","features","agentsContext","urls"]},"SiteType":{"type":"string","description":"The type of the site","enum":["basic","premium","ultimate","sponsored","legacy-basic","legacy-premium"]},"SiteTitle":{"type":"string","description":"Title of the site","minLength":2,"maxLength":128},"CustomizationFavicon":{"oneOf":[{"type":"object","properties":{"icon":{"$ref":"#/components/schemas/CustomizationThemedURL"}},"required":["icon"]},{"type":"object","properties":{"emoji":{"$ref":"#/components/schemas/Emoji"}},"required":["emoji"]},{"type":"object","properties":{},"additionalProperties":false}]},"CustomizationThemedURL":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/URL"},"dark":{"$ref":"#/components/schemas/URL"}},"required":["light","dark"]},"URL":{"type":"string","format":"uri","maxLength":2048},"Emoji":{"type":"string","maxLength":50,"format":"emoji","description":"Unicode codepoint or character of the emoji"},"SiteHostname":{"type":"string","description":"Custom hostname for the site, for e.g. docs.mycompany.com","pattern":"^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$","maxLength":512},"SiteBasename":{"type":"string","description":"Basename for the site. For e.g. api","minLength":1,"maxLength":100},"SiteProxy":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/SiteProxyOrigin"},"target":{"type":"string","description":"The target URL to which the requests at the origin URL should be proxied to."}},"required":["origin","target"]},"SiteProxyOrigin":{"type":"string","description":"Proxy URL for the site, for e.g. company.com/docs or www.company.com/developer/docs etc.","pattern":"^([\\w-]+\\.)*[\\w-]+\\.[a-zA-Z]{2,}(\\/[\\w-]+)+$","maxLength":512},"SiteVisibility":{"type":"string","description":"The visibility setting of the site determines the audience of the site.\n* `public`: Anyone can access the site, and the site is indexed by search engines.\n* `unlisted`: Anyone can access the site, and the site is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the site.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the site.\n","enum":["public","unlisted","share-link","visitor-auth"]},"SiteAdaptiveContent":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether adaptive content should be enabled on the site."}},"required":["enabled"]},"SiteAds":{"oneOf":[{"type":"object","required":["status","submittable"],"properties":{"status":{"type":"string","enum":["pending"]},"submittable":{"type":"boolean","description":"True if the user can submit the site for review."}}},{"type":"object","required":["status","topic"],"properties":{"status":{"type":"string","enum":["in-review"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"}}},{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["rejected"]},"reason":{"type":"string","description":"Reason for the rejection"}}},{"type":"object","required":["status","topic","zoneId"],"properties":{"status":{"type":"string","enum":["live","disabled"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"},"zoneId":{"type":"string","description":"The ad network zone ID"}}}]},"SiteAdsTopic":{"type":"string","description":"Topic of the content","enum":["webdev","crypto"]},"SiteAgentsContext":{"type":"string","description":"Defines if the site will be included in the agent's context.\n- `excluded` means that the agent will not be able to access the site.\n- `included` means that the agent will be able to access the site.\n","enum":["excluded","included"]},"SiteFeature":{"type":"object","description":"A site feature and the plan it is available on.","properties":{"id":{"$ref":"#/components/schemas/SiteFeatureKey"},"plan":{"$ref":"#/components/schemas/SiteType"},"frozen":{"description":"A frozen feature is still enabled but cannot be changed or modified.","type":"boolean"},"customizations":{"description":"A list of the actual advanced customizations used (only applicable for sites-advanced-customization)","type":"array","items":{"$ref":"#/components/schemas/SiteCustomizationFeature"}}},"required":["id","plan","frozen"]},"SiteFeatureKey":{"type":"string","description":"The site feature identifier","enum":["sites-adaptive-content","sites-advanced-customization","sites-advanced-insights","sites-ads","sites-ai-search","sites-ai-assistant","sites-embed","sites-api-playground","sites-basic-customization","sites-custom-domain","sites-custom-fonts","sites-custom-subdirectory","sites-full-text-search","sites-multivariant-site","sites-no-custom-domain","sites-page-feedback","sites-page-traffic-insights","sites-pdf-export","sites-preview-deployments","sites-public-visibility","sites-redirects","sites-search-insights","sites-sections","sites-seo","sites-share-links","sites-unlisted-visibility","sites-user-contribution","sites-visitor-authentication","sites-visitors"]},"SiteCustomizationFeature":{"type":"string","description":"A list of all premium customizations.","enum":["header-logo","header-primary-link","theme-preset","premium-fonts","custom-icons","footer-logo","footer-links","footer-copyright","semantic-colors"]}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/publish":{"post":{"operationId":"publishSite","summary":"Publish a site","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"responses":{"200":{"description":"Site published successfully","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Site"},{"type":"object","description":"User needs to checkout in order to publish the site.","properties":{"type":{"type":"string","enum":["checkout"]},"sessionId":{"type":"string","description":"Stripe payment session ID"}},"required":["type","sessionId"]}]}}}}}}}}}
```

## POST /orgs/{organizationId}/sites/{siteId}/unpublish

> Unpublish a site

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"Site":{"type":"object","properties":{"object":{"type":"string","enum":["site"]},"id":{"type":"string","description":"Unique identifier of the site"},"type":{"$ref":"#/components/schemas/SiteType"},"appliedType":{"$ref":"#/components/schemas/SiteType","description":"The currently applied type of the site. For example, frozen sites will have this set to Basic."},"title":{"$ref":"#/components/schemas/SiteTitle"},"icon":{"oneOf":[{"$ref":"#/components/schemas/CustomizationFavicon"},{"type":"string","nullable":true,"enum":[null]}]},"hostname":{"$ref":"#/components/schemas/SiteHostname"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"proxy":{"$ref":"#/components/schemas/SiteProxy"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"published":{"type":"boolean","description":"Whether the site is live or not. If true, the site is accessible to the audience defined by the visibility setting."},"siteSpaces":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"ads":{"$ref":"#/components/schemas/SiteAds"},"agentsContext":{"$ref":"#/components/schemas/SiteAgentsContext"},"features":{"description":"A list of all premium features enabled on this site. For each feature we list the plan they belong to and whether the feature is frozen. A frozen feature is still enabled but cannot be changed or modified.\n","type":"array","items":{"$ref":"#/components/schemas/SiteFeature"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the site in the API","format":"uri"},"app":{"type":"string","description":"URL of the site in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the site. Only defined when site is published.","format":"uri"}},"required":["app","location"]}},"required":["object","id","type","appliedType","title","visibility","published","createdAt","siteSpaces","features","agentsContext","urls"]},"SiteType":{"type":"string","description":"The type of the site","enum":["basic","premium","ultimate","sponsored","legacy-basic","legacy-premium"]},"SiteTitle":{"type":"string","description":"Title of the site","minLength":2,"maxLength":128},"CustomizationFavicon":{"oneOf":[{"type":"object","properties":{"icon":{"$ref":"#/components/schemas/CustomizationThemedURL"}},"required":["icon"]},{"type":"object","properties":{"emoji":{"$ref":"#/components/schemas/Emoji"}},"required":["emoji"]},{"type":"object","properties":{},"additionalProperties":false}]},"CustomizationThemedURL":{"type":"object","properties":{"light":{"$ref":"#/components/schemas/URL"},"dark":{"$ref":"#/components/schemas/URL"}},"required":["light","dark"]},"URL":{"type":"string","format":"uri","maxLength":2048},"Emoji":{"type":"string","maxLength":50,"format":"emoji","description":"Unicode codepoint or character of the emoji"},"SiteHostname":{"type":"string","description":"Custom hostname for the site, for e.g. docs.mycompany.com","pattern":"^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$","maxLength":512},"SiteBasename":{"type":"string","description":"Basename for the site. For e.g. api","minLength":1,"maxLength":100},"SiteProxy":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/SiteProxyOrigin"},"target":{"type":"string","description":"The target URL to which the requests at the origin URL should be proxied to."}},"required":["origin","target"]},"SiteProxyOrigin":{"type":"string","description":"Proxy URL for the site, for e.g. company.com/docs or www.company.com/developer/docs etc.","pattern":"^([\\w-]+\\.)*[\\w-]+\\.[a-zA-Z]{2,}(\\/[\\w-]+)+$","maxLength":512},"SiteVisibility":{"type":"string","description":"The visibility setting of the site determines the audience of the site.\n* `public`: Anyone can access the site, and the site is indexed by search engines.\n* `unlisted`: Anyone can access the site, and the site is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the site.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the site.\n","enum":["public","unlisted","share-link","visitor-auth"]},"SiteAdaptiveContent":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether adaptive content should be enabled on the site."}},"required":["enabled"]},"SiteAds":{"oneOf":[{"type":"object","required":["status","submittable"],"properties":{"status":{"type":"string","enum":["pending"]},"submittable":{"type":"boolean","description":"True if the user can submit the site for review."}}},{"type":"object","required":["status","topic"],"properties":{"status":{"type":"string","enum":["in-review"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"}}},{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["rejected"]},"reason":{"type":"string","description":"Reason for the rejection"}}},{"type":"object","required":["status","topic","zoneId"],"properties":{"status":{"type":"string","enum":["live","disabled"]},"topic":{"$ref":"#/components/schemas/SiteAdsTopic"},"zoneId":{"type":"string","description":"The ad network zone ID"}}}]},"SiteAdsTopic":{"type":"string","description":"Topic of the content","enum":["webdev","crypto"]},"SiteAgentsContext":{"type":"string","description":"Defines if the site will be included in the agent's context.\n- `excluded` means that the agent will not be able to access the site.\n- `included` means that the agent will be able to access the site.\n","enum":["excluded","included"]},"SiteFeature":{"type":"object","description":"A site feature and the plan it is available on.","properties":{"id":{"$ref":"#/components/schemas/SiteFeatureKey"},"plan":{"$ref":"#/components/schemas/SiteType"},"frozen":{"description":"A frozen feature is still enabled but cannot be changed or modified.","type":"boolean"},"customizations":{"description":"A list of the actual advanced customizations used (only applicable for sites-advanced-customization)","type":"array","items":{"$ref":"#/components/schemas/SiteCustomizationFeature"}}},"required":["id","plan","frozen"]},"SiteFeatureKey":{"type":"string","description":"The site feature identifier","enum":["sites-adaptive-content","sites-advanced-customization","sites-advanced-insights","sites-ads","sites-ai-search","sites-ai-assistant","sites-embed","sites-api-playground","sites-basic-customization","sites-custom-domain","sites-custom-fonts","sites-custom-subdirectory","sites-full-text-search","sites-multivariant-site","sites-no-custom-domain","sites-page-feedback","sites-page-traffic-insights","sites-pdf-export","sites-preview-deployments","sites-public-visibility","sites-redirects","sites-search-insights","sites-sections","sites-seo","sites-share-links","sites-unlisted-visibility","sites-user-contribution","sites-visitor-authentication","sites-visitors"]},"SiteCustomizationFeature":{"type":"string","description":"A list of all premium customizations.","enum":["header-logo","header-primary-link","theme-preset","premium-fonts","custom-icons","footer-logo","footer-links","footer-copyright","semantic-colors"]}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/unpublish":{"post":{"operationId":"unpublishSite","summary":"Unpublish a site","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"responses":{"200":{"description":"Site unpublished successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}}}}}}}
```

## PATCH /orgs/{organizationId}/sites/{siteId}/structure/sort

> Move a site space, site section or site section group to a new position in the site structure.

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"SiteStructureItemPointer":{"type":"object","properties":{"type":{"type":"string","enum":["site-space","site-section","site-section-group"]},"id":{"type":"string","description":"Unique identifier for the site structure item (site space, site section or site section group)."}},"required":["type","id"]},"SiteStructureItemMovePosition":{"type":"object","description":"Position at which to move the site structure item (site space, site section or site section group).","properties":{"before":{"$ref":"#/components/schemas/SiteStructureItemPointer"},"after":{"$ref":"#/components/schemas/SiteStructureItemPointer"}}},"SiteStructureItem":{"title":"Site Structure Item","type":"object","description":"A site structure item can be a site space, a site section or a site section group.\nIt is used to represent the structure of a site.\n","oneOf":[{"$ref":"#/components/schemas/SiteSpace"},{"$ref":"#/components/schemas/SiteSection"},{"$ref":"#/components/schemas/SiteSectionGroup"}]},"SiteSpace":{"type":"object","properties":{"object":{"type":"string","description":"The object type, which is always \"site-space\"","enum":["site-space"]},"id":{"type":"string","description":"Unique identifier of the site-space"},"path":{"$ref":"#/components/schemas/SiteSpacePath"},"section":{"type":"string","description":"ID of the section the space belongs to in the site"},"space":{"$ref":"#/components/schemas/Space"},"title":{"type":"string"},"default":{"type":"boolean","description":"Whether this is the default space for the site"},"condition":{"description":"Conditional expression used to evaluate whether the site space should be shown to the site's visitor.","$ref":"#/components/schemas/Expression"},"hasAdvancedCustomizationFeature":{"type":"boolean","description":"Whether the space has advanced customization feature enabled"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"published":{"type":"string","description":"URL of the published version of the site-space. Only defined when site is published.","format":"uri"}}},"hidden":{"type":"boolean","description":"Whether the site space is hidden. If true, the site space will not be shown in the site's navigation."}},"required":["object","id","space","title","path","urls"]},"SiteSpacePath":{"type":"string","description":"Path to the space on the site","minLength":1,"maxLength":100},"Space":{"type":"object","properties":{"object":{"type":"string","description":"Type of Object, always equals to \"space\"","enum":["space"]},"id":{"type":"string","description":"Unique identifier for the space"},"title":{"$ref":"#/components/schemas/SpaceTitle"},"emoji":{"description":"An emoji for this space. It'll match the emoji shown in the GitBook app.","$ref":"#/components/schemas/Emoji"},"visibility":{"$ref":"#/components/schemas/ContentVisibility"},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"deletedAt":{"$ref":"#/components/schemas/Timestamp"},"editMode":{"$ref":"#/components/schemas/SpaceEditMode"},"mergeRules":{"$ref":"#/components/schemas/MergeRulesSpaceConfiguration"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the space in the API","format":"uri"},"app":{"type":"string","description":"URL of the space in the application","format":"uri"},"published":{"type":"string","description":"URL of the published version of the space. Only defined when visibility is not \"private.\"","format":"uri"},"public":{"type":"string","description":"URL of the public version of the space. Only defined when visibility is \"public\".","format":"uri"},"icon":{"description":"URL of the icon of this space, if defined.","$ref":"#/components/schemas/URL"}},"required":["app","location"]},"organization":{"type":"string","description":"ID of the organization owning this space"},"parent":{"type":"string","description":"ID of the parent collection."},"language":{"$ref":"#/components/schemas/TranslationLanguage"},"gitSync":{"$ref":"#/components/schemas/GitSyncState"},"visitorAuth":{"$ref":"#/components/schemas/VisitorAuth"},"revision":{"type":"string","description":"ID of the active revision in the space."},"defaultLevel":{"$ref":"#/components/schemas/DefaultLevel"},"comments":{"type":"number","description":"Count of opened comments on the space."},"changeRequests":{"type":"number","description":"Total count of change requests on the space."},"changeRequestsOpen":{"type":"number","description":"Count of open change requests on the space."},"changeRequestsDraft":{"type":"number","description":"Count of draft change requests on the space."},"internal_poweredByV2":{"type":"boolean","description":"Whether the space is powered by V2 of the content system."},"permissions":{"type":"object","description":"The set of permissions for the space","properties":{"view":{"type":"boolean","description":"Can the user view the space content."},"access":{"type":"boolean","description":"Can the user access the space in the application."},"admin":{"type":"boolean","description":"Can the user edit the title, install integrations, and manage the space."},"viewInviteLinks":{"type":"boolean","description":"Can the user view the invite links of the space."},"edit":{"type":"boolean","description":"Can the user edit the content of the space by creating a change request."},"triggerGitSync":{"type":"boolean","description":"Can the user trigger a git sync."},"comment":{"type":"boolean","description":"Can the user comment on the content."},"merge":{"type":"boolean","description":"Can the user merge change requests."},"review":{"type":"boolean","description":"Can the user review change requests."},"installIntegration":{"type":"boolean","description":"Can the user install integrations in the space."}},"required":["view","access","admin","viewInviteLinks","edit","triggerGitSync","comment","merge","review","installIntegration"]}},"required":["object","id","title","emoji","organization","visibility","revision","createdAt","updatedAt","comments","changeRequests","changeRequestsOpen","changeRequestsDraft","mergeRules","urls","defaultLevel","permissions"]},"SpaceTitle":{"type":"string","description":"Title of the space","maxLength":50},"Emoji":{"type":"string","maxLength":50,"format":"emoji","description":"Unicode codepoint or character of the emoji"},"ContentVisibility":{"type":"string","description":"* `public`: Anyone can access the content, and the content is indexed by search engines.\n* `unlisted`: Anyone can access the content, and the content is not indexed by search engines\n* `share-link`: Anyone with a secret token in the url can access the content.\n* `visitor-auth`: Anyone authenticated through a JWT token can access the content.\n* `in-collection`: Anyone who can access the parent collection can access the content.\n  Only available for spaces in a collection.\n* `private`: Authorized members can access the content.\n","enum":["public","unlisted","share-link","visitor-auth","in-collection","private"]},"Timestamp":{"type":"string","format":"date-time"},"SpaceEditMode":{"type":"string","description":"Determines how a Space can be edited.\n* `live`: Users can directly edit the space\n* `locked`: All edits are locked for this space.\n","enum":["live","locked"]},"MergeRulesSpaceConfiguration":{"oneOf":[{"$ref":"#/components/schemas/MergeRulesConfigurationInherit"},{"$ref":"#/components/schemas/MergeRulesStandaloneConfiguration"}]},"MergeRulesConfigurationInherit":{"type":"object","description":"The merge rules inherits from the organization configuration.","properties":{"type":{"type":"string","enum":["inherit"]}},"required":["type"]},"MergeRulesStandaloneConfiguration":{"oneOf":[{"$ref":"#/components/schemas/MergeRulesConfigurationRules"},{"$ref":"#/components/schemas/MergeRulesConfigurationNone"}]},"MergeRulesConfigurationRules":{"type":"object","description":"The merge rules are composed of individual rules that must all pass.","properties":{"type":{"type":"string","enum":["rules"]},"rules":{"type":"array","items":{"$ref":"#/components/schemas/MergeRule"}}},"required":["type","rules"]},"MergeRule":{"oneOf":[{"type":"object","properties":{"rule":{"type":"string","enum":["require_specific_reviewers"]},"users":{"type":"array","description":"List of user IDs.","items":{"type":"string"}}},"required":["rule","users"]},{"type":"object","properties":{"rule":{"type":"string","enum":["require_one_of_specific_reviewers"]},"users":{"type":"array","description":"List of user IDs.","items":{"type":"string"}}},"required":["rule","users"]},{"type":"object","properties":{"rule":{"type":"string","enum":["allow_bypass"]},"users":{"type":"array","description":"List of user IDs.","items":{"type":"string"}}},"required":["rule","users"]},{"type":"object","properties":{"rule":{"type":"string","enum":["require_at_least_one_review","require_at_least_one_approved_review","require_all_reviews_approved","require_agent_review","require_up_to_date_change_request","require_change_request_subject","require_change_request_description","require_author_to_merge"]}},"required":["rule"]},{"type":"object","description":"The merge rule is written in the advanced custom expression syntax.","properties":{"rule":{"type":"string","enum":["custom"]},"expression":{"$ref":"#/components/schemas/Expression"}},"required":["rule","expression"]}]},"Expression":{"type":"string","description":"Expression to evaluate","minLength":0,"maxLength":1024},"MergeRulesConfigurationNone":{"type":"object","description":"The merge rules are disabled, change requests can be merged without review.","properties":{"type":{"type":"string","enum":["none"]}},"required":["type"]},"URL":{"type":"string","format":"uri","maxLength":2048},"TranslationLanguage":{"type":"string","enum":["en","fr","de","es","it","pt","pt-br","ru","ja","zh","yue","ko","ar","hi","nl","pl","tr","sv","no","da","fi","el","cs","hu","ro","th","vi","id","ms","he","uk","sk","bg","hr","lt","lv","et","sl"]},"GitSyncState":{"type":"object","properties":{"repoName":{"type":"string","description":"Repository name."},"installationProvider":{"$ref":"#/components/schemas/GitSyncProvider"},"integration":{"type":"string","description":"The integration name providing the Git Sync."},"url":{"type":"string","description":"The URL to the repository tree, used when rendering public content."},"updatedAt":{"description":"When the Git provider details were last updated","$ref":"#/components/schemas/Timestamp"}}},"GitSyncProvider":{"type":"string","description":"The provider of the Git Sync installation.","enum":["github","gitlab","github-legacy"]},"VisitorAuth":{"oneOf":[{"$ref":"#/components/schemas/VisitorAuthCustomBackend"},{"allOf":[{"$ref":"#/components/schemas/VisitorAuthIntegrationBackend"},{"type":"object","properties":{"integration":{"type":"string","description":"Name of integration being used as the backend for authenticated access"}},"required":["integration"]}]}]},"VisitorAuthCustomBackend":{"type":"object","title":"Custom backend for authenticated access","properties":{"backend":{"type":"string","description":"Custom backend for authenticated access","enum":["custom"]}},"required":["backend"]},"VisitorAuthIntegrationBackend":{"type":"object","title":"Integration backend for authenticated access","properties":{"backend":{"type":"string","description":"Integration as backend for authenticated access","enum":["integration"]}},"required":["backend"]},"DefaultLevel":{"description":"Default level for a piece of content","oneOf":[{"$ref":"#/components/schemas/MemberRoleOrGuest"},{"type":"string","enum":["inherit"]}]},"MemberRoleOrGuest":{"description":"The role of a member in an organization, null for guests","oneOf":[{"$ref":"#/components/schemas/MemberRole"},{"type":"string","nullable":true,"enum":[null]}]},"MemberRole":{"type":"string","description":"\"The role of a member in an organization.\n\"admin\": Can administrate the content: create, delete spaces, ...\n\"create\": Can create content.\n\"review\": Can review content.\n\"edit\": Can edit the content (live or change requests).\n\"comment\": Can access the content and its discussions.\n\"read\": Can access the content, but cannot update it in any way.\n","enum":["admin","create","edit","review","comment","read"]},"SiteSection":{"type":"object","properties":{"object":{"type":"string","description":"The object type, which is always \"site-section\"","enum":["site-section"]},"id":{"type":"string","description":"Unique identifier of the site section"},"title":{"$ref":"#/components/schemas/SiteSectionTitle"},"description":{"$ref":"#/components/schemas/SiteSectionDescription"},"default":{"type":"boolean","description":"Whether this is the default section for the site"},"path":{"$ref":"#/components/schemas/SiteSectionPath"},"condition":{"description":"Conditional expression used to evaluate whether the site section should be shown to the site's visitor.","$ref":"#/components/schemas/Expression"},"sectionGroup":{"type":"string","description":"ID of the section group the section belongs to in the site"},"siteSpaces":{"type":"array","items":{"$ref":"#/components/schemas/SiteSpace"}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"published":{"type":"string","description":"URL of the published version of the site section. Only defined when site is published.","format":"uri"}}},"icon":{"$ref":"#/components/schemas/Icon"}},"required":["object","id","title","path","siteSpaces","urls"]},"SiteSectionTitle":{"type":"string","description":"Title of the site section","minLength":2,"maxLength":128},"SiteSectionDescription":{"type":"string","description":"Description of the site section","minLength":0,"maxLength":256},"SiteSectionPath":{"type":"string","description":"Path to the section on the site","minLength":1,"maxLength":100},"Icon":{"type":"string","maxLength":50,"format":"icon","description":"Name of the icon"},"SiteSectionGroup":{"type":"object","properties":{"object":{"type":"string","description":"The object type, which is always \"site-section-group\"","enum":["site-section-group"]},"id":{"type":"string","description":"Unique identifier of the site section group"},"title":{"$ref":"#/components/schemas/SiteSectionGroupTitle"},"sections":{"type":"array","deprecated":true,"description":"List of site section ids that are members of the group. Use `children` instead.","items":{"$ref":"#/components/schemas/SiteSection"}},"sectionGroup":{"type":"string","description":"ID of the parent section group this group belongs to"},"children":{"type":"array","description":"List of all child sections and groups nested under this group","items":{"oneOf":[{"$ref":"#/components/schemas/SiteSection"},{"$ref":"#/components/schemas/SiteSectionGroup"}]}},"icon":{"$ref":"#/components/schemas/Icon"}},"required":["object","id","title","sections","children"]},"SiteSectionGroupTitle":{"type":"string","description":"Title of the site section group","minLength":1,"maxLength":100},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}},"required":["code","message"]}}}},"responses":{"BadRequestError":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[400]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"NotFoundError":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[404]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"UnexpectedError":{"description":"Unexpected Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/structure/sort":{"patch":{"operationId":"sortSiteStructure","summary":"Move a site space, site section or site section group to a new position in the site structure.","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"item":{"description":"pointer to the item (site space, site section or site section group) being moved.","$ref":"#/components/schemas/SiteStructureItemPointer"},"position":{"description":"The position to move the item to. When not provided the item is moved to the end of the site structure.","$ref":"#/components/schemas/SiteStructureItemMovePosition"}},"required":["item","position"]}}}},"responses":{"200":{"description":"Item successfully moved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteStructureItem"}}}},"400":{"description":"Invalid move position provided","$ref":"#/components/responses/BadRequestError"},"404":{"description":"No matching item found","$ref":"#/components/responses/NotFoundError"},"default":{"$ref":"#/components/responses/UnexpectedError"}}}}}}
```

## POST /orgs/{organizationId}/sites/{siteId}/search

> Search in a site

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"sites","description":"The Docs Sites API lets you programmatically manage published documentation sites within your organization. You can list and update all sites created under a specific organization, making it easy to audit or interact with site metadata at scale.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Site\" grouped=\"false\" %}\n    The Site object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"listPage":{"name":"page","in":"query","description":"Identifier of the page results to fetch.","schema":{"type":"string"}},"listLimit":{"name":"limit","in":"query","description":"The number of results per page","schema":{"type":"number","minimum":0,"maximum":1000}}},"schemas":{"SiteSearchScope":{"oneOf":[{"type":"object","required":["mode"],"properties":{"mode":{"description":"Search across all sections of a site, only including the default content of each section. This scope is wide and shallow. You may optionally specify a list of additional site spaces to search in alongside the default content.\n","type":"string","enum":["default"]},"currentSiteSpace":{"type":"string","description":"The ID of the site space that must always be included in the search results. The language of this site space will be used to match other site spaces with the same language, if applicable.\n"}}},{"type":"object","required":["mode","siteSpaceIds"],"properties":{"mode":{"description":"Only search in the provided site spaces.","type":"string","enum":["specific"]},"siteSpaceIds":{"type":"array","minLength":1,"items":{"type":"string"}}}},{"type":"object","required":["mode"],"properties":{"mode":{"description":"Search in all sections and site spaces. This scope is wide and deep.","type":"string","enum":["all"]}}}]},"List":{"type":"object","properties":{"next":{"type":"object","properties":{"page":{"type":"string","description":"Unique identifier to query the next results page"}},"required":["page"]},"count":{"type":"number","description":"Total count of objects in the list"}}},"SearchSpaceResult":{"type":"object","description":"Search result representing a space.","properties":{"id":{"type":"string"},"title":{"type":"string"},"pages":{"type":"array","items":{"$ref":"#/components/schemas/SearchPageResult"}}},"required":["id","title","pages"]},"SearchPageResult":{"type":"object","description":"Search result representing a page in a space.","properties":{"id":{"type":"string"},"title":{"type":"string"},"path":{"type":"string"},"sections":{"type":"array","items":{"$ref":"#/components/schemas/SearchSectionResult"}},"ancestors":{"type":"array","description":"Data about the ancestors of the current page, from top-level to direct parent.","items":{"type":"object","properties":{"title":{"type":"string"}},"required":["title"]}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"app":{"type":"string","description":"URL of the page in the application","format":"uri"}},"required":["app"]}},"required":["id","title","path","ancestors","urls"]},"SearchSectionResult":{"type":"object","description":"Search result representing a section in a page.","properties":{"id":{"type":"string"},"title":{"type":"string"},"path":{"type":"string"},"body":{"type":"string"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"app":{"type":"string","description":"URL of the section in the application","format":"uri"}},"required":["app"]}},"required":["id","title","path","body","urls"]}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/search":{"post":{"operationId":"searchSiteContent","summary":"Search in a site","tags":["sites"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/listPage"},{"$ref":"#/components/parameters/listLimit"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","required":["query"],"properties":{"query":{"type":"string","maxLength":512}}},{"oneOf":[{"type":"object","required":["scope"],"properties":{"scope":{"description":"Define the scope of the search.","$ref":"#/components/schemas/SiteSearchScope"}}},{"type":"object","properties":{"mode":{"description":"Search only in the site spaces provided. Deprecated, use scope instead.","deprecated":true,"type":"string","enum":["specific"]},"siteSpaceIds":{"type":"array","minLength":1,"items":{"type":"string"}}},"required":["siteSpaceIds"]},{"type":"object","properties":{"mode":{"description":"Search in the current site space and all section's defaults. Deprecated, use scope instead.","deprecated":true,"type":"string","enum":["current"]},"siteSpaceId":{"type":"string"}},"required":["mode","siteSpaceId"]},{"type":"object","properties":{"mode":{"description":"Search in all site-spaces. Deprecated, use scope instead.","deprecated":true,"type":"string","enum":["all"]}},"required":["mode"]}]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"},{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SearchSpaceResult"}}}}]}}}}}}}}}
```