/sitecore-platform:sitecoreai-graphql-schemasfrom Sitecore Platform (SitecoreAI)
Introspection-verified reference for SitecoreAI GraphQL endpoints (Authoring, Edge Preview/Live) covering root queries, item/field/template shapes, mutations, and pitfalls. Load before writing GraphQL queries.
Ships in Sitecore Platform (SitecoreAI). Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill is the schema reference; it is NOT the SDK call reference. Use this with
marketplace-sdk-xmc(which documents the SDK envelope:xmc.authoring.graphqlis aclient.mutate,xmc.preview.graphqlis aclient.query, response unwrap rules, etc.). This skill answers "what GraphQL fields actually exist on the server?"
xmc.authoring.graphql body (any item read or write, item template introspection, search, publishing, language management, role/user management).xmc.preview.graphql / xmc.live.graphql body (read-only published-content access — Edge endpoint)..d.ts for xmc.*.graphql shows data: [key: string]: unknown and you need to know what shape to expect underneath.| Endpoint | URL pattern | Auth | Schema flavor | Use for |
|---|---|---|---|---|
| Authoring | https://<tenant>.sitecorecloud.io/sitecore/api/authoring/graphql/v1 | Authorization: Bearer <OAuth-JWT> | Generic — Item/ItemField/ItemTemplate work for any template | Read unpublished content, mutate items, manage versions, publishing, sites, roles, users |
| Edge / Preview / Live | https://<tenant>.sitecorecloud.io/sitecore/api/graph/edge | sc_apikey: <api-key> | Concrete-types-per-template — every Sitecore template gets its own GraphQL type (Edge schema introspected with 872 types in the test tenant) | Read published content via typed queries; layout / route resolution; Pages-app preview rendering |
The SDK calls map onto these endpoints:
xmc.authoring.graphql → Authoring endpoint (via the portal's bearer-token bridge).xmc.preview.graphql → Edge endpoint, preview variant. (Confirm via node_modules/@sitecore-marketplace-sdk/xmc/dist/...client-authoring/types.gen.d.ts and client-pages-or-equivalent / preview module's .d.ts.)xmc.live.graphql → Edge endpoint, live variant.When inside a Marketplace app, use the SDK call (the portal handles auth). The direct-curl form documented below is for introspection / spike work.
The verified Authoring shapes — root Query, ItemQueryInput, Item, ItemField, ItemTemplateField, the connection types and the mutation surface — are in references/authoring-shapes.md (distilled JSON in references/authoring-types.json). Open it before writing any xmc.authoring.graphql query — citing a verified shape is the whole point of this skill.
872 types total. Edge schema is dramatically different from Authoring — it's a "concrete-types-per-template" model. Every Sitecore template (Accordion, ArticlePage, BrandList, ...) becomes its own GraphQL type with strongly-typed fields. The 14-type distilled subset for the generic Item lives at references/edge-types.json.
Querytype Query {
item(path: String, language: String!, version: String): Item
layout(site: String!, routePath: String!, language: String!): LayoutData
search(where: ItemSearchPredicateInput!, after: String, first: Int, orderBy: ItemSearchOrderByInput): ItemSearchResults
site: SiteData
}
That's it — only 4 root queries on Edge. No mutations (Edge is read-only).
version is String on Edge, Int on Authoring# Edge:
item(path: $path, language: $lang, version: "5") { ... } # String!
# Authoring:
item(where: { path: $path, language: $lang, version: 5 }) { ... } # Int!
When porting between endpoints, this trips up implementations. The $version variable type must match the endpoint.
Item (generic; concrete templates inherit)type Item {
id(format: String): ID!
name: String!
displayName: String
path: String!
url: ItemUrl!
language: ItemLanguage!
languages: [Item]!
version: Int! # the resolved version (always Int on output)
template: ItemTemplate!
parent: Item
ancestors(hasLayout: Boolean, includeTemplateIDs: [String]): [Item]!
children(hasLayout: Boolean, includeTemplateIDs: [String], first: Int, after: String): ItemSearchResults
hasChildren(...): Boolean!
fields(ownFields: Boolean): [ItemField]!
field(name: String!): ItemField
rendered: JSON! # JSON-rendered form for headless heads
personalization: ItemPersonalization
}
Key differences vs Authoring:
versions(allLanguages: ...) — Edge serves one version at a time.fields returns [ItemField]! directly, not a Connection. ownFields: Boolean is the only arg.rendered: JSON! — gives back the headless rendering shape (used by Content SDK heads).id(format: String) (lowercase, takes a String) vs Authoring's itemId(format: IdFormat) (typed enum).For any template the tenant uses — say, ArticlePage — Edge exposes a typed object:
type ArticlePage {
... # specific fields per template
... # plus all the generic Item fields
}
This means a Pages-aware client can write strongly-typed queries. For a generic content diff (no template-specific knowledge), use the generic Item interface paths.
LayoutData (the layout query)type Query {
layout(site: String!, routePath: String!, language: String!): LayoutData
}
Returns a typed layout/rendering tree for a route. Used by Content SDK for headless rendering. Useful for Marketplace apps that want to inspect the rendered layout per route — though for per-version layout, the Authoring endpoint's Item.field(name: "__Final Renderings") is more direct.
ItemSearchResults and searchEdge search(where: ItemSearchPredicateInput!, ...) returns:
type ItemSearchResults {
total: Int!
pageInfo: PageInfo!
results: [Item]
facets: [ItemSearchFacet]!
}
ItemSearchPredicateInput supports faceted queries; useful for content-discovery apps.
Edge search(where:) and Authoring search(query:) are item search over CM / Edge, not SitecoreAI integrated search sources (sitecoreai-search-sources, content-sdk-search).
| Endpoint | Header | Source |
|---|---|---|
| Authoring | Authorization: Bearer <OAuth2-JWT> | OAuth2 client-credentials grant (per sitecoreai-auth); Marketplace SDK manages this internally for xmc.authoring.graphql. |
| Edge / Preview / Live | sc_apikey: <API-KEY> | Per-environment Edge API key from Cloud Portal. |
⚠️ The API key header for Edge is named sc_apikey (lowercase, with underscore) — not Authorization, not X-API-Key, not apiKey. Confirmed via 200-vs-403 test on the introspected tenant.
⚠️ The Authoring header is Authorization: Bearer <token> — not sc_apikey: bearer <token>. The latter returns HTTP 200 with a GraphQL errors array ("The current user is not authorized to access this resource"), which is misleading because it looks like a successful HTTP exchange.
Four copy-ready examples live in references/worked-examples.md, section numbers kept:
versions() form, alias-per-version fallback, SDK call wrapper).uploadMedia → POST binary).version arg type differs. Authoring Int!, Edge String. Mismatched variable type → cryptic GraphQL validation error.where: is mandatory on Authoring. No item(path: ..., language: ...) shortcut — wrap in where: { ... }.fields(...) connection requires three args with no defaults. excludeStandardFields: Boolean!, ownFields: Boolean!, withLanguageFallback: Boolean! — all marked NON_NULL, so omitting them errors out.ItemField.value is always String!. Image fields return XML strings (e.g. <image mediaid="{...}" alt="..."/>); Link fields return XML; multilist returns pipe-separated GUIDs. Parse client-side per field type.ItemPublish and ItemAccess are nested objects, not booleans. Item.publish.published (or similar) — verify the exact subfield via introspection.xmc.authoring.graphql is a MUTATION on the SDK. Single .data unwrap, not double. The schema underneath has a Query root, but the SDK call signature is client.mutate(...) because the SDK wraps both reads and writes through the same POST endpoint. See marketplace-sdk-xmc § 8b for the unwrap matrix.Item.fields: [ItemField]! is plain list, not a Connection. No pagination, no nodes wrapper — just access the array./ide/" suffix is a 404 on the Edge endpoint — drop it. The base URL is /sitecore/api/graph/edge (no trailing path).sitecoreai-auth. The Marketplace SDK handles this internally for in-app calls.updateItem / createItem accept a newline-joined multi-value field, an undashed GUID or an unescaped & in Link XML. They read it back unchanged and report success. Then inheritance resolves zero fields, the page loses its layout, or the link renders empty. Multi-value fields are |-joined on write as well as read, and GUIDs are braced, dashed and uppercase. The full table is in the content-sdk-create-component skill, section "Write-side wire formats" of its GraphQL sequence reference (install sitecore-content-sdk to get it).language(name:) returns a value for any valid culture, so it is no existence check (use languageItem). Edge preview counts a literal first: toward complexity: siteInfo.dictionary(first: 61){ results{ key value } } is "Query is too complex", while the same value passed as a variable works up to 1000. first: 1001 is a warning plus clamp on live and a hard error on preview. The Edge language argument is case-insensitive. Shapes: references/authoring-shapes.md § 1.8.The schemas WILL evolve. When in doubt, re-introspect:
# Edge / Preview
curl -sS -X POST 'https://<tenant>/sitecore/api/graph/edge' \
-H 'Content-Type: application/json' \
-H 'sc_apikey: <YOUR-EDGE-KEY>' \
--data-binary @references/introspection-query.graphql.json \
-o edge-schema.json
# Authoring
curl -sS -X POST 'https://<tenant>/sitecore/api/authoring/graphql/v1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YOUR-OAUTH-JWT>' \
--data-binary @references/introspection-query.graphql.json \
-o authoring-schema.json
(The .json form is the introspection query wrapped as {"query": "..."} per GraphQL POST convention. References ship the query in .graphql form for human reading; wrap before posting.)
After re-introspecting, python -m json.tool < schema.json | grep '"name"' | sort -u to spot newly-added types or removed ones, and update references/{authoring,edge}-types.json here if the changes affect any of the documented types.
marketplace-sdk-xmc — SDK envelope, xmc.authoring.graphql / xmc.preview.graphql call signatures, module-vs-experimental modes, response unwrap matrix.marketplace-sdk-client — client.query vs client.mutate, params-wrapper behavior (Mode A wraps body under params, Mode B doesn't), error codes.sitecoreai-auth — OAuth2 client-credentials grant for Authoring header.sitecoreai-pages / sitecoreai-publishing / sitecoreai-sites — REST equivalents (when the SDK has no GraphQL surface).SKILL.md — this file.references/worked-examples.md — the four worked examples (§ 4 two-version fetch, § 5 template field metadata, § 6 Edge fetch, § 6b media upload + link).references/introspection-query.graphql — the introspection query used.references/authoring-types.json — distilled subset of the Authoring schema (37 types most relevant to content reads/writes/templates/publishing).references/edge-types.json — distilled subset of the Edge schema (14 types covering generic Item, search, layout).The full introspection results (5.4 MB Edge + 3.5 MB Authoring) are intentionally NOT shipped with the skill — re-introspect against your own tenant to capture template-specific Edge types.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
17 skills in this plugin
/sitecoreai-agentSitecoreAI Agent API: high-level REST actions such as create page with components, create personalization version and generate brief. Use as the default entry point for apps, MCP servers or automations. It powers the Marketer MCP./sitecoreai-authOAuth client-credentials auth for the SitecoreAI APIs (Agent, Pages, Publishing, Sites): automation client, token endpoint, scopes, env vars, caching, 401s. Load before the first API call. Not head-app Edge context ids./sitecoreai-brand-voiceWrites Sitecore page content in a brand's voice and identity, taken from the PRD or spec or a Sitecore brand kit, never guessed. Sets register (brand, marketing, technical-neutral). Use for copy on a brand or client site. Not page structure.npx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-platformOther plugins' skills for the same job