---
title: "Update a Docs7 site"
method: PATCH
path: "/v2/teamspaces/{teamspaceId}/sites/{siteId}"
tags: ["Docs7 Sites"]
---

# Update a Docs7 site

`PATCH /v2/teamspaces/{teamspaceId}/sites/{siteId}`

## Request

- Base URL: `https://context7.com/api`
- URL: `https://context7.com/api/v2/teamspaces/{teamspaceId}/sites/{siteId}`
- Auth: HTTP bearer

Change settings of a GitHub site. Send only the fields to change. Owners and admins can send every field; a developer can only send `{ "hosting": "on" }` to publish a site added for the agents only. A new slug or custom domain path starts a rebuild. A new Code Watch repository is checked against the caller's GitHub access. Only for GitHub sites: a CLI site (`source: "local"`) answers 404.

## Path parameters

- `teamspaceId` string, uuid, required
- `siteId` string, uuid, required

## Request body

- Docs7UpdateSiteRequest: Only the fields to change.
  - `hosting` 'on': Publish a site added for the agents only. One way; delete the site to stop publishing. The only field a developer can send.
  - `slug` string
  - `analyticsUrl` string, uri, nullable
  - `customDomain` string, nullable
  - `customDomainPath` string, nullable
  - `customDomainRouting` 'dns' | 'proxy', nullable
  - `branch` string, nullable
  - `docsPath` string
  - `context7Index` boolean
  - `improveSchedule` 'off' | 'daily' | 'weekly'
  - `pullRequestReview` Docs7PullRequestReview: PR Review Agent settings.
    - `enabled` boolean, required
    - `response` 'comment' | 'pull_request' | 'commit', required: What the agent does with its fixes. The findings comment is always posted, and every check always runs.
  - `codeWatch` object
    - `enabled` boolean, required
    - `repositories` string[], required: GitHub repository URLs. Each new one is checked against the site's GitHub App installation and the caller's GitHub access.
  - `buildFixSchedule` 'off' | 'after_build' | 'daily' | 'weekly': When the Build Fix Agent fixes the issues of the latest production build (hosted sites).
  - `snippetSchedule` 'off' | 'monthly': Whether the Example Check Agent runs every code example of the docs once a month (Docs7 Pro).

## Response `200`

The updated site

- object
  - `data` Docs7Site, required: A Docs7 site built from a GitHub repository.
    - `id` string, uuid, required
    - `projectId` string, uuid, required: Teamspace id.
    - `createdBy` string, nullable
    - `repoUrl` string, uri, required
    - `repositoryId` string: GitHub repository id.
    - `installationId` integer: GitHub App installation id.
    - `branch` string, nullable: Pinned production branch. Null follows the default branch.
    - `defaultBranch` string, nullable
    - `docsPath` string, required: Docs folder in the repository; `.` is the root.
    - `hosting` 'off' | 'on', required: `off`: added for the agents only, nothing is published.
    - `analyticsUrl` string, uri, nullable: External docs URL for browser analytics of a site that Docs7 does not host.
    - `workerName` string
    - `platformHostname` string, required
    - `customDomain` string, nullable
    - `customDomainPath` string, nullable: Path prefix the docs are served under on the custom domain.
    - `customDomainRouting` 'dns' | 'proxy', nullable
    - `customHostnameId` string, nullable
    - `customDomainStatus` 'none' | 'pending_ownership' | 'pending_dns' | 'pending_validation' | 'pending_certificate' | 'pending_proxy' | 'active' | 'failed', required
    - `customDomainError` string, nullable
    - `customDomainRecords` Docs7DnsRecord[]
      - `purpose` 'domain_ownership' | 'tls_certificate', required
      - `type` 'CNAME' | 'TXT', required
      - `name` string, required
      - `value` string, required
    - `context7Index` boolean, required: Whether the repository is indexed in Context7.
    - `context7LibraryName` string
    - `improveSchedule` 'off' | 'daily' | 'weekly', required: How often the Context7 Agent runs on its own.
    - `pullRequestReview` Docs7PullRequestReview: PR Review Agent settings.
      - `enabled` boolean, required
      - `response` 'comment' | 'pull_request' | 'commit', required: What the agent does with its fixes. The findings comment is always posted, and every check always runs.
    - `codeWatch` object: Code Watch Agent settings: code repositories whose merged pull requests can change the docs.
      - `enabled` boolean, required
      - `repositories` object[], required
        - `repositoryId` string, required
        - `repoUrl` string, uri, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `buildFixSchedule` 'off' | 'after_build' | 'daily' | 'weekly': When the Build Fix Agent fixes the issues of the latest production build (hosted sites).
    - `snippetSchedule` 'off' | 'monthly': Whether the Example Check Agent runs every code example of the docs once a month (Docs7 Pro).
  - `deploymentId` string, uuid, nullable, required: The first build when this call published the site.
  - `context7Notice` string, nullable, required: Why Context7 could not index the repository, when `context7Index` was turned on but the library cannot refresh.

## Other responses

- `400`: Invalid body or settings (`invalid_payload`, `invalid_custom_domain`, `docs_path_missing`, `docs_config_missing`, `invalid_code_repository`, `github_access_required`)
- `401`: Missing or invalid bearer
- `403`: Role not allowed, or a private repository on Docs7 Free (`docs7_pro_required`)
- `404`: No such site in this teamspace
- `409`: Slug, domain or repository conflict (`slug_conflict`, `slug_busy`, `domain_conflict`, `site_conflict`), or `project_busy`
- `500`: Internal error
- `502`: GitHub or the hosting provider failed (`repository_check_failed`, `source_check_failed`, `site_update_failed`)

## Changes

- **2026-10-27** `2ead96d131a7`: 2 info
  - added the new optional request property `snippetSchedule`
  - added the optional property `data/snippetSchedule` to the response with the `200` status
- **2026-10-22** `e17589fd8767`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/context7/apis/context7-public-api/changes/v2/teamspaces/:teamspaceId/sites/:siteId/patch.md)

---

[API](https://skmtc.dev/context7/apis/context7-public-api.md) - [All operations](https://skmtc.dev/context7/apis/context7-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/context7/apis/context7-public-api/revisions/945f7834fa8c?raw)
