Anchor to pageCreatepage
pageCreate
mutation
Requires Any of ,
access scopes.
Creates a page.
Anchor to Arguments
Arguments
- Anchor to pagepage•Page
Create requiredInput! The properties of the new page.
Was this section helpful?
Anchor to PageCreatePayload returnsPageCreatePayload returns
- Anchor to pagepage•
The page that was created.
- Anchor to userErrorsuser•
Errors [PageCreate non-nullUser Error!]! The list of errors that occurred from executing the mutation.
Was this section helpful?
- Creates a page
- pageCreate reference
Examples
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 mutation CreatePage($page: PageCreateInput!) {6 pageCreate(page: $page) {7 page {8 id9 title10 handle11 }12 userErrors {13 code14 field15 message16 }17 }18 }`,19 {20 variables: {21 "page": {22 "title": "New Page Title",23 "handle": "new-page-title",24 "body": "This is the content of the page.",25 "isPublished": true,26 "templateSuffix": "custom"27 }28 },29 },30);3132const data = await response.json();33
mutation CreatePage($page: PageCreateInput!) {
pageCreate(page: $page) {
page {
id
title
handle
}
userErrors {
code
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation CreatePage($page: PageCreateInput!) { pageCreate(page: $page) { page { id title handle } userErrors { code field message } } }",
"variables": {
"page": {
"title": "New Page Title",
"handle": "new-page-title",
"body": "This is the content of the page.",
"isPublished": true,
"templateSuffix": "custom"
}
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation CreatePage($page: PageCreateInput!) {
pageCreate(page: $page) {
page {
id
title
handle
}
userErrors {
code
field
message
}
}
}`,
{
variables: {
"page": {
"title": "New Page Title",
"handle": "new-page-title",
"body": "This is the content of the page.",
"isPublished": true,
"templateSuffix": "custom"
}
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation CreatePage($page: PageCreateInput!) {
pageCreate(page: $page) {
page {
id
title
handle
}
userErrors {
code
field
message
}
}
}`,
"variables": {
"page": {
"title": "New Page Title",
"handle": "new-page-title",
"body": "This is the content of the page.",
"isPublished": true,
"templateSuffix": "custom"
}
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation CreatePage($page: PageCreateInput!) {
pageCreate(page: $page) {
page {
id
title
handle
}
userErrors {
code
field
message
}
}
}
QUERY
variables = {
"page": {
"title": "New Page Title",
"handle": "new-page-title",
"body": "This is the content of the page.",
"isPublished": true,
"templateSuffix": "custom"
}
}
response = client.query(query: query, variables: variables)
Input variables
JSON1{2 "page": {3 "title": "New Page Title",4 "handle": "new-page-title",5 "body": "This is the content of the page.",6 "isPublished": true,7 "templateSuffix": "custom"8 }9}
Response
JSON1{2 "pageCreate": {3 "page": {4 "id": "gid://shopify/Page/1025371368",5 "title": "New Page Title",6 "handle": "new-page-title"7 },8 "userErrors": []9 }10}