Skip to main content

Assign Template Resources

Assigns many Shopify resources to one existing template page — the shared-template model (one page, many assignments). Each resource becomes its own assignment row pointing at the same pageId, so the template’s content stays shared, not copied.
Use this when many resources should share one template. To instead create an independent, editable page copy per resource, use Create Page.
Requires a Content API key. See Authentication.

Path parameters

Request body

Per-assignment fields:

Behavior

  • The target page’s type is derived from its existing assignments and must be resource-backed.
  • A resource whose handle already points at this page is an idempotent no-op (returned under existing).
  • All-or-nothing. Every requested handle is checked first. If any handle already belongs to a different live page, the whole request is rejected with 409 CONFLICT (the clashing handles in details.conflicts) and nothing is written — a mixed batch never leaves partial assignments. A resource is never repointed away from another page.
  • New resources are created as assignment rows pointing at pageId, in a single transaction.
  • All lookups and writes are scoped strictly to projectId; the endpoint never touches another project’s pages.

Example

Response

On a 409, no assignment is created; inspect details.conflicts, unassign each clashing handle from its current template, then retry the batch.

Errors