# pageUpdate - admin - MUTATION Version: unstable ## Description Updates a page. ### Access Scopes Any of `write_content`, `write_online_store_pages` access scopes. ## Arguments * [id](/docs/api/admin/unstable/scalars/ID): ID! - The ID of the page to be updated. * [page](/docs/api/admin/unstable/input-objects/PageUpdateInput): PageUpdateInput! - The properties of the page to be updated. ## Returns * [page](/docs/api/admin/unstable/objects/Page): Page The page that was updated. * [userErrors](/docs/api/admin/unstable/objects/PageUpdateUserError): PageUpdateUserError! The list of errors that occurred from executing the mutation. ## Examples ### Updates a page Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { code field message } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Page/602767277\",\n \"page\": {\n \"title\": \"This is the Title\",\n \"handle\": \"this-is-the-handle\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation UpdatePage($id: ID!, $page: PageUpdateInput!) {\n pageUpdate(id: $id, page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Page/602767277\",\n \"page\": {\n \"title\": \"This is the Title\",\n \"handle\": \"this-is-the-handle\"\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation UpdatePage($id: ID!, $page: PageUpdateInput!) {\n pageUpdate(id: $id, page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Page/602767277\",\n \"page\": {\n \"title\": \"This is the Title\",\n \"handle\": \"this-is-the-handle\"\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation UpdatePage($id: ID!, $page: PageUpdateInput!) {\n pageUpdate(id: $id, page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Page/602767277\",\n \"page\": {\n \"title\": \"This is the Title\",\n \"handle\": \"this-is-the-handle\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation UpdatePage($id: ID!, $page: PageUpdateInput!) {\n pageUpdate(id: $id, page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n code\n field\n message\n }\n }\n}" #### Graphql Input { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } #### Graphql Response { "data": { "pageUpdate": { "page": { "id": "gid://shopify/Page/602767277", "title": "This is the Title", "handle": "this-is-the-handle" }, "userErrors": [] } } } ### Updating a page to have a new title Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation UpdatePage($id: ID!, $page: PageUpdateInput!) { pageUpdate(id: $id, page: $page) { page { id title handle } userErrors { field message } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Page/602767277\",\n \"page\": {\n \"title\": \"This is the Title\",\n \"handle\": \"this-is-the-handle\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation UpdatePage($id: ID!, $page: PageUpdateInput!) {\n pageUpdate(id: $id, page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Page/602767277\",\n \"page\": {\n \"title\": \"This is the Title\",\n \"handle\": \"this-is-the-handle\"\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation UpdatePage($id: ID!, $page: PageUpdateInput!) {\n pageUpdate(id: $id, page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Page/602767277\",\n \"page\": {\n \"title\": \"This is the Title\",\n \"handle\": \"this-is-the-handle\"\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation UpdatePage($id: ID!, $page: PageUpdateInput!) {\n pageUpdate(id: $id, page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Page/602767277\",\n \"page\": {\n \"title\": \"This is the Title\",\n \"handle\": \"this-is-the-handle\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation UpdatePage($id: ID!, $page: PageUpdateInput!) {\n pageUpdate(id: $id, page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n field\n message\n }\n }\n}" #### Graphql Input { "id": "gid://shopify/Page/602767277", "page": { "title": "This is the Title", "handle": "this-is-the-handle" } } #### Graphql Response { "data": { "pageUpdate": { "page": { "id": "gid://shopify/Page/602767277", "title": "This is the Title", "handle": "this-is-the-handle" }, "userErrors": [] } } }