Studio Docs

When to Use

Explain the linked schema on a Section (the declared data shape) and why declaring it once makes the Section auto-bind onto any template with a matching content type.

Use before build-section or build-connected-template when the user is new to Studio. Also when the user asks “why doesn’t my Section auto-bind?”, “what’s a linked schema?”, “do I have to wire each binding every time?”. Do NOT use to actually edit a linked schema: for that, edit the Section in Studio. Concept only.

Auth preflight: settle the credential before the first API call. Resolve it OAuth-first per authenticate-cma: CS_OAUTH_ACCESS_TOKEN, else the Contentstack MCP’s stored session. Never ask the user for a session authtoken. If nothing resolves, or a refresh fails with 400 invalid_refresh_token, hand them ! CONTENTSTACK_REGION=<code> npx @contentstack/mcp --auth (it needs a TTY and a browser, so it cannot be run for them) and wait. 403 error_code 316 is a valid credential aimed at another org: fix the org or the api_key, do not re-authenticate.

What is a Linked Schema?

The One-Line Answer

A linked schema is the data shape a Section says it needs (declared once on the Section) so that when the Section is dropped on any template whose content type has that shape, Studio binds every inner prop to the matching CMS fields automatically. No re-wiring per template.

Why This Exists

Without a linked schema, every time you drop a Section onto a new template, you’d have to wire every prop’s binding by hand. That’s tedious and error-prone, and it defeats reuse. A Section that takes 10 minutes to wire up per template isn’t really reusable.

With a linked schema, the Section says up front: “to render me, you need to give me a content shape with a title (string), a body (rich text), and a cover (image).” Studio then matches that declaration against the template’s connected content type and binds the fields automatically.

A Concrete Example

You have a Section called ”Blog Article Header.” It contains a Hero atomic component with props:

<Hero
  title="..."       // bound to ???
  subhead="..."     // bound to ???
  cover="..."       // bound to ???
/>

When you author the Section, you declare its linked schema:

linked_schemas: {
  title:   { field_type: "Single line text", required: true },
  subhead: { field_type: "Multi line text",  required: false },
  cover:   { field_type: "File (image)",     required: true },
}

This says: “any content type with a title, optional subhead, and cover can drive this Section.”

Now you create three connected templates against three different content types:

TemplateConnected CTCT has these fieldsSection drops and…
Blog post templateblog_posttitle, subhead, cover, body, author, …Auto-binds all three slots silently
Case study templatecase_studytitle, cover, body, client, … (no subhead)Auto-binds title + cover. Leaves subhead empty
Product launch templateproduct_launchname, description, imageNo match by field name: Section drops unbound and Studio asks you to pick fields manually (or the template author edits the CT to add matching fields)

Same Section. Three templates. Zero manual binding when the shape matches.

What “the Shape Matches” Actually Means

Studio’s auto-binder matches on three signals, in order:

  1. Field name (UID): the Section’s linked-schema field UID equals a field UID on the template’s connected CT.
  2. Field type: the type matches (Single Line Text binds to Single Line Text. Not a Multi-line being squeezed into a Single Line).
  3. Required-ness: required fields on the linked schema MUST exist on the CT. Optional ones may be missing.

If all three line up for a given prop, Studio binds it. If even one mismatches, that prop drops unbound and the template author is prompted.

Why Declare a Linked Schema at All (vs. Binding Per Template)

Three benefits:

Without linked schema (bind per template)With linked schema (declare once)
Drop Section, wire 6 bindings, saveDrop Section, and all 6 bindings are done
Add a new template against a similar CT, and repeat all 6 bindingsAdd a new template, and auto-bind is instant if the CT matches
Forget to wire one binding, which produces a silent empty renderLinked schema enforces the required props are filled
Rename a CMS field, which breaks every template that uses the SectionRename a CMS field, fix the linked schema once, and every template re-binds

What If the Template’s CT Doesn’t Match the Linked Schema?

Three outcomes depending on the kind of mismatch:

MismatchWhat Studio does
Required field missing on CTSection drops unbound. Right-panel Settings shows the required field with a red “no source” warning. Author must either pick a different field (rare, they share a UID by convention) or add the field to the CT.
Optional field missing on CTSection drops. That prop renders empty ("" / null). No warning.
Field exists on CT but type differsSection drops unbound for that prop. Studio asks the author to pick a compatible field manually.
Field exists on CT but a different UID (e.g. CT calls it headline, Section linked schema calls it title)Section drops unbound for that prop. The author maps the binding manually one time. This is rare: teams usually align CT field names with the Section’s expected UIDs.

How Linked Schemas Appear in Studio

  • Section author sets the linked schema when authoring the Section, in the Section’s Settings panel, “Linked Schema” tab.
  • Template author doesn’t see the linked schema directly. They just experience the auto-binding (or the prompt to fix a mismatch). The schema is the contract Studio uses behind the scenes.

What Linked Schemas Are NOT

MisconceptionReality
“Linked schema = the connected content type”No. The linked schema is the Section’s declared expectation. The connected content type is what a template is attached to. They’re matched, not the same thing.
“Linked schema defines new CMS fields”No. It references the shape of fields you’ve already defined in your CMS (or the conventions you want CTs to follow). It doesn’t create CT fields.
“I have to use the exact same UIDs the Section expects”Not strictly, but it makes auto-binding silent. Different UIDs require manual binding on first drop.

Next Steps

If you want to…Skill / doc
Create a Section with a linked schemabuild-section
Understand what happens when a Section drops on a templateunderstand-auto-binding
Read the long-form referencedocs/reference/linked-schema-matching-rules.md
Inspect a Section’s linked schemaOpen the Section in Studio, then in the right panel open Settings, then Linked Schema

Sections have no data of their own: selectedField scopes the slice

The linked schema declares what fields the Section CAN read, but the Section itself is data-less at author time. When it’s placed on a template, the SDK calls getScopedData(pageEntry, selectedField):

  • With selectedField set, template inside the section becomes that field’s value only.
  • With selectedField unset, template becomes the whole page entry.

Consequence: the Section’s own canvas always shows one empty placeholder, not the rendered card: the data only arrives at template-render time. See build-section § How a Section gets its data for the set-vs-unset decision rule. Wire shapes and reference-iteration handling in author-composition-via-api § Authoring a Section composition: scoping rules.

See Also

  • understand-sections: the parent concept
  • understand-auto-binding: what happens at drop time when a linked schema matches
  • build-section § How a Section gets its data: the selectedField decision rule
  • author-composition-via-api § Authoring a Section composition: full wire shapes for selectedField + resolvedReferences
  • docs/sections/binding-to-cms.md: reference