curl --request POST \
--url https://studio.weaverse.io/api/v1/content/projects/{projectId}/template-assignments/{pageId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assignments": [
{
"handle": "summer-sale",
"shopifyResourceId": "gid://shopify/Collection/123456789"
},
{
"handle": "winter-drop",
"shopifyResourceId": "gid://shopify/Collection/987654321"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assignments: [
{handle: 'summer-sale', shopifyResourceId: 'gid://shopify/Collection/123456789'},
{handle: 'winter-drop', shopifyResourceId: 'gid://shopify/Collection/987654321'}
]
})
};
fetch('https://studio.weaverse.io/api/v1/content/projects/{projectId}/template-assignments/{pageId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://studio.weaverse.io/api/v1/content/projects/{projectId}/template-assignments/{pageId}"
payload = { "assignments": [
{
"handle": "summer-sale",
"shopifyResourceId": "gid://shopify/Collection/123456789"
},
{
"handle": "winter-drop",
"shopifyResourceId": "gid://shopify/Collection/987654321"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "template_assignments",
"pageId": "clz2r7t5w0002mnop9012qrst",
"type": "COLLECTION",
"requested": 2,
"created": [
{
"handle": "summer-sale",
"locale": "",
"assignmentId": "clz5b1c2d0008wxyz3456abcd"
}
],
"existing": [
{
"handle": "winter-drop",
"locale": "",
"assignmentId": "clz5b0a1b0009wxyz7890efgh"
}
]
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "CONFLICT",
"message": "1 of 2 resource(s) already belong to a different page; no assignments were created",
"status": 409,
"details": {
"conflicts": [
{
"handle": "winter-drop",
"locale": "",
"assignmentId": "clz5b0a1b0009wxyz7890efgh"
}
]
}
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}Assign resources to a shared template page
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 pageId, so the template content stays shared, not copied. To create an independent, editable copy per resource, use POST /projects/{projectId}/pages instead.
- The target must be a live page assigned to this project. Its type is derived from its existing assignments and must be resource-backed (
PRODUCT,COLLECTION,PAGE,BLOG,ARTICLE); any other type returns400. - Send 1-100 entries in
assignments.handleis the Shopify resource handle (trimmed, kept verbatim);localedefaults to the global assignment (""). - A resource already assigned to this page is an idempotent no-op, reported under
existing. - All-or-nothing. Every handle is checked first. If any handle already belongs to a different live page, the whole request returns
409 CONFLICTwith the clashing handles indetails.conflicts, and nothing is written. A resource is never repointed away from another page: unassign it from its current template, then retry. - New rows are created in a single transaction. All lookups and writes are scoped to
projectId.
Required scope: content:write
curl --request POST \
--url https://studio.weaverse.io/api/v1/content/projects/{projectId}/template-assignments/{pageId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assignments": [
{
"handle": "summer-sale",
"shopifyResourceId": "gid://shopify/Collection/123456789"
},
{
"handle": "winter-drop",
"shopifyResourceId": "gid://shopify/Collection/987654321"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assignments: [
{handle: 'summer-sale', shopifyResourceId: 'gid://shopify/Collection/123456789'},
{handle: 'winter-drop', shopifyResourceId: 'gid://shopify/Collection/987654321'}
]
})
};
fetch('https://studio.weaverse.io/api/v1/content/projects/{projectId}/template-assignments/{pageId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://studio.weaverse.io/api/v1/content/projects/{projectId}/template-assignments/{pageId}"
payload = { "assignments": [
{
"handle": "summer-sale",
"shopifyResourceId": "gid://shopify/Collection/123456789"
},
{
"handle": "winter-drop",
"shopifyResourceId": "gid://shopify/Collection/987654321"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "template_assignments",
"pageId": "clz2r7t5w0002mnop9012qrst",
"type": "COLLECTION",
"requested": 2,
"created": [
{
"handle": "summer-sale",
"locale": "",
"assignmentId": "clz5b1c2d0008wxyz3456abcd"
}
],
"existing": [
{
"handle": "winter-drop",
"locale": "",
"assignmentId": "clz5b0a1b0009wxyz7890efgh"
}
]
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "CONFLICT",
"message": "1 of 2 resource(s) already belong to a different page; no assignments were created",
"status": 409,
"details": {
"conflicts": [
{
"handle": "winter-drop",
"locale": "",
"assignmentId": "clz5b0a1b0009wxyz7890efgh"
}
]
}
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}Authorizations
Bearer authentication: a shop API key (WEAVERSE_API_KEY), a scoped API key, a delegated MCP OAuth token, or (translation-unit routes only) a project-bound translation agent token. Scopes: content:read — Read projects, pages, theme settings, versions, drafts and translation units. content:write — Save drafts and make non-destructive edits (page items, metadata, SEO, assignments, languages, glossary). Never publishes or deletes. content:publish — Publish drafts, schedule/reschedule/cancel publications, restore versions, publish global sections. content:delete — Delete pages, global sections, languages, static keys, override reverts; required with project:manage for project deletion. project:manage — Create/copy/delete projects, settings, variants, hierarchy, backups, restore-as-new, previews, hostname policy. translations:read — Read translation units only (no general content access). translations:write — Apply translation units only; never mutates page content. A legacy unscoped API key keeps read/write/translation baseline access and every pre-scope endpoint, but never gains publish/delete/project-manage implicitly.
Path Parameters
The template page id to assign resources to.
Body
Shopify resources to assign to this template page. Each becomes its own assignment row pointing at the same page — no page copies are created.
1 - 100 elementsShow child attributes
Show child attributes
Response
Assignments applied. created = new rows; existing = idempotent no-ops.
Was this page helpful?