How to Update a Project
To update a Project, you must use a updateProject mutation. You have to provide projectId for the Project you want
to update and any fields you want to update. See How to Get Projects for information on how
to retrieve your projects and their ids. Here's an example updating Project's name:
mutation UpdateProject($input: UpdateProjectInput!) {
updateProject(input: $input) {
project {
...ProjectDetails
}
}
}
fragment ProjectDetails on Project {
id
name
# ...other fields you want to retrieve
}
Explore UpdateProjectInput to see what fields are available.
While the project's crawl is running, only some settings can change, and updateProject refuses the rest with
PROJECT_UPDATE_DISALLOWED_CRAWL_RUNNING, naming them in extensions.disallowedSettings. See
Changing Settings During a Crawl for which settings apply to the running crawl,
which apply from the next one, and how to handle a refusal.
Sitemap configuration
Read Project.sitemaps to list configured and discovered sitemap URLs, their
enabled state, and the urlDigest used by sitemap mutations. When robots.txt
discovery is enabled, the response includes those discovered URLs without
saving them to project settings.
query GetProjectSitemaps($projectId: ObjectID!) {
getProject(id: $projectId) {
sitemaps {
url
urlDigest
enabled
type
status
}
}
}
Sitemap mutations require the Editor role or higher on the project's account,
including when authenticated as a service account. Use addCustomSitemaps to
add URLs without replacing existing entries. Use enableSitemap,
disableSitemap, or deleteSitemap with a returned digest; enableSitemaps
and disableSitemaps toggle several digests, or all sitemaps when digests are
omitted. Sitemap mutations are refused while a crawl is running; see
Changing Settings During a Crawl.
mutation AddProjectSitemaps($input: AddCustomSitemapsInput!) {
addCustomSitemaps(input: $input) {
sitemaps {
url
urlDigest
enabled
}
}
}
Mutations can save URLs discovered in robots.txt. Deleting a URL also clears
its disabled state, so discovery can immediately restore it; use disable to
keep a robots.txt sitemap excluded. Managing URLs does not enable the crawl
source: include Sitemap in crawlTypes while preserving the project's
other enabled sources.