Skip to main content

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:

Operation: mutation UpdateProject($input: UpdateProjectInput!) { updateProject(input: $input) { project { ...ProjectDetails } } } fragment ProjectDetails on Project { id name # ...other fields you want to retrieve }Variables: { "input": { "projectId": "TjAwN1Byb2plY3Q5ODM5", "name": "Updated www.lumar.io Project" } }Response Example: { "data": { "updateProject": { "id": "TjAwN1Byb2plY3Q5ODM5", "name": "Updated www.lumar.io Project" } } }
UpdateProjectTry in Explorer
GraphQL
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.

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.

Operation: query GetProjectSitemaps($projectId: ObjectID!) { getProject(id: $projectId) { sitemaps { url urlDigest enabled type status } } }Variables: { "projectId": "12345" }
GetProjectSitemapsTry in Explorer
GraphQL
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. Mutations fail while a crawl is running.

Operation: mutation AddProjectSitemaps($input: AddCustomSitemapsInput!) { addCustomSitemaps(input: $input) { sitemaps { url urlDigest enabled } } }Variables: { "input": { "projectId": "12345", "sitemapUrls": ["https://www.example.com/sitemap.xml"] } }
AddProjectSitemapsTry in Explorer
GraphQL
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.