# pageCreate - admin - MUTATION Version: unstable ## Description Creates a page. ### Access Scopes Any of `write_content`, `write_online_store_pages` access scopes. ## Arguments * [page](/docs/api/admin/unstable/input-objects/PageCreateInput): PageCreateInput! - The properties of the new page. ## Returns * [page](/docs/api/admin/unstable/objects/Page): Page The page that was created. * [userErrors](/docs/api/admin/unstable/objects/PageCreateUserError): PageCreateUserError! The list of errors that occurred from executing the mutation. ## Examples ### Creates 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 CreatePage($page: PageCreateInput!) { pageCreate(page: $page) { page { id title handle } userErrors { code field message } } }\",\n \"variables\": {\n \"page\": {\n \"title\": \"New Page Title\",\n \"handle\": \"new-page-title\",\n \"body\": \"This is the content of the page.\",\n \"isPublished\": true,\n \"templateSuffix\": \"custom\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation CreatePage($page: PageCreateInput!) {\n pageCreate(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 \"page\": {\n \"title\": \"New Page Title\",\n \"handle\": \"new-page-title\",\n \"body\": \"This is the content of the page.\",\n \"isPublished\": true,\n \"templateSuffix\": \"custom\"\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 CreatePage($page: PageCreateInput!) {\n pageCreate(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 \"page\": {\n \"title\": \"New Page Title\",\n \"handle\": \"new-page-title\",\n \"body\": \"This is the content of the page.\",\n \"isPublished\": true,\n \"templateSuffix\": \"custom\"\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 CreatePage($page: PageCreateInput!) {\n pageCreate(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 \"page\": {\n \"title\": \"New Page Title\",\n \"handle\": \"new-page-title\",\n \"body\": \"This is the content of the page.\",\n \"isPublished\": true,\n \"templateSuffix\": \"custom\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation CreatePage($page: PageCreateInput!) {\n pageCreate(page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n code\n field\n message\n }\n }\n}" #### Graphql Input { "page": { "title": "New Page Title", "handle": "new-page-title", "body": "This is the content of the page.", "isPublished": true, "templateSuffix": "custom" } } #### Graphql Response { "data": { "pageCreate": { "page": { "id": "gid://shopify/Page/1025371368", "title": "New Page Title", "handle": "new-page-title" }, "userErrors": [] } } } ### Successfully creating 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 CreatePage($page: PageCreateInput!) { pageCreate(page: $page) { page { id title handle } userErrors { field message } } }\",\n \"variables\": {\n \"page\": {\n \"title\": \"New Page Title\",\n \"handle\": \"new-page-title\",\n \"body\": \"This is the content of the page.\",\n \"isPublished\": true,\n \"templateSuffix\": \"custom\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation CreatePage($page: PageCreateInput!) {\n pageCreate(page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"page\": {\n \"title\": \"New Page Title\",\n \"handle\": \"new-page-title\",\n \"body\": \"This is the content of the page.\",\n \"isPublished\": true,\n \"templateSuffix\": \"custom\"\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 CreatePage($page: PageCreateInput!) {\n pageCreate(page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"page\": {\n \"title\": \"New Page Title\",\n \"handle\": \"new-page-title\",\n \"body\": \"This is the content of the page.\",\n \"isPublished\": true,\n \"templateSuffix\": \"custom\"\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 CreatePage($page: PageCreateInput!) {\n pageCreate(page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"page\": {\n \"title\": \"New Page Title\",\n \"handle\": \"new-page-title\",\n \"body\": \"This is the content of the page.\",\n \"isPublished\": true,\n \"templateSuffix\": \"custom\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation CreatePage($page: PageCreateInput!) {\n pageCreate(page: $page) {\n page {\n id\n title\n handle\n }\n userErrors {\n field\n message\n }\n }\n}" #### Graphql Input { "page": { "title": "New Page Title", "handle": "new-page-title", "body": "This is the content of the page.", "isPublished": true, "templateSuffix": "custom" } } #### Graphql Response { "data": { "pageCreate": { "page": { "id": "gid://shopify/Page/1025371369", "title": "New Page Title", "handle": "new-page-title" }, "userErrors": [] } } }