> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites.md).

# Docs sites

Manage your published 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.1.0","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."},"unpublishedBy":{"type":"string","enum":["user","system"],"description":"Who unpublished this site last. Cleared when the site is published again."},"title":{"$ref":"#/components/schemas/SiteTitle"},"icon":{"oneOf":[{"$ref":"#/components/schemas/CustomizationFavicon"},{"type":"null"}]},"hostname":{"$ref":"#/components/schemas/SiteHostname"},"basename":{"$ref":"#/components/schemas/SiteBasename"},"proxy":{"$ref":"#/components/schemas/SiteProxy"},"visibility":{"$ref":"#/components/schemas/SiteVisibility"},"defaultLevel":{"$ref":"#/components/schemas/DefaultLevel"},"permissions":{"type":"object","description":"The set of permissions for the site.","properties":{"view":{"type":"boolean","description":"Can the user view the site."},"access":{"type":"boolean","description":"Can the user access the site in the application."},"edit":{"type":"boolean","description":"Can the user edit content and create draft content in the site."},"create":{"type":"boolean","description":"Can the user create draft content, publish content, and manage the site's content structure."},"admin":{"type":"boolean","description":"Can the user manage the site content, settings and publish the site."},"installIntegration":{"type":"boolean","description":"Can the user install integrations on the site."},"viewAdaptiveSchema":{"type":"boolean","description":"Can the user view the adaptive schema of the site."},"editAdaptiveSchema":{"type":"boolean","description":"Can the user edit the adaptive schema of the site."}},"required":["view","access","edit","create","admin","installIntegration","viewAdaptiveSchema","editAdaptiveSchema"]},"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"},"gitSync":{"$ref":"#/components/schemas/GitSyncState"},"createdAt":{"type":"string","format":"date-time"},"lastScanAt":{"type":"string","format":"date-time","description":"When GitBook last completed a scan of the site's content\ngaps. Absent until the site has been scanned at least once.\n"},"adaptiveContent":{"$ref":"#/components/schemas/SiteAdaptiveContent"},"ads":{"$ref":"#/components/schemas/SiteAds"},"styleguide":{"$ref":"#/components/schemas/ContentRefSpace","description":"Reference to a GitBook space holding the team's writing style guide.\nWhen present on a site, the editing agent receives the style guide\ntable of contents in its system prompt and can fetch sections on\ndemand to check edits against the rules.\n"},"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"},"preview":{"type":"string","description":"URL of the preview version of the site.","format":"uri"},"login":{"type":"string","description":"URL of the login endpoint for visitors to authenticate with the site auth backend.\n","format":"uri"},"logout":{"type":"string","description":"URL of the logout endpoint for visitors to sign out from the site auth backend.\n","format":"uri"}},"required":["app","location","preview"]}},"required":["object","id","type","appliedType","title","visibility","defaultLevel","permissions","published","createdAt","siteSpaces","features","urls"]},"SiteType":{"type":"string","description":"The type of the site","enum":["basic","premium","ultimate","sponsored"]},"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"]},"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":"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"]},"GitSyncState":{"type":"object","properties":{"repoName":{"type":"string","description":"Repository name."},"installationStatus":{"$ref":"#/components/schemas/GitSyncInstallationStatus"},"installationProvider":{"$ref":"#/components/schemas/GitSyncProvider"},"integration":{"type":"string","deprecated":true,"description":"The integration name providing the Git Sync."},"installationId":{"type":"string","description":"The ID of the Git Sync installation."},"parentInstallationId":{"type":"string","description":"The ID of the parent Git Sync installation, if any."},"url":{"type":"string","description":"The URL to the repository tree, used when rendering public content."},"installationProjectDirectory":{"type":"string","description":"Directory in the repository this content syncs from, resolved against the parent installation when the installation is managed by a site. Absent when the content syncs from the root of the repository."},"operation":{"type":"object","description":"The latest operation on the Git Sync installation.","properties":{"state":{"$ref":"#/components/schemas/GitSyncOperationState"},"direction":{"$ref":"#/components/schemas/GitSyncOperationDirection"},"startedAt":{"$ref":"#/components/schemas/Timestamp"},"endedAt":{"$ref":"#/components/schemas/Timestamp"},"error":{"type":"string","description":"Why the operation failed, when it did."},"errorAction":{"$ref":"#/components/schemas/GitSyncOperationErrorAction"}},"required":["state","direction","startedAt"]},"operationTimeout":{"type":"integer","description":"How long an operation is allowed to run before it is terminated (in milliseconds)."},"updatedAt":{"description":"When the Git provider details were last updated","$ref":"#/components/schemas/Timestamp"}},"required":["installationId","installationProvider","installationStatus"]},"GitSyncInstallationStatus":{"type":"string","enum":["unauthenticated","active","pending"]},"GitSyncProvider":{"type":"string","description":"The provider of the Git Sync installation.","enum":["github","gitlab","github-legacy"]},"GitSyncOperationState":{"type":"string","description":"* `running`: The operation is still running\n* `failure`: The operation failed\n* `success`: The operation was successful\n* `timeout`: The operation timed out\n","enum":["running","failure","success","timeout"]},"GitSyncOperationDirection":{"type":"string","enum":["export","import"]},"Timestamp":{"type":"string","format":"date-time"},"GitSyncOperationErrorAction":{"type":"object","description":"An action the user can take to resolve a failed Git Sync operation.","properties":{"label":{"type":"string","description":"Label for the action."},"url":{"type":"string","format":"uri","description":"URL where the user can resolve the failure."}},"required":["label","url"]},"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"]},"ContentRefSpace":{"type":"object","properties":{"kind":{"type":"string","enum":["space"]},"space":{"type":"string"}},"required":["kind","space"]},"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-ai-insights","sites-fix-broken-links","sites-connections","sites-content-gaps","sites-channels","sites-embed","sites-api-playground","sites-basic-customization","sites-broken-links","sites-custom-domain","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-style-guide","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"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
