Block or unblock a storefront hostname
curl --request POST \
--url https://studio.weaverse.io/api/v1/content/projects/{projectId}/hostnames \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hostname": "preview.example.com",
"blocked": true,
"confirm": "preview.example.com"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({hostname: 'preview.example.com', blocked: true, confirm: 'preview.example.com'})
};
fetch('https://studio.weaverse.io/api/v1/content/projects/{projectId}/hostnames', 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}/hostnames"
payload = {
"hostname": "preview.example.com",
"blocked": True,
"confirm": "preview.example.com"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"hostname": "preview.example.com",
"blocked": true,
"propagationSeconds": 30
}{
"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>"
}Previews and hostnames
Block or unblock a storefront hostname
Sets the block policy for one hostname. This changes edge serving outside Studio: requests attributed to a blocked hostname (by the storefront URL the Hydrogen SDK declares) are refused this project’s content. It is containment, not authentication.
hostnamemust be a bare canonical hostname (no scheme, path, port or credentials, at most 253 characters); anything else is refused with 400 rather than reinterpreted.confirmmust equal the hostname (lowercase); a missing or different value is a 400.- Desired-state write:
blockedsets the state, so a replayed request converges instead of toggling. - The change reaches the edge within
propagationSeconds. - 503 when the policy service is unavailable; nothing changed.
Required scope: project:manage
POST
/
projects
/
{projectId}
/
hostnames
Block or unblock a storefront hostname
curl --request POST \
--url https://studio.weaverse.io/api/v1/content/projects/{projectId}/hostnames \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hostname": "preview.example.com",
"blocked": true,
"confirm": "preview.example.com"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({hostname: 'preview.example.com', blocked: true, confirm: 'preview.example.com'})
};
fetch('https://studio.weaverse.io/api/v1/content/projects/{projectId}/hostnames', 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}/hostnames"
payload = {
"hostname": "preview.example.com",
"blocked": True,
"confirm": "preview.example.com"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"hostname": "preview.example.com",
"blocked": true,
"propagationSeconds": 30
}{
"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>"
}Authorizations
Bearer token: a shop API key (WEAVERSE_API_KEY), a scoped API key or a delegated MCP OAuth token; translation-unit routes also accept a project-bound translation agent token. Each operation lists the scope it requires; the scope table is in the API description.
Path Parameters
Body
application/json
Response
Policy applied (propagationSeconds)
The response is of type object.
Was this page helpful?